ovl_opening OK (#300)

* ovl_opening OK

* un-format z64save.h

* Actually change the other uses of nextCutsceneIndex

* format

* Review

* engineer's review

* Get it to match again
This commit is contained in:
EllipticEllipsis
2021-09-29 02:17:39 +01:00
committed by GitHub
parent 1713e8a97d
commit ddc643f708
5 changed files with 58 additions and 13 deletions
@@ -1,18 +1,64 @@
/*
* File: z_opening.c
* Overlay: ovl_opening
* Description:
* Description: Initializes the game into the title screen
*/
#include "z_opening.h"
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_opening/Opening_SetupForTitleCutscene.s")
void Opening_SetupForTitleCutscene(OpeningContext* this) {
static s32 openingEntrances[] = { 0x1C00, 0x1C10 };
static s32 openingCutscenes[] = { 0xFFFA, 0xFFFA };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_opening/func_80803EA0.s")
gSaveContext.eventInf[1] &= (u8)~0x80;
gSaveContext.gameMode = 1;
void Opening_Main(GameState* thisx);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_opening/Opening_Main.s")
func_80144890();
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_opening/Opening_Destroy.s")
gSaveContext.entranceIndex = openingEntrances[D_801BB12C];
gSaveContext.nextCutsceneIndex = gSaveContext.cutscene = openingCutscenes[D_801BB12C];
gSaveContext.sceneSetupIndex = 0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_opening/Opening_Init.s")
gSaveContext.time = CLOCK_TIME(8, 0);
gSaveContext.day = 1;
{
GameState* thisx = &this->gameState;
thisx->running = false;
}
SET_NEXT_GAMESTATE(&this->gameState, Play_Init, GlobalContext);
gSaveContext.playerForm = PLAYER_FORM_HUMAN;
}
void func_80803EA0(OpeningContext* this) {
SREG(33) |= 1;
}
void Opening_Main(GameState* thisx) {
OpeningContext* this = (OpeningContext*)thisx;
func_8012CF0C(this->gameState.gfxCtx, 0, 1, 0, 0, 0);
Opening_SetupForTitleCutscene(this);
func_80803EA0(this);
}
void Opening_Destroy(GameState* thisx) {
ShrinkWindow_Fini();
}
void Opening_Init(GameState* thisx) {
OpeningContext* this = (OpeningContext*)thisx;
Game_SetFramerateDivisor(&this->gameState, 1);
SysMatrix_StateAlloc(&this->gameState);
ShrinkWindow_Init();
View_Init(&this->view, this->gameState.gfxCtx);
this->gameState.main = Opening_Main;
this->gameState.destroy = Opening_Destroy;
gSaveContext.respawnFlag = 0;
gSaveContext.respawn[4].entranceIndex = 0xFF;
gSaveContext.respawn[5].entranceIndex = 0xFF;
gSaveContext.respawn[6].entranceIndex = 0xFF;
gSaveContext.respawn[7].entranceIndex = 0xFF;
}
@@ -7,8 +7,8 @@ void Opening_Init(GameState* thisx);
void Opening_Destroy(GameState* thisx);
typedef struct {
/* 0x000 */ GameState common;
/* 0x0A4 */ UNK_TYPE1 padA4[0x4];
/* 0x000 */ GameState gameState;
/* 0x0A4 */ UNK_TYPE1 unk_A4[0x4];
/* 0x0A8 */ View view;
} OpeningContext; // size = 0x210