Skip to content

Commit

Permalink
Dedupe and import lib cutscene funcs for PSX
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshSchreuder committed Feb 13, 2025
1 parent bb6ea09 commit 5a398de
Show file tree
Hide file tree
Showing 18 changed files with 576 additions and 124 deletions.
6 changes: 6 additions & 0 deletions config/splat.us.stlib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ segments:
- [0xDF0, data, unk_2FA80]
- [0x134C, .data, e_shop]
- [0x1528, data]
- [0x19BC, .data, cutscene]
- [0x1A68, data]
- [0x1C7C, .data, st_update]
- [0x1CA8, .data, collision]
- [0x2068, .data, e_red_door]
Expand Down Expand Up @@ -69,6 +71,8 @@ segments:
- [0x2CF14, .rodata, unk_33EC8]
- [0x2CF48, .rodata, unk_3420C]
- [0x2D278, .rodata, unk_36F30]
- [0x2D760, .rodata, cutscene]
- [0x2D804, .rodata, unk_3AF60]
- [0x2D848, .rodata, unk_3BEB0]
- [0x2D868, .rodata, unk_3C57C]
- [0x2D980, .rodata, e_chair]
Expand All @@ -95,6 +99,8 @@ segments:
- [0x33EC8, c, unk_33EC8]
- [0x3420C, c, unk_3420C]
- [0x36324, c, unk_36F30]
- [0x395EC, c, cutscene]
- [0x3AF60, c, unk_3AF60]
- [0x3BEB0, c, unk_3BEB0]
- [0x3C57C, c, unk_3C57C]
- [0x3EDD8, c, e_chair]
Expand Down
5 changes: 3 additions & 2 deletions config/symbols.pspeu.stlib.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ D_psp_0924BC68 = 0x092A5470;
D_psp_0924BC70 = 0x092A5478;
D_psp_0924BC78 = 0x092A5480;
D_us_80181ACC = 0x092A5700;
D_us_801D5288 = 0x092A5728;
D_us_801D51D4 = 0x092A5D20;
g_IsCutsceneDone = 0x092A5728;
g_Dialogue = 0x092A5CDC; // size:0x44
g_SkipCutscene = 0x092A5D20;
g_CutsceneFlags = 0x092A5D28;
2 changes: 2 additions & 0 deletions config/symbols.pspeu.stst0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ eRoomForegroundInit = 0x092799B0;
g_isSecretStairsButtonPressed = 0x09279D98;
D_80180908 = 0x09279DA0;
g_Dialogue = 0x0927BA58; // size = 0x44
g_IsCutsceneDone = 0x0927BA98;
g_SkipCutscene = 0x0927BAA0;
g_CutsceneFlags = 0x0927BAA8;
D_801BEE0C = 0x0927BAB0;
D_801BEE08 = 0x0927BAB8;
Expand Down
2 changes: 0 additions & 2 deletions config/symbols.pspeu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,4 @@ g_UseDisk = 0x091FC470;
g_CurrentBuffer = 0x091FC4E0;
g_GpuBuffers = 0x091FC4E8;
g_CastleFlags = 0x09234730;
g_IsCutsceneDone = 0x0927BA98;
g_SkipCutscene = 0x0927BAA0;
DestroyEntity = 0x092EE938;
31 changes: 6 additions & 25 deletions config/symbols.us.stlib.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ anim_bone_rot = 0x80182C90;
bone_projectile_velocity_x = 0x80182CF4;
sensors_special = 0x80182D24;
sensors_move = 0x80182D2C;
LIB_cutscene_data = 0x80183F68;
g_UnkPrimHelperRot = 0x801ADDA4;
LIB_EntityBackgroundBlock = 0x801ADED0;
PlayerIsWithinHitbox = 0x801ADF98;
Expand All @@ -67,11 +68,12 @@ EntityBackgroundShadow = 0x801AF7B8;
EntityLibrarianChair = 0x801B037C;
CutsceneUnk1 = 0x801B95EC;
SetCutsceneScript = 0x801B9640;
CutsceneUnk3 = 0x801B9804;
CutsceneUnk4 = 0x801B9860;
DrawCutsceneActorName = 0x801B9918;
SetCutsceneEnd = 0x801B9A9C;
CutsceneRun = 0x801B9AC8;
func_80194F14 = 0x801B9D74;
CutsceneSkip = 0x801B9D74;
ScaleCutsceneAvatar = 0x801B9E54;
LIB_EntityCutscene = 0x801B9F58;
EntityChair = 0x801BEE38;
Expand Down Expand Up @@ -201,29 +203,8 @@ g_LayoutObjHorizontal = 0x801D45C4;
g_LayoutObjVertical = 0x801D45C8;
g_LayoutObjPosHorizontal = 0x801D45CC;
g_LayoutObjPosVertical = 0x801D45D0;
g_Dialogue = 0x801D51D8;
D_801CB68C = 0x801D51DC;
D_801CB68E = 0x801D51DE;
D_801CB690 = 0x801D51E0;
D_801CB692 = 0x801D51E2;
D_801CB694 = 0x801D51E4;
D_801CB696 = 0x801D51E6;
D_801CB698 = 0x801D51E8;
D_801CB69A = 0x801D51EA;
D_801CB69C = 0x801D51EC;
D_801CB69E = 0x801D51EE;
D_801CB69F = 0x801D51EF;
D_801CB6A0 = 0x801D51F0;
D_801CB6A4 = 0x801D51F4;
D_801CB6A8 = 0x801D51F8;
D_801CB6AC = 0x801D51FC;
D_801CB6B0 = 0x801D5200;
D_801CB6B4 = 0x801D5204;
D_801CB6B8 = 0x801D5208;
D_801CB6BC = 0x801D520C;
D_801CB6C0 = 0x801D5210;
D_801CB6C4 = 0x801D5214;
D_801CB6C6 = 0x801D5216;
D_801CB6C8 = 0x801D5218;
g_SkipCutscene = 0x801D51D4;
g_Dialogue = 0x801D51D8; // size:0x44
g_CutsceneFlags = 0x801D5284;
g_IsCutsceneDone = 0x801D5288;
g_ItemIconSlots = 0x801D528C;
8 changes: 7 additions & 1 deletion src/st/cutscene_unk1.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#ifdef STAGE_IS_LIB
#define CUTSCENE_UNK1_NEXT_X 0x42
#else
#define CUTSCENE_UNK1_NEXT_X 2
#endif

static void CutsceneUnk1(void) {
g_Dialogue.nextLineY = g_Dialogue.startY + 0x14;
g_Dialogue.nextCharX = g_Dialogue.nextLineX = 2;
g_Dialogue.nextCharX = g_Dialogue.nextLineX = CUTSCENE_UNK1_NEXT_X;
g_Dialogue.nextCharY = 0;
g_Dialogue.unk12 = 0;
g_Dialogue.nextCharTimer = 0;
Expand Down
9 changes: 8 additions & 1 deletion src/st/cutscene_unk3.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#ifdef STAGE_IS_LIB
#define CUTSCENE_UNK3_RECT_X 64
#else
#define CUTSCENE_UNK3_RECT_X 0
#endif

#if defined(VERSION_PSP)
extern void* D_pspeu_0927B6A8;
#endif

static void CutsceneUnk3(s16 arg0) {
RECT rect;
rect.x = 0;
rect.x = CUTSCENE_UNK3_RECT_X;
rect.y = (arg0 * 12) + 384;
rect.w = 64;
rect.h = 12;
Expand Down
8 changes: 7 additions & 1 deletion src/st/cutscene_unk4.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#ifdef STAGE_IS_LIB
#define CUTSCENE_UNK4_TPAGE 0x11
#else
#define CUTSCENE_UNK4_TPAGE 0x10
#endif

static void CutsceneUnk4(void) {
Primitive* prim;

CutsceneUnk3(g_Dialogue.nextCharY);
prim = g_Dialogue.prim[g_Dialogue.nextCharY];
prim->tpage = 0x10;
prim->tpage = CUTSCENE_UNK4_TPAGE;
prim->clut = g_Dialogue.clutIndex;
prim->y0 = g_Dialogue.nextLineY;
prim->u0 = 0;
Expand Down
23 changes: 4 additions & 19 deletions src/st/dre/cutscene.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,7 @@ static void CutsceneRun(void) {
}
}

void func_80194F14(Entity* self) {
if (g_pads[0].tapped == PAD_START) {
g_SkipCutscene = 1;
g_api.FreePrimitives(self->primIndex);
self->flags ^= FLAG_HAS_PRIMS;
if (g_Dialogue.primIndex[1] != -1) {
g_api.FreePrimitives(g_Dialogue.primIndex[1]);
}
if (g_Dialogue.primIndex[0] != -1) {
g_api.FreePrimitives(g_Dialogue.primIndex[0]);
}
g_api.PlaySfx(SET_STOP_MUSIC);
self->step = 1;
self->step_s = 0;
}
}
#include "../cutscene_skip.h"

#include "../cutscene_scale_avatar.h"

Expand All @@ -109,14 +94,14 @@ void OVL_EXPORT(EntityCutscene)(Entity* self) {
if (self->step) {
if (g_IsCutsceneDone && !g_SkipCutscene) {
if (g_IsTimeAttackUnlocked) {
func_80194F14(self);
CutsceneSkip(self);
} else {
if (self->params) {
if (g_Settings.D_8003CB04 & 0x2000) {
func_80194F14(self);
CutsceneSkip(self);
}
} else if (g_Settings.D_8003CB04 & 0x1000) {
func_80194F14(self);
CutsceneSkip(self);
}
}
}
Expand Down
Loading

0 comments on commit 5a398de

Please sign in to comment.