2020-03-17 04:31:30 +00:00
|
|
|
#include <ultra64.h>
|
2020-06-17 11:16:30 +00:00
|
|
|
#include <ultra64/controller.h>
|
2020-03-17 04:31:30 +00:00
|
|
|
#include <global.h>
|
|
|
|
|
|
|
|
u16 D_8011E1C0 = 0;
|
|
|
|
u16 D_8011E1C4 = 0;
|
|
|
|
|
|
|
|
typedef void (*CutsceneStateHandler)(GlobalContext*, CutsceneContext*);
|
|
|
|
|
|
|
|
void func_80064720(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
|
|
|
void func_80064760(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
|
|
|
void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
|
|
|
void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
|
|
|
void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
|
|
|
void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
CutsceneStateHandler sCsStateHandlers1[] = {
|
|
|
|
func_80064720, func_80064760, func_80064720, func_80068D84, func_80064720,
|
2020-03-17 04:31:30 +00:00
|
|
|
};
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
CutsceneStateHandler sCsStateHandlers2[] = {
|
|
|
|
func_80064720, func_800647C0, func_80068C3C, func_80068DC0, func_80068C3C,
|
2020-03-17 04:31:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
u8 sTitleCsState = 0;
|
|
|
|
|
|
|
|
// TODO: use symbols for these cutscene locations once scenes and rooms are in C
|
2020-03-22 21:19:43 +00:00
|
|
|
EntranceCutscene sEntranceCutsceneTable[] = {
|
|
|
|
{ 0x0185, 2, 0xA0, 0x02013AA0 }, { 0x013D, 2, 0xA1, 0x02007EA0 }, { 0x00DB, 2, 0xA3, 0x0200A540 },
|
|
|
|
{ 0x0108, 2, 0xA4, 0x02003D70 }, { 0x0138, 1, 0xA5, 0x02003F40 }, { 0x014D, 2, 0xA6, 0x02008400 },
|
|
|
|
{ 0x0053, 2, 0xA7, 0x0200CE00 }, { 0x0000, 2, 0xA8, 0x0200B650 }, { 0x028A, 0, 0x18, 0x0200F9E0 },
|
|
|
|
{ 0x0292, 0, 0x18, 0x0200FF00 }, { 0x028E, 0, 0x18, 0x02010550 }, { 0x0476, 0, 0x18, 0x02010B30 },
|
|
|
|
{ 0x050F, 1, 0xA9, 0x0200BB80 }, { 0x0102, 2, 0xB1, 0x02007A30 }, { 0x0117, 2, 0xB2, 0x020031E0 },
|
|
|
|
{ 0x0129, 2, 0xB3, 0x02006490 }, { 0x0157, 2, 0xB4, 0x02005BD0 }, { 0x0028, 2, 0xB5, 0x02015600 },
|
|
|
|
{ 0x00E4, 2, 0xB6, 0x020070C0 }, { 0x0225, 2, 0xB7, 0x02004A80 }, { 0x0123, 2, 0xB8, 0x02007990 },
|
|
|
|
{ 0x0147, 2, 0xB9, 0x020076D0 }, { 0x0138, 0, 0xBA, 0x02004280 }, { 0x0574, 2, 0x5A, 0x020028E0 },
|
|
|
|
{ 0x0538, 2, 0xBB, 0x0201E790 }, { 0x053C, 2, 0xBC, 0x0201EF70 }, { 0x0540, 2, 0xBD, 0x02021380 },
|
|
|
|
{ 0x0544, 2, 0xBE, 0x0201E3E0 }, { 0x0548, 2, 0xBF, 0x0201DF90 }, { 0x054C, 2, 0xAD, 0x0201EB40 },
|
|
|
|
{ 0x008D, 0, 0xC0, 0x02002BB0 }, { 0x03B4, 0, 0xC7, 0x020055C0 }, { 0x0246, 2, 0xB9, 0x020076D0 },
|
2020-03-17 04:31:30 +00:00
|
|
|
{ 0x05E8, 2, 0xC6, 0x0200C9D0 },
|
|
|
|
};
|
|
|
|
|
|
|
|
// Unused, seems to be an early list of dungeon entrance cutscene locations
|
2020-03-22 21:19:43 +00:00
|
|
|
u32 D_8011E304[] = { 0x0200B650, 0x02015600, 0x02014F80, 0x02003F80, 0x02000330, 0x0201DA50 };
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
u16 D_8015FCC0;
|
|
|
|
u16 D_8015FCC2;
|
|
|
|
u16 D_8015FCC4;
|
|
|
|
s16 D_8015FCC6;
|
|
|
|
u8 D_8015FCC8;
|
|
|
|
s16 D_8015FCCA;
|
2020-04-16 21:36:12 +00:00
|
|
|
u16 D_8015FCCC; // only written to, never read
|
|
|
|
char D_8015FCD0[20]; // unreferenced
|
|
|
|
u8 D_8015FCE4; // only written to, never read
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx);
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
GfxPrint printer;
|
|
|
|
u8 pad2[8];
|
|
|
|
|
2020-06-14 02:59:58 +00:00
|
|
|
GfxPrint_Init(&printer);
|
2020-03-17 04:31:30 +00:00
|
|
|
GfxPrint_Open(&printer, *dlist);
|
|
|
|
GfxPrint_SetPos(&printer, 22, 25);
|
|
|
|
GfxPrint_SetColor(&printer, 255, 255, 55, 32);
|
|
|
|
GfxPrint_Printf(&printer, "%s", "FLAME ");
|
|
|
|
GfxPrint_SetColor(&printer, 255, 255, 255, 32);
|
|
|
|
GfxPrint_Printf(&printer, "%06d", csCtx->frames);
|
|
|
|
GfxPrint_SetColor(&printer, 50, 255, 255, 60);
|
|
|
|
GfxPrint_SetPos(&printer, 4, 26);
|
|
|
|
GfxPrint_Printf(&printer, "%s", "SKIP=(START) or (Cursole Right)");
|
|
|
|
*dlist = GfxPrint_Close(&printer);
|
2020-06-14 02:59:58 +00:00
|
|
|
GfxPrint_Destroy(&printer);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_IDLE;
|
|
|
|
csCtx->unk_0C = 0.0f;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80064520(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_SKIPPABLE_INIT;
|
|
|
|
csCtx->linkAction = NULL;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
|
|
|
if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneIndex < 0xFFF0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
sCsStateHandlers1[csCtx->state](globalCtx, csCtx);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-04-06 16:39:17 +00:00
|
|
|
Input* pad1 = &globalCtx->state.input[0];
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-22 12:33:10 +00:00
|
|
|
if (CHECK_PAD(pad1->press, L_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC8 = 0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-22 12:33:10 +00:00
|
|
|
if (CHECK_PAD(pad1->press, U_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4) &&
|
2020-04-16 21:36:12 +00:00
|
|
|
(D_8011D394 == 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC8 = 1;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.cutsceneTrigger != 0) && (globalCtx->sceneLoadFlag == 0x14)) {
|
|
|
|
gSaveContext.cutsceneTrigger = 0;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
// Translates to: "CUTSCENE START REQUEST ANNOUNCEMENT!"
|
|
|
|
osSyncPrintf("\nデモ開始要求 発令!");
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80068ECC(globalCtx, csCtx);
|
2020-04-06 16:39:17 +00:00
|
|
|
sCsStateHandlers2[csCtx->state](globalCtx, csCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80064720(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
u32 func_8006472C(GlobalContext* globalCtx, CutsceneContext* csCtx, f32 target) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return Math_ApproxF(&csCtx->unk_0C, target, 0.1f);
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80064760(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Interface_ChangeAlpha(1);
|
2020-07-09 01:54:39 +00:00
|
|
|
ShrinkWindow_SetVal(0x20);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (func_8006472C(globalCtx, csCtx, 1.0f)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F68BC(1);
|
|
|
|
csCtx->state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80068C3C(globalCtx, csCtx);
|
|
|
|
Interface_ChangeAlpha(1);
|
2020-07-09 01:54:39 +00:00
|
|
|
ShrinkWindow_SetVal(0x20);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (func_8006472C(globalCtx, csCtx, 1.0f)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F68BC(1);
|
|
|
|
csCtx->state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 3: Misc. Actions
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Player* player = PLAYER;
|
|
|
|
f32 temp;
|
|
|
|
u8 sp3F;
|
|
|
|
|
|
|
|
sp3F = 0;
|
|
|
|
|
2020-03-23 23:11:21 +00:00
|
|
|
if ((csCtx->frames < cmd->startFrame) || (csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
temp = func_8006F93C(cmd->endFrame - 1, cmd->startFrame, csCtx->frames);
|
|
|
|
|
2020-03-23 23:11:21 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
sp3F = 1;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 1:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F6D58(0xE, 4, 0x3F);
|
|
|
|
func_800F6D58(0xE, 1, 1);
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_EE[0] = 0x14;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F6D58(0xF, 0, 0);
|
|
|
|
func_800753C4(globalCtx, 3);
|
2020-04-06 16:39:17 +00:00
|
|
|
if (1) {}
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FD70 = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2020-05-01 02:00:39 +00:00
|
|
|
Flags_SetEnv(globalCtx, 0);
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.entranceIndex == 0x0053) {
|
2020-05-01 02:00:39 +00:00
|
|
|
Flags_SetEnv(globalCtx, 2);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 6:
|
2020-04-16 21:36:12 +00:00
|
|
|
if (globalCtx->envCtx.unk_A0 < 0x3200) {
|
|
|
|
globalCtx->envCtx.unk_A0 += 0x23;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_19 = 1;
|
|
|
|
globalCtx->envCtx.gloomySky = 1;
|
|
|
|
globalCtx->envCtx.unk_18 = 0;
|
|
|
|
globalCtx->envCtx.unk_1A = 0x3C;
|
|
|
|
globalCtx->envCtx.unk_21 = 1;
|
|
|
|
globalCtx->envCtx.unk_1F = 0;
|
|
|
|
globalCtx->envCtx.unk_20 = 1;
|
|
|
|
globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24 = 0x3C;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 8:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (globalCtx->unk_11D30[0] < 0x80) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->unk_11D30[0] += 4;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 9:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_EE[3] = 0x10;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 10:
|
2020-05-01 02:00:39 +00:00
|
|
|
Flags_SetEnv(globalCtx, 1);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 11:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (globalCtx->unk_11D30[0] < 0x672) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->unk_11D30[0] += 0x14;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
|
|
|
if (csCtx->frames == 0x30F) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80078884(NA_SE_EV_DEKU_DEATH);
|
2020-03-23 23:11:21 +00:00
|
|
|
} else if (csCtx->frames == 0x2CD) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->unk_11D30[0] = 0;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2020-03-23 23:11:21 +00:00
|
|
|
if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 13:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (globalCtx->unk_11D30[1] == 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80078884(NA_SE_EV_TRIFORCE_FLASH);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
|
|
|
if (globalCtx->unk_11D30[1] < 0xFF) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->unk_11D30[1] += 5;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 14:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800BC490(globalCtx, 1);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 15:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2020-05-20 00:15:48 +00:00
|
|
|
TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->getItemModel, 0xA0, 0x78,
|
|
|
|
0x90, 0x18, 0x14);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 16:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2020-05-09 20:58:02 +00:00
|
|
|
D_8015FCCA = Quake_Add(ACTIVE_CAM, 6);
|
2020-03-29 01:24:39 +00:00
|
|
|
Quake_SetSpeed(D_8015FCCA, 0x7FFF);
|
|
|
|
Quake_SetQuakeValues(D_8015FCCA, 4, 0, 1000, 0);
|
|
|
|
Quake_SetCountdown(D_8015FCCA, 800);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 17:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2020-03-29 01:24:39 +00:00
|
|
|
Quake_RemoveFromIdx(D_8015FCCA);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 18:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_EE[0] = 0;
|
|
|
|
globalCtx->envCtx.gloomySkyEvent = 2;
|
|
|
|
if (gSaveContext.dayTime < 0x4AAB) {
|
|
|
|
gSaveContext.dayTime += 30;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-04-16 21:36:12 +00:00
|
|
|
if (globalCtx->envCtx.unk_EE[1] == 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8011FB30 = 0;
|
|
|
|
func_800F6D58(14, 1, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 19:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.eventChkInf[6] |= 0x0020;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 20:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.eventChkInf[6] |= 0x0080;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 21:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.eventChkInf[6] |= 0x0200;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 22:
|
2020-07-17 01:37:53 +00:00
|
|
|
D_801614B0.r = 255;
|
|
|
|
D_801614B0.g = 255;
|
|
|
|
D_801614B0.b = 255;
|
|
|
|
D_801614B0.a = 255;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 23:
|
2020-07-17 01:37:53 +00:00
|
|
|
D_801614B0.r = 255;
|
|
|
|
D_801614B0.g = 180;
|
|
|
|
D_801614B0.b = 100;
|
2020-03-17 04:31:30 +00:00
|
|
|
D_801614B0.a = 255.0f * temp;
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
globalCtx->roomCtx.curRoom.segment = NULL;
|
|
|
|
break;
|
|
|
|
case 25:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.dayTime += 30;
|
|
|
|
if ((gSaveContext.dayTime) > 0xCAAA) {
|
|
|
|
gSaveContext.dayTime = 0xCAAA;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 26:
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.dayTime < 0x3000) || (gSaveContext.dayTime >= 0x4555)) {
|
|
|
|
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xAAAB)) {
|
|
|
|
globalCtx->envCtx.unk_BF = 1;
|
|
|
|
} else if ((gSaveContext.dayTime >= 0xAAAB) && (gSaveContext.dayTime < 0xC556)) {
|
|
|
|
globalCtx->envCtx.unk_BF = 2;
|
2020-03-23 23:11:21 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_BF = 3;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 27:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (globalCtx->state.frames & 8) {
|
2020-08-21 01:28:41 +00:00
|
|
|
if (globalCtx->envCtx.unk_8C[0][0] < 40) {
|
|
|
|
globalCtx->envCtx.unk_8C[0][0] += 2;
|
|
|
|
globalCtx->envCtx.unk_8C[1][1] -= 3;
|
|
|
|
globalCtx->envCtx.unk_8C[1][2] -= 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-08-21 01:28:41 +00:00
|
|
|
if (globalCtx->envCtx.unk_8C[0][0] > 2) {
|
|
|
|
globalCtx->envCtx.unk_8C[0][0] -= 2;
|
|
|
|
globalCtx->envCtx.unk_8C[1][1] += 3;
|
|
|
|
globalCtx->envCtx.unk_8C[1][2] += 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 28:
|
|
|
|
globalCtx->unk_11DE9 = 1;
|
|
|
|
break;
|
|
|
|
case 29:
|
|
|
|
globalCtx->unk_11DE9 = 0;
|
|
|
|
break;
|
|
|
|
case 30:
|
2020-05-01 02:00:39 +00:00
|
|
|
Flags_SetEnv(globalCtx, 3);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 31:
|
2020-05-01 02:00:39 +00:00
|
|
|
Flags_SetEnv(globalCtx, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 32:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E6 = 1;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-07-05 03:30:21 +00:00
|
|
|
func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 33:
|
|
|
|
gSaveContext.unk_1422 = 1;
|
|
|
|
break;
|
|
|
|
case 34:
|
2020-04-16 21:36:12 +00:00
|
|
|
if (!gSaveContext.nightFlag) {
|
|
|
|
gSaveContext.dayTime -= D_8011FB40;
|
2020-03-23 23:11:21 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.dayTime -= D_8011FB40 * 2;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 35:
|
|
|
|
func_800EE824(csCtx);
|
|
|
|
csCtx->frames = cmd->startFrame - 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 4: Set Environment Lighting
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) {
|
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_BF = cmd->setting - 1;
|
|
|
|
globalCtx->envCtx.unk_D8 = 1.0f;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x56: Play Background Music
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_PlayBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) {
|
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F595C(cmd->sequence - 1);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x57: Stop Background Music
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_StopBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) {
|
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F59E8(cmd->sequence - 1);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x7C: Fade Background Music over duration
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_FadeBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicFade* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
u8 var1;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
var1 = cmd->endFrame - cmd->startFrame;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->type == 3) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Audio_SetBGM(var1 << 0x10 | 0x110000FF);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
Audio_SetBGM(var1 << 0x10 | 0x100000FF);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 9: ?
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_09(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdUnknown9* cmd) {
|
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800AA000(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x8C: Set Time of Day & Environment Time
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 temp1;
|
|
|
|
s16 temp2;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
temp1 = (cmd->hour * 60.0f) / 0.021972656f;
|
|
|
|
temp2 = (cmd->minute + 1) / 0.021972656f;
|
2020-04-08 16:45:50 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.dayTime = temp1 + temp2;
|
|
|
|
gSaveContext.environmentTime = temp1 + temp2;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x3E8: Code Execution (& Terminates Cutscene?)
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Player* player = PLAYER;
|
|
|
|
s32 temp = 0;
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
(csCtx->frames > 20) &&
|
2020-05-22 12:33:10 +00:00
|
|
|
(CHECK_PAD(globalCtx->state.input[0].press, A_BUTTON) || CHECK_PAD(globalCtx->state.input[0].press, B_BUTTON) ||
|
|
|
|
CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON)) &&
|
2020-04-16 21:36:12 +00:00
|
|
|
(gSaveContext.fileNum != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
|
|
|
temp = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((csCtx->frames == cmd->startFrame) || (temp != 0) ||
|
2020-05-22 12:33:10 +00:00
|
|
|
((csCtx->frames > 20) && CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON) &&
|
2020-04-16 21:36:12 +00:00
|
|
|
(gSaveContext.fileNum != 0xFEDC))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
|
|
|
|
func_800F68BC(0);
|
|
|
|
gSaveContext.unk_1410 = 1;
|
|
|
|
|
|
|
|
// Translates to: "FUTURE FORK DESIGNATION=No. [%d]"
|
|
|
|
osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base);
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.gameMode != 0) && (csCtx->frames != cmd->startFrame)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
gSaveContext.unk_13E7 = 1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 1:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 10;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0117;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 10;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
globalCtx->nextEntranceIndex = 0x013D;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 10;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00EE;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 10;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 10;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00EE;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 11;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
gSaveContext.fw.set = 0;
|
|
|
|
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
|
2020-04-16 21:36:12 +00:00
|
|
|
if (!(gSaveContext.eventChkInf[4] & 0x20)) {
|
|
|
|
gSaveContext.eventChkInf[4] |= 0x20;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
|
|
|
globalCtx->fadeTransition = 11;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.sceneSetupIndex < 4) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (LINK_IS_CHILD) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->linkAgeOnLoad = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
globalCtx->nextEntranceIndex = 0x02CA;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
|
|
|
gSaveContext.nextTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0117;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 12;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00BB;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00EE;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
globalCtx->nextEntranceIndex = 0x047A;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
globalCtx->nextEntranceIndex = 0x010E;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
|
|
|
gSaveContext.nextTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 14:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0457;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 15:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 17:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 18:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.eventChkInf[4] |= 0x8000;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x0324;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
|
|
|
gSaveContext.nextTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 19:
|
|
|
|
globalCtx->nextEntranceIndex = 0x013D;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 4;
|
|
|
|
gSaveContext.cutsceneIndex = 0x8000;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 21:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0102;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 22:
|
|
|
|
Item_Give(globalCtx, ITEM_SONG_REQUIEM);
|
|
|
|
globalCtx->nextEntranceIndex = 0x0123;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 23:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0028;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 25:
|
|
|
|
globalCtx->linkAgeOnLoad = 0;
|
|
|
|
globalCtx->nextEntranceIndex = 0x006B;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 26:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 27:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 28:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 29:
|
|
|
|
globalCtx->nextEntranceIndex = 0x006B;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.chamberCutsceneNum = 0;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 30:
|
|
|
|
globalCtx->nextEntranceIndex = 0x006B;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
Item_Give(globalCtx, ITEM_MEDALLION_FIRE);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.chamberCutsceneNum = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 31:
|
|
|
|
globalCtx->nextEntranceIndex = 0x006B;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
|
|
|
gSaveContext.chamberCutsceneNum = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 32:
|
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
|
|
|
globalCtx->nextEntranceIndex = 0x00CD;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
|
|
|
globalCtx->fadeTransition = 11;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 33:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00CD;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 34:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 35:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00CD;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 38:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 39:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF9;
|
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 40:
|
|
|
|
globalCtx->linkAgeOnLoad = 0;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFA;
|
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 41:
|
|
|
|
globalCtx->nextEntranceIndex = 0x04E6;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 42:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00DB;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 43:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0503;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 44:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0320;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 17;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 46:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.eventChkInf[4] |= 0x8000;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x0324;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 47:
|
|
|
|
Item_Give(globalCtx, ITEM_SONG_NOCTURNE);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.eventChkInf[5] |= 0x10;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x00DB;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 48:
|
|
|
|
globalCtx->nextEntranceIndex = 0x01ED;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 15;
|
|
|
|
gSaveContext.nextTransition = 15;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 49:
|
|
|
|
globalCtx->nextEntranceIndex = 0x058C;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 4;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 50:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0513;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 17;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 51:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00CD;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 41;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 52:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 11;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 53:
|
|
|
|
globalCtx->nextEntranceIndex = 0x050F;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 54:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.gameMode = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F7260(0x6F);
|
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0117;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 55:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0129;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 56:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00DB;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 57:
|
|
|
|
globalCtx->nextEntranceIndex = 0x013D;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 58:
|
|
|
|
globalCtx->nextEntranceIndex = 0x014D;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 59:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0102;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 60:
|
|
|
|
globalCtx->nextEntranceIndex = 0x010E;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 61:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0108;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 62:
|
|
|
|
globalCtx->linkAgeOnLoad = 0;
|
|
|
|
globalCtx->nextEntranceIndex = 0x00EE;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 63:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00EE;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 64:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00CD;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 65:
|
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 66:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0554;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 67:
|
|
|
|
globalCtx->nextEntranceIndex = 0x027E;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 68:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 69:
|
|
|
|
globalCtx->nextEntranceIndex = 0x05E8;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 70:
|
|
|
|
globalCtx->nextEntranceIndex = 0x013D;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
|
|
|
globalCtx->fadeTransition = 2;
|
|
|
|
gSaveContext.nextTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 71:
|
|
|
|
gSaveContext.equips.equipment |= 0x0100;
|
|
|
|
func_8008ECAC(globalCtx, player);
|
|
|
|
gSaveContext.equips.equipment |= 0x1000;
|
|
|
|
func_8008ECAC(globalCtx, player);
|
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 72:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0400;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
globalCtx->fadeTransition = 2;
|
|
|
|
gSaveContext.nextTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 73:
|
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 74:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
|
|
|
globalCtx->fadeTransition = 3;
|
|
|
|
gSaveContext.nextTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 75:
|
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 76:
|
|
|
|
globalCtx->linkAgeOnLoad = 0;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 77:
|
|
|
|
globalCtx->linkAgeOnLoad = 1;
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 78:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 79:
|
|
|
|
case 80:
|
|
|
|
case 81:
|
|
|
|
case 82:
|
|
|
|
case 83:
|
|
|
|
case 84:
|
|
|
|
case 85:
|
|
|
|
case 86:
|
|
|
|
case 87:
|
|
|
|
case 88:
|
|
|
|
case 89:
|
|
|
|
case 90:
|
|
|
|
case 91:
|
|
|
|
case 92:
|
|
|
|
case 93:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0157;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 94:
|
|
|
|
globalCtx->nextEntranceIndex = 0x02AE;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 95:
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.eventChkInf[4] & 0x100) && (gSaveContext.eventChkInf[4] & 0x200) &&
|
|
|
|
(gSaveContext.eventChkInf[4] & 0x400)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x0053;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
switch (gSaveContext.sceneSetupIndex) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 8:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00FC;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0147;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0102;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 96:
|
2020-04-16 21:36:12 +00:00
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x006B;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
|
|
|
globalCtx->fadeTransition = 5;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.eventChkInf[12] |= 0x100;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x0610;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
|
|
|
gSaveContext.nextTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 97:
|
2020-04-16 21:36:12 +00:00
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x006B;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
|
|
|
globalCtx->fadeTransition = 5;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x0580;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
|
|
|
gSaveContext.nextTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 98:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0564;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
|
|
|
gSaveContext.nextTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 99:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0608;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
|
|
|
gSaveContext.nextTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 100:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00EE;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
|
|
|
gSaveContext.nextTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 101:
|
|
|
|
globalCtx->nextEntranceIndex = 0x01F5;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 15;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 102:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0590;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 103:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00CD;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 104:
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (sTitleCsState) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 0:
|
|
|
|
globalCtx->nextEntranceIndex = 0x008D;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
sTitleCsState++;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0147;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
sTitleCsState++;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00A0;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
sTitleCsState = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 105:
|
|
|
|
globalCtx->nextEntranceIndex = 0x00E4;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 106:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0574;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 107:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0538;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 108:
|
|
|
|
globalCtx->nextEntranceIndex = 0x053C;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 109:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0540;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 110:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0544;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 111:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0548;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 112:
|
|
|
|
globalCtx->nextEntranceIndex = 0x054C;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 113:
|
|
|
|
if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_0201DA50);
|
|
|
|
globalCtx->csCtx.frames = 0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
|
|
|
gSaveContext.cutsceneIndex = 0xFFFF;
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFF;
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 114:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0185;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 115:
|
|
|
|
globalCtx->nextEntranceIndex = 0x0594;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 2;
|
|
|
|
gSaveContext.nextTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 116:
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.eventChkInf[12] & 0x100) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x0580;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x0610;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.nextTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 117:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.gameMode = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F7260(0x6F);
|
|
|
|
globalCtx->linkAgeOnLoad = 0;
|
|
|
|
globalCtx->nextEntranceIndex = 0x00CD;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 118:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = 0x0517;
|
|
|
|
Gameplay_TriggerVoidOut(globalCtx);
|
|
|
|
gSaveContext.respawnFlag = -2;
|
|
|
|
gSaveContext.nextTransition = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 119:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.dayTime = 0x8000;
|
|
|
|
gSaveContext.environmentTime = 0x8000;
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->nextEntranceIndex = 0x05F0;
|
|
|
|
globalCtx->sceneLoadFlag = 0x14;
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->fadeTransition = 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x2D: Transition Effects
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
f32 temp;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame)) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E1 = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
temp = func_8006F93C(cmd->endFrame, cmd->startFrame, csCtx->frames);
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 1:
|
|
|
|
case 5:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[0] = 0xA0;
|
|
|
|
globalCtx->envCtx.unk_E2[1] = 0xA0;
|
|
|
|
globalCtx->envCtx.unk_E2[2] = 0xA0;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 1) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
|
|
|
if ((temp == 0.0f) && (gSaveContext.entranceIndex == 0x006B)) {
|
2020-03-22 21:19:43 +00:00
|
|
|
Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
|
|
|
&D_801333E8);
|
|
|
|
} else if ((temp == 0.0f) &&
|
2020-04-16 21:36:12 +00:00
|
|
|
((gSaveContext.entranceIndex == 0x0053) || (gSaveContext.entranceIndex == 0x0138) ||
|
|
|
|
(gSaveContext.entranceIndex == 0x0371))) {
|
2020-03-22 21:19:43 +00:00
|
|
|
Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0,
|
|
|
|
&D_801333E8);
|
|
|
|
} else if ((temp == 0.0f) && (globalCtx->sceneNum == SCENE_GANONTIKA)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800788CC(NA_SE_EV_WHITE_OUT);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 6:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[0] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[1] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[2] = 0xFF;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 2) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 7:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[0] = 0xFF;
|
|
|
|
globalCtx->envCtx.unk_E2[1] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[2] = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 3) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 8:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[0] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[1] = 0xFF;
|
|
|
|
globalCtx->envCtx.unk_E2[2] = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 4) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
gSaveContext.unk_1410 = 1;
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
case 11:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[0] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[1] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[2] = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 10) {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
gSaveContext.unk_1410 = 255.0f - (155.0f * temp);
|
|
|
|
break;
|
|
|
|
case 13:
|
2020-04-16 21:36:12 +00:00
|
|
|
globalCtx->envCtx.unk_E2[0] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[1] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[2] = 0;
|
|
|
|
globalCtx->envCtx.unk_E2[3] = 255.0f - ((1.0f - temp) * 155.0f);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x1 & 0x5: Camera Positions
|
2020-03-22 21:19:43 +00:00
|
|
|
s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 shouldContinue = 1;
|
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((csCtx->unk_18 < cmdBase->startFrame) || (csCtx->unk_18 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1B = 1;
|
|
|
|
csCtx->cameraPosition = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1A != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_18 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
func_800C0874(globalCtx, csCtx->unk_14, 0x25);
|
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, D_8015FCC6, 1);
|
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7);
|
|
|
|
func_8005AC60(Gameplay_GetCamera(globalCtx, csCtx->unk_14));
|
|
|
|
func_8005AC6C(Gameplay_GetCamera(globalCtx, csCtx->unk_14), csCtx->cameraFocus, csCtx->cameraPosition,
|
2020-03-17 04:31:30 +00:00
|
|
|
PLAYER, relativeToLink);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
while (shouldContinue) {
|
|
|
|
if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) {
|
|
|
|
shouldContinue = 0;
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd += 0x10;
|
|
|
|
size += 0x10;
|
|
|
|
}
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x2 & 0x6: Camera Focus Points
|
2020-03-22 21:19:43 +00:00
|
|
|
s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 shouldContinue = 1;
|
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((D_8015FCC0 < cmdBase->startFrame) || (D_8015FCC0 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1A = 1;
|
|
|
|
csCtx->cameraFocus = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1B != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC0 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
func_800C0874(globalCtx, csCtx->unk_14, 0x25);
|
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, D_8015FCC6, 1);
|
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7);
|
|
|
|
func_8005AC60(Gameplay_GetCamera(globalCtx, csCtx->unk_14));
|
|
|
|
func_8005AC6C(Gameplay_GetCamera(globalCtx, csCtx->unk_14), csCtx->cameraFocus, csCtx->cameraPosition,
|
2020-03-17 04:31:30 +00:00
|
|
|
PLAYER, relativeToLink);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
while (shouldContinue) {
|
|
|
|
if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) {
|
|
|
|
shouldContinue = 0;
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd += 0x10;
|
|
|
|
size += 0x10;
|
|
|
|
}
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x7: ? (Related to camera positons)
|
2020-03-22 21:19:43 +00:00
|
|
|
s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) {
|
2020-03-17 04:31:30 +00:00
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
Vec3f sp3C;
|
|
|
|
Vec3f sp30;
|
|
|
|
Camera* sp2C;
|
|
|
|
f32 sp28;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((D_8015FCC2 < cmdBase->startFrame) || (D_8015FCC2 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1B = 1;
|
|
|
|
csCtx->cameraPosition = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1A != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC2 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
sp2C = Gameplay_GetCamera(globalCtx, csCtx->unk_14);
|
2020-03-17 04:31:30 +00:00
|
|
|
sp2C->player = NULL;
|
2020-04-16 21:36:12 +00:00
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, 0, 1);
|
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7);
|
|
|
|
func_800C0874(globalCtx, csCtx->unk_14, 0x21);
|
2020-03-17 04:31:30 +00:00
|
|
|
sp28 = csCtx->cameraFocus->cameraRoll * 1.40625f;
|
2020-06-01 21:54:47 +00:00
|
|
|
Camera_SetParam(sp2C, 64, &sp28);
|
2020-03-17 04:31:30 +00:00
|
|
|
sp3C.x = csCtx->cameraFocus->pos.x;
|
|
|
|
sp3C.y = csCtx->cameraFocus->pos.y;
|
|
|
|
sp3C.z = csCtx->cameraFocus->pos.z;
|
|
|
|
sp30.x = csCtx->cameraPosition->pos.x;
|
|
|
|
sp30.y = csCtx->cameraPosition->pos.y;
|
|
|
|
sp30.z = csCtx->cameraPosition->pos.z;
|
2020-04-16 21:36:12 +00:00
|
|
|
func_800C04D8(globalCtx, csCtx->unk_14, &sp3C, &sp30);
|
|
|
|
func_800C0704(globalCtx, csCtx->unk_14, csCtx->cameraPosition->viewAngle);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
size += 0x10;
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x8: ? (Related to camera focus points)
|
2020-03-22 21:19:43 +00:00
|
|
|
s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) {
|
2020-03-17 04:31:30 +00:00
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
Vec3f sp3C;
|
|
|
|
Vec3f sp30;
|
|
|
|
Camera* sp2C;
|
|
|
|
f32 sp28;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((D_8015FCC4 < cmdBase->startFrame) || (D_8015FCC4 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1A = 1;
|
|
|
|
csCtx->cameraFocus = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1B != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC4 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
sp2C = Gameplay_GetCamera(globalCtx, csCtx->unk_14);
|
2020-03-17 04:31:30 +00:00
|
|
|
sp2C->player = NULL;
|
2020-04-16 21:36:12 +00:00
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, 0, 1);
|
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7);
|
|
|
|
func_800C0874(globalCtx, csCtx->unk_14, 0x21);
|
2020-03-17 04:31:30 +00:00
|
|
|
sp3C.x = csCtx->cameraFocus->pos.x;
|
|
|
|
sp3C.y = csCtx->cameraFocus->pos.y;
|
|
|
|
sp3C.z = csCtx->cameraFocus->pos.z;
|
|
|
|
sp30.x = csCtx->cameraPosition->pos.x;
|
|
|
|
sp30.y = csCtx->cameraPosition->pos.y;
|
|
|
|
sp30.z = csCtx->cameraPosition->pos.z;
|
2020-04-16 21:36:12 +00:00
|
|
|
func_800C04D8(globalCtx, csCtx->unk_14, &sp3C, &sp30);
|
|
|
|
func_800C0704(globalCtx, csCtx->unk_14, csCtx->cameraPosition->viewAngle);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
size += 0x10;
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x13: Textbox
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdTextbox* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
u8 dialogState;
|
|
|
|
s16 originalCsFrames;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
|
|
|
if (cmd->type != 2) {
|
|
|
|
if (D_8011E1C0 != cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8011E1C0 = cmd->base;
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((cmd->type == 3) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
2020-07-09 19:12:03 +00:00
|
|
|
func_8010B680(globalCtx, cmd->textId1, NULL);
|
2020-04-16 21:36:12 +00:00
|
|
|
} else if ((cmd->type == 4) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
2020-07-09 19:12:03 +00:00
|
|
|
func_8010B680(globalCtx, cmd->textId1, NULL);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-07-09 19:12:03 +00:00
|
|
|
func_8010B680(globalCtx, cmd->base, NULL);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
|
|
|
if (D_8011E1C4 != cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8011E1C4 = cmd->base;
|
|
|
|
func_8010BD58(globalCtx, cmd->base);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames >= cmd->endFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
originalCsFrames = csCtx->frames;
|
|
|
|
dialogState = func_8010BDBC(&globalCtx->msgCtx);
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames--;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((dialogState == 4) && (func_80106BC8(globalCtx) != 0)) {
|
|
|
|
if (globalCtx->msgCtx.choiceIndex == 0) {
|
|
|
|
if (cmd->textId1 != 0xFFFF) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_8010B720(globalCtx, cmd->textId1);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (cmd->textId2 != 0xFFFF) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_8010B720(globalCtx, cmd->textId2);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (dialogState == 9) {
|
|
|
|
if (cmd->textId1 != 0xFFFF) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_8010B720(globalCtx, cmd->textId1);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (dialogState == 5) {
|
|
|
|
if (func_80106BC8(globalCtx) != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_8010BD58(globalCtx, cmd->base);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == originalCsFrames) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Interface_ChangeAlpha(1);
|
|
|
|
D_8011E1C0 = 0;
|
|
|
|
D_8011E1C4 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 i;
|
|
|
|
s32 totalEntries;
|
|
|
|
s32 cmdType;
|
|
|
|
s32 cmdEntries;
|
|
|
|
CsCmdBase* cmd;
|
|
|
|
s32 cutsceneEndFrame;
|
|
|
|
s16 j;
|
|
|
|
|
|
|
|
MemCopy(&totalEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
|
|
|
MemCopy(&cutsceneEndFrame, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cutsceneEndFrame < csCtx->frames) && (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-05-22 12:33:10 +00:00
|
|
|
if (CHECK_PAD(globalCtx->state.input[0].press, R_JPAD)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < totalEntries; i++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
MemCopy(&cmdType, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmdType == -1) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmdType) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case CS_CMD_MISC:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80064824(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SET_LIGHTING:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_Command_SetLighting(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_PLAYBGM:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_Command_PlayBGM(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_STOPBGM:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_Command_StopBGM(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_FADEBGM:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_Command_FadeBGM(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_09:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_Command_09(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 0xC;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SETTIME:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80065134(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 0xC;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_PLAYER_ACTION:
|
2020-03-17 04:31:30 +00:00
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->linkAction = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SET_ACTOR_ACTION_1:
|
|
|
|
case 17:
|
|
|
|
case 18:
|
|
|
|
case 23:
|
|
|
|
case 34:
|
|
|
|
case 39:
|
|
|
|
case 46:
|
|
|
|
case 76:
|
|
|
|
case 85:
|
|
|
|
case 93:
|
|
|
|
case 105:
|
|
|
|
case 107:
|
|
|
|
case 110:
|
|
|
|
case 119:
|
|
|
|
case 123:
|
|
|
|
case 138:
|
|
|
|
case 139:
|
|
|
|
case 144:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[0] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_2:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 16:
|
|
|
|
case 24:
|
|
|
|
case 35:
|
|
|
|
case 40:
|
|
|
|
case 48:
|
|
|
|
case 64:
|
|
|
|
case 68:
|
|
|
|
case 70:
|
|
|
|
case 78:
|
|
|
|
case 80:
|
|
|
|
case 94:
|
|
|
|
case 116:
|
|
|
|
case 118:
|
|
|
|
case 120:
|
|
|
|
case 125:
|
|
|
|
case 131:
|
|
|
|
case 141:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[1] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_3:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 36:
|
|
|
|
case 41:
|
|
|
|
case 50:
|
|
|
|
case 67:
|
|
|
|
case 69:
|
|
|
|
case 72:
|
|
|
|
case 74:
|
|
|
|
case 81:
|
|
|
|
case 106:
|
|
|
|
case 117:
|
|
|
|
case 121:
|
|
|
|
case 126:
|
|
|
|
case 132:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[2] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_4:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 37:
|
|
|
|
case 42:
|
|
|
|
case 51:
|
|
|
|
case 53:
|
|
|
|
case 63:
|
|
|
|
case 65:
|
|
|
|
case 66:
|
|
|
|
case 75:
|
|
|
|
case 82:
|
|
|
|
case 108:
|
|
|
|
case 127:
|
|
|
|
case 133:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[3] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_5:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 38:
|
|
|
|
case 43:
|
|
|
|
case 47:
|
|
|
|
case 54:
|
|
|
|
case 79:
|
|
|
|
case 83:
|
|
|
|
case 128:
|
|
|
|
case 135:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[4] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_6:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 55:
|
|
|
|
case 77:
|
|
|
|
case 84:
|
|
|
|
case 90:
|
|
|
|
case 129:
|
|
|
|
case 136:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[5] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_7:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 52:
|
|
|
|
case 57:
|
|
|
|
case 58:
|
|
|
|
case 88:
|
|
|
|
case 115:
|
|
|
|
case 130:
|
|
|
|
case 137:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[6] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_8:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 60:
|
|
|
|
case 89:
|
|
|
|
case 111:
|
|
|
|
case 114:
|
|
|
|
case 134:
|
|
|
|
case 142:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[7] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_9:
|
2020-03-17 04:31:30 +00:00
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[8] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SET_ACTOR_ACTION_10:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[9] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_CAMERA_POS:
|
|
|
|
cutscenePtr += Cutscene_Command_CameraPositions(globalCtx, csCtx, (void*)cutscenePtr, 0);
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_CAMERA_POS_PLAYER:
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += Cutscene_Command_CameraPositions(globalCtx, csCtx, (void*)cutscenePtr, 1);
|
|
|
|
break;
|
|
|
|
case CS_CMD_CAMERA_FOCUS:
|
|
|
|
cutscenePtr += Cutscene_Command_CameraFocus(globalCtx, csCtx, (void*)cutscenePtr, 0);
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_CAMERA_FOCUS_PLAYER:
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += Cutscene_Command_CameraFocus(globalCtx, csCtx, (void*)cutscenePtr, 1);
|
|
|
|
break;
|
|
|
|
case CS_CMD_07:
|
|
|
|
cutscenePtr += Cutscene_Command_07(globalCtx, csCtx, (void*)cutscenePtr, 0);
|
|
|
|
break;
|
|
|
|
case CS_CMD_08:
|
|
|
|
cutscenePtr += Cutscene_Command_08(globalCtx, csCtx, (void*)cutscenePtr, 0);
|
|
|
|
break;
|
|
|
|
case CS_CMD_TERMINATOR:
|
|
|
|
cutscenePtr += 4;
|
|
|
|
Cutscene_Command_Terminator(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 8;
|
|
|
|
break;
|
|
|
|
case CS_CMD_TEXTBOX:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base != 0xFFFF) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_Command_Textbox(globalCtx, csCtx, (void*)cutscenePtr);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0xC;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SCENE_TRANS_FX:
|
|
|
|
cutscenePtr += 4;
|
|
|
|
Cutscene_Command_TransitionFX(globalCtx, csCtx, (void*)cutscenePtr);
|
|
|
|
cutscenePtr += 8;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
MemCopy(&cmdEntries, cutscenePtr, 4);
|
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Gfx* displayList;
|
|
|
|
Gfx* prevDisplayList;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (0) {} // Necessary to match
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (0) {} // Also necessary to match
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (BREG(0) != 0) {
|
2020-08-29 23:00:17 +00:00
|
|
|
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo.c", 4101);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
prevDisplayList = oGfxCtx->polyOpa.p;
|
|
|
|
displayList = Graph_GfxPlusOne(oGfxCtx->polyOpa.p);
|
|
|
|
gSPDisplayList(oGfxCtx->overlay.p++, displayList);
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_DrawDebugInfo(globalCtx, &displayList, csCtx);
|
|
|
|
gSPEndDisplayList(displayList++);
|
2020-04-04 16:12:59 +00:00
|
|
|
Graph_BranchDlist(prevDisplayList, displayList);
|
2020-08-29 23:00:17 +00:00
|
|
|
oGfxCtx->polyOpa.p = displayList;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo.c", 4108);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (dREG(95) != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_ProcessCommands(globalCtx, csCtx, D_8012D1F0);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
Cutscene_ProcessCommands(globalCtx, csCtx, globalCtx->csCtx.segment);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
|
|
|
if (func_8006472C(globalCtx, csCtx, 0.0f)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F68BC(0);
|
|
|
|
csCtx->state = CS_STATE_IDLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 i;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (func_8006472C(globalCtx, csCtx, 0.0f)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->linkAction = NULL;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < 10; i++) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[i] = NULL;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
// Translates to: "RIGHT HERE, HUH"
|
|
|
|
osSyncPrintf("\n\n\n\n\nやっぱりここかいな");
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0;
|
|
|
|
gSaveContext.gameMode = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
switch (gSaveContext.entranceIndex) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 0x028A:
|
|
|
|
case 0x028E:
|
|
|
|
case 0x0292:
|
|
|
|
case 0x0476:
|
2020-04-16 21:36:12 +00:00
|
|
|
func_800C078C(globalCtx, D_8015FCC6, csCtx->unk_14);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
Gameplay_ChangeCameraStatus(globalCtx, D_8015FCC6, 7);
|
|
|
|
Gameplay_ClearCamera(globalCtx, csCtx->unk_14);
|
|
|
|
func_8005B1A4(globalCtx->cameraPtrs[D_8015FCC6]);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func_800F68BC(0);
|
|
|
|
csCtx->state = CS_STATE_IDLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
u8 i;
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx)) {
|
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) {
|
2020-05-01 02:00:39 +00:00
|
|
|
Flags_UnsetEnv(globalCtx, 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
D_8011E1C0 = 0;
|
|
|
|
D_8011E1C4 = 0;
|
|
|
|
csCtx->unk_12 = 0;
|
|
|
|
csCtx->linkAction = NULL;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < 10; i++) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[i] = NULL;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
csCtx->state++;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->state == CS_STATE_SKIPPABLE_INIT) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F68BC(1);
|
|
|
|
|
|
|
|
csCtx->frames = 0xFFFF;
|
|
|
|
csCtx->unk_18 = 0xFFFF;
|
|
|
|
D_8015FCC0 = 0xFFFF;
|
|
|
|
D_8015FCC2 = 0xFFFF;
|
|
|
|
D_8015FCC4 = 0xFFFF;
|
|
|
|
csCtx->unk_1A = 0;
|
|
|
|
csCtx->unk_1B = 0;
|
2020-04-16 21:36:12 +00:00
|
|
|
D_8015FCC6 = globalCtx->activeCamera;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
csCtx->unk_14 = Gameplay_CreateSubCamera(globalCtx);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneTrigger == 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Interface_ChangeAlpha(1);
|
2020-07-09 01:54:39 +00:00
|
|
|
ShrinkWindow_SetVal(0x20);
|
|
|
|
ShrinkWindow_SetCurrentVal(0x20);
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state++;
|
|
|
|
}
|
|
|
|
|
|
|
|
func_80068C3C(globalCtx, csCtx);
|
|
|
|
}
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneTrigger = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_80069048(GlobalContext* globalCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 i;
|
|
|
|
|
|
|
|
D_8015FCCC = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < 20; i++) {
|
|
|
|
; // Empty Loop
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCE4 = 0;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006907C(GlobalContext* globalCtx) {
|
|
|
|
if (D_8015FCCC != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCCC = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
EntranceCutscene* entranceCutscene;
|
|
|
|
u8 requiredAge;
|
|
|
|
s16 i;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
entranceCutscene = &sEntranceCutsceneTable[i];
|
|
|
|
|
|
|
|
requiredAge = entranceCutscene->ageRestriction;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (requiredAge == 2) {
|
2020-04-16 21:36:12 +00:00
|
|
|
requiredAge = gSaveContext.linkAge;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.entranceIndex == entranceCutscene->entrance) &&
|
2020-03-17 04:31:30 +00:00
|
|
|
(!Flags_GetEventChkInf(entranceCutscene->flag) || (entranceCutscene->flag == 0x18)) &&
|
2020-04-16 21:36:12 +00:00
|
|
|
(gSaveContext.cutsceneIndex < 0xFFF0) && ((u8)gSaveContext.linkAge == requiredAge) &&
|
|
|
|
(gSaveContext.respawnFlag <= 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Flags_SetEventChkInf(entranceCutscene->flag);
|
|
|
|
Cutscene_SetSegment(globalCtx, entranceCutscene->segAddr);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneTrigger = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
gSaveContext.unk_13C7 = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) {
|
2020-07-15 15:23:57 +00:00
|
|
|
s32 temp; // inline temp needed to match regalloc
|
|
|
|
|
|
|
|
osSyncPrintf("\ngame_info.mode=[%d] restart_flag", temp = gSaveContext.respawnFlag);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
|
|
|
|
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Flags_SetEventChkInf(0xAC);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.entranceIndex = 0x0123;
|
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
} else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (gSaveContext.eventChkInf[4] & 0x0100) &&
|
|
|
|
(gSaveContext.eventChkInf[4] & 0x0200) && (gSaveContext.eventChkInf[4] & 0x0400) &&
|
|
|
|
!Flags_GetEventChkInf(0xAA)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Flags_SetEventChkInf(0xAA);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
} else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(0xC1)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Flags_SetEventChkInf(0xC1);
|
|
|
|
Item_Give(globalCtx, ITEM_OCARINA_FAIRY);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.entranceIndex = 0x011E;
|
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
} else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) &&
|
2020-07-15 15:23:57 +00:00
|
|
|
(gEntranceTable[temp = gSaveContext.entranceIndex].scene == SCENE_TOKINOMA)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Flags_SetEventChkInf(0xC4);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.entranceIndex = 0x0053;
|
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
|
|
|
} else if (!Flags_GetEventChkInf(0xC7) &&
|
2020-07-15 15:23:57 +00:00
|
|
|
(gEntranceTable[temp = gSaveContext.entranceIndex].scene == SCENE_GANON_DEMO)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Flags_SetEventChkInf(0xC7);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.entranceIndex = 0x0517;
|
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void Cutscene_SetSegment(GlobalContext* globalCtx, u32 segment) {
|
|
|
|
if (SEGMENT_NUMBER(segment) != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(segment);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
globalCtx->csCtx.segment = (void*)segment;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-05-27 07:48:07 +00:00
|
|
|
}
|