diff --git a/include/z64cutscene.h b/include/z64cutscene.h index 9bfdada45c..231f1a0c71 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -344,10 +344,10 @@ typedef enum CutsceneDestination { /* 0x77 */ CS_DEST_ZELDAS_COURTYARD_RECEIVE_LETTER } CutsceneDestination; -// values `< 0xFFF0` indicate a "manual" cutscene; can be assigned to +// values `< 0xFFF0` indicate no cutscene, or a context in which manual cutscenes can be used; can be assigned to // - `gSaveContext.save.cutsceneIndex` // - `gSaveContext.nextCutsceneIndex` -// using them implies an intention to have `z_play.c` set `gSaveContext.sceneLayer` based on age and day time +// using them implies an intention to have the Play state set `gSaveContext.sceneLayer` based on age and day time on state init // see enum values [`SCENE_LAYER_CHILD_DAY` .. `SCENE_LAYER_ADULT_NIGHT`] #define CS_INDEX_DEFAULT 0x0000 #define CS_INDEX_UNK_8000 0x8000 @@ -369,7 +369,7 @@ typedef enum CutsceneDestination { #define CS_INDEX_9 0xFFF9 #define CS_INDEX_A 0xFFFA -// it's "out of range" even for the largest set of `entrance_table.h` +// This value is "out of range" even for the largest set of entrances in the entrance table // but `z_demo.c` immediately sets `CS_STATE_STOP` state #define CS_INDEX_UNK_FFFF 0xFFFF @@ -377,7 +377,7 @@ typedef enum CutsceneDestination { #define CS_INDEX_EMPTY 0xFFFD // sentinel value used for `nextCutsceneIndex` to indicate that it is empty -// otherwise its value will be copied to `cutsceneIndex` +// otherwise its value will be copied to `cutsceneIndex` on Play state init #define CS_INDEX_NEXT_EMPTY 0xFFEF typedef union CsCmdCam { diff --git a/src/code/z_play.c b/src/code/z_play.c index 0f6fe731c4..08f5d2de29 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -353,13 +353,13 @@ void Play_Init(GameState* thisx) { !IS_CUTSCENE_LAYER) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { - gSaveContext.sceneLayer = SCENE_LAYER_CHILD_NIGHT; + gSaveContext.sceneLayer = 1; } else { - gSaveContext.sceneLayer = SCENE_LAYER_CHILD_DAY; + gSaveContext.sceneLayer = 0; } } else if ((gEntranceTable[((void)0, gSaveContext.save.entranceIndex)].sceneId == SCENE_KOKIRI_FOREST) && LINK_IS_ADULT && !IS_CUTSCENE_LAYER) { - gSaveContext.sceneLayer = GET_EVENTCHKINF(EVENTCHKINF_48) ? SCENE_LAYER_ADULT_NIGHT : SCENE_LAYER_ADULT_DAY; + gSaveContext.sceneLayer = GET_EVENTCHKINF(EVENTCHKINF_48) ? 3 : 2; } Play_SpawnScene( @@ -372,7 +372,7 @@ void Play_Init(GameState* thisx) { // When entering Gerudo Valley in the credits, trigger the GC emulator to play the ending movie. // The emulator constantly checks whether PC is 0x81000000, so this works even though it's not a valid address. if ((gEntranceTable[((void)0, gSaveContext.save.entranceIndex)].sceneId == SCENE_GERUDO_VALLEY) && - gSaveContext.sceneLayer == GET_CUTSCENE_LAYER(CS_INDEX_2)) { + gSaveContext.sceneLayer == 6) { PRINTF(T("エンディングはじまるよー\n", "The ending starts\n")); ((void (*)(void))0x81000000)(); PRINTF(T("出戻り?\n", "Return?\n")); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 9fd0755b5e..d162fb740b 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -65,7 +65,7 @@ void Object_InitContext(PlayState* play, ObjectContext* objectCtx) { if (play2->sceneId == SCENE_HYRULE_FIELD) { spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else if (play2->sceneId == SCENE_GANON_BOSS) { - if (gSaveContext.sceneLayer != GET_CUTSCENE_LAYER(CS_INDEX_0)) { + if (gSaveContext.sceneLayer != 4) { spaceSize = 1150 * 1024 - OBJECT_SPACE_ADJUSTMENT; } else { spaceSize = 1000 * 1024 - OBJECT_SPACE_ADJUSTMENT; diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index 27dd6c7af6..962696d38e 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -13,7 +13,7 @@ void TitleSetup_SetupTitleScreen(TitleSetupState* this) { Sram_InitDebugSave(); gSaveContext.save.cutsceneIndex = CS_INDEX_3; // assigning scene layer here is redundant, as Play_Init sets it right away - gSaveContext.sceneLayer = GET_CUTSCENE_LAYER(CS_INDEX_3); + gSaveContext.sceneLayer = 7; SET_NEXT_GAMESTATE(&this->state, Play_Init, PlayState); }