mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-06 06:10:21 +00:00
Make Gamestates use thisx for entry point functions (#437)
* fix colliderinit typo * fix initchain * reloc * thisx * sample * review * forgot sample main
This commit is contained in:
parent
b010db7c19
commit
ed719f3da0
7 changed files with 74 additions and 54 deletions
|
@ -19,16 +19,20 @@ void Opening_SetupTitleScreen(OpeningContext* this) {
|
|||
void func_80803C5C(OpeningContext* this) {
|
||||
}
|
||||
|
||||
void Opening_Main(OpeningContext* this) {
|
||||
void Opening_Main(GameState* thisx) {
|
||||
OpeningContext* this = (OpeningContext*)thisx;
|
||||
|
||||
func_80095248(this->state.gfxCtx, 0, 0, 0);
|
||||
Opening_SetupTitleScreen(this);
|
||||
func_80803C5C(this);
|
||||
}
|
||||
|
||||
void Opening_Destroy(OpeningContext* this) {
|
||||
void Opening_Destroy(GameState* thisx) {
|
||||
}
|
||||
|
||||
void Opening_Init(OpeningContext* this) {
|
||||
void Opening_Init(GameState* thisx) {
|
||||
OpeningContext* this = (OpeningContext*)thisx;
|
||||
|
||||
R_UPDATE_RATE = 1;
|
||||
Matrix_Init(&this->state);
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
|
|
|
@ -566,20 +566,23 @@ void Select_Draw(SelectContext* this) {
|
|||
CLOSE_DISPS(gfxCtx, "../z_select.c", 1037);
|
||||
}
|
||||
|
||||
void Select_Main(SelectContext* this) {
|
||||
void Select_Main(GameState* thisx) {
|
||||
SelectContext* this = (SelectContext*)thisx;
|
||||
|
||||
Select_UpdateMenu(this);
|
||||
Select_Draw(this);
|
||||
}
|
||||
|
||||
void Select_Destroy(SelectContext* this) {
|
||||
void Select_Destroy(GameState* thisx) {
|
||||
osSyncPrintf("%c", 7);
|
||||
// "view_cleanup will hang, so it won't be called"
|
||||
osSyncPrintf("*** view_cleanupはハングアップするので、呼ばない ***\n");
|
||||
}
|
||||
|
||||
void Select_Init(SelectContext* this) {
|
||||
void Select_Init(GameState* thisx) {
|
||||
SelectContext* this = (SelectContext*)thisx;
|
||||
u32 size;
|
||||
s32 pad[2];
|
||||
s32 pad;
|
||||
|
||||
this->state.main = Select_Main;
|
||||
this->state.destroy = Select_Destroy;
|
||||
|
|
|
@ -124,8 +124,8 @@ void Title_Draw(TitleContext* this) {
|
|||
CLOSE_DISPS(this->state.gfxCtx, "../z_title.c", 483);
|
||||
}
|
||||
|
||||
void Title_Main(TitleContext* this) {
|
||||
s32 pad;
|
||||
void Title_Main(GameState* thisx) {
|
||||
TitleContext* this = (TitleContext*)thisx;
|
||||
|
||||
OPEN_DISPS(this->state.gfxCtx, "../z_title.c", 494);
|
||||
|
||||
|
@ -154,13 +154,15 @@ void Title_Main(TitleContext* this) {
|
|||
CLOSE_DISPS(this->state.gfxCtx, "../z_title.c", 541);
|
||||
}
|
||||
|
||||
void Title_Destroy(TitleContext* this) {
|
||||
void Title_Destroy(GameState* thisx) {
|
||||
TitleContext* this = (TitleContext*)thisx;
|
||||
|
||||
Sram_InitSram(this, &this->sramCtx);
|
||||
}
|
||||
|
||||
void Title_Init(TitleContext* this) {
|
||||
void Title_Init(GameState* thisx) {
|
||||
u32 size = (u32)_nintendo_rogo_staticSegmentRomEnd - (u32)_nintendo_rogo_staticSegmentRomStart;
|
||||
s32 pad;
|
||||
TitleContext* this = (TitleContext*)thisx;
|
||||
|
||||
this->staticSegment = GameState_Alloc(&this->state, size, "../z_title.c", 611);
|
||||
osSyncPrintf("z_title.c\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue