From 9001ed07b7a34a57c5d40c22db76c4799f99499f Mon Sep 17 00:00:00 2001 From: engineer124 Date: Sat, 20 Aug 2022 11:47:33 -0400 Subject: [PATCH] slightly more docs --- include/functions.h | 2 +- src/code/z_message.c | 2 +- src/code/z_play.c | 36 +++++++++---------- src/overlays/actors/ovl_En_Test4/z_en_test4.c | 6 ++-- tools/disasm/functions.txt | 2 +- tools/sizes/code_functions.csv | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/functions.h b/include/functions.h index e266f3938e..bf65caa15c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2434,7 +2434,7 @@ u8 Message_GetState(MessageContext* msgCtx); // void func_80153EF0(void); void func_801541D4(PlayState* play, Gfx** gfxp); void Message_Draw(PlayState* play); -void func_8015680C(PlayState* play); +void Message_Update(PlayState* play); void func_801586A4(PlayState* play); void Message_Init(PlayState* play); void Message_FindMessageNES(PlayState* play, u16 textId); diff --git a/src/code/z_message.c b/src/code/z_message.c index 3e1b8e4418..60421a9de9 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -553,7 +553,7 @@ void Message_Draw(PlayState* play) { CLOSE_DISPS(gfxCtx); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_8015680C.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/Message_Update.s") void func_801586A4(PlayState* play) { play->msgCtx.messageEntryTableNes = D_801C6B98; diff --git a/src/code/z_play.c b/src/code/z_play.c index a0083aea90..6f10b4bc7e 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -965,7 +965,7 @@ void Play_Update(PlayState* this) { ((this->msgCtx.currentTextId == 0xFF) && (this->msgCtx.msgMode == 0x42) && (this->msgCtx.unk12020 == 0x41)) || ((this->msgCtx.currentTextId >= 0x100) && (this->msgCtx.currentTextId <= 0x200))) && - (this->gameOverCtx.state == 0)) { + (this->gameOverCtx.state == GAMEOVER_INACTIVE)) { KaleidoSetup_Update(this); } @@ -1012,11 +1012,11 @@ void Play_Update(PlayState* this) { if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) { KaleidoScopeCall_Update(this); - } else if (this->gameOverCtx.state != 0) { + } else if (this->gameOverCtx.state != GAMEOVER_INACTIVE) { GameOver_Update(this); } - func_8015680C(this); + Message_Update(this); Interface_Update(this); AnimationContext_Update(this, &this->animationCtx); SoundSource_UpdateAll(this); @@ -1081,17 +1081,13 @@ void func_80167DE4(PlayState* this) { } if (D_801F6DFC) { func_8016F5A8(this, &D_801F6D50, this->state.input); - func_8015680C(this); + Message_Update(this); } else { Play_Update(this); } } void Play_DrawOverlayElements(PlayState* this) { - Gfx* sp34; - Gfx* sp30; - GraphicsContext* gfxCtx; - if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) { KaleidoScopeCall_Draw(this); } @@ -1105,25 +1101,29 @@ void Play_DrawOverlayElements(PlayState* this) { Message_Draw(this); } - if (this->gameOverCtx.state != 0) { + if (this->gameOverCtx.state != GAMEOVER_INACTIVE) { GameOver_FadeLights(this); } - if (gSaveContext.screenScaleFlag != 0) { - gfxCtx = this->state.gfxCtx; + // Shrink the whole screen display (at the end of First and Second Day by default) + if (gSaveContext.screenScaleFlag) { + Gfx* nextOpa; + Gfx* opa; + GraphicsContext* gfxCtx = this->state.gfxCtx; + D_801F6D4C->scale = gSaveContext.screenScale / 1000.0f; OPEN_DISPS(gfxCtx); - sp30 = POLY_OPA_DISP; - sp34 = Graph_GfxPlusOne(sp30); - gSPDisplayList(OVERLAY_DISP++, sp34); + opa = POLY_OPA_DISP; + nextOpa = Graph_GfxPlusOne(opa); + gSPDisplayList(OVERLAY_DISP++, nextOpa); - func_80141778(D_801F6D4C, &sp34, this->unk_18E60, gfxCtx); + func_80141778(D_801F6D4C, &nextOpa, this->unk_18E60, gfxCtx); - gSPEndDisplayList(sp34++); - Graph_BranchDlist(sp30, sp34); - POLY_OPA_DISP = sp34; + gSPEndDisplayList(nextOpa++); + Graph_BranchDlist(opa, nextOpa); + POLY_OPA_DISP = nextOpa; CLOSE_DISPS(gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index d5d8583fd2..fd5ffa12f3 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -282,7 +282,7 @@ void func_80A425E4(EnTest4* this, PlayState* play) { gSaveContext.screenScale = 1000.0f; } if (gSaveContext.screenScale != 1000.0f) { - gSaveContext.screenScaleFlag = 1; + gSaveContext.screenScaleFlag = true; } } } @@ -309,7 +309,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { } else { sIsLoaded = true; this->actor.room = -1; - gSaveContext.screenScaleFlag = 0; + gSaveContext.screenScaleFlag = false; gSaveContext.screenScale = 1000.0f; if (CURRENT_DAY == 0) { if (gSaveContext.save.time < CLOCK_TIME(6, 1)) { @@ -357,7 +357,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) { this->lastBellTime = gSaveContext.save.time; if ((sCutscenes[this->unk_144] < 0) || (play->actorCtx.unk5 & 2)) { - gSaveContext.screenScaleFlag = 0; + gSaveContext.screenScaleFlag = false; gSaveContext.screenScale = 1000.0f; } } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index ba741d7707..552bb27060 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2871,7 +2871,7 @@ 0x80153EF0:("func_80153EF0",), 0x801541D4:("func_801541D4",), 0x80156758:("Message_Draw",), - 0x8015680C:("func_8015680C",), + 0x8015680C:("Message_Update",), 0x801586A4:("func_801586A4",), 0x801586D4:("Message_Init",), 0x801588D0:("Message_FindMessageNES",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index f1ea540020..70feab60bd 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -2385,7 +2385,7 @@ asm/non_matchings/code/z_message/func_80153E7C.s,func_80153E7C,0x80153E7C,0x1D asm/non_matchings/code/z_message/func_80153EF0.s,func_80153EF0,0x80153EF0,0xB9 asm/non_matchings/code/z_message/func_801541D4.s,func_801541D4,0x801541D4,0x961 asm/non_matchings/code/z_message/Message_Draw.s,Message_Draw,0x80156758,0x2D -asm/non_matchings/code/z_message/func_8015680C.s,func_8015680C,0x8015680C,0x7A6 +asm/non_matchings/code/z_message/Message_Update.s,Message_Update,0x8015680C,0x7A6 asm/non_matchings/code/z_message/func_801586A4.s,func_801586A4,0x801586A4,0xC asm/non_matchings/code/z_message/Message_Init.s,Message_Init,0x801586D4,0x7F asm/non_matchings/code/z_message_nes/Message_FindMessageNES.s,Message_FindMessageNES,0x801588D0,0x2E