Name four global variables in `z_message.c` (#1832)

* Name static arrays for SoDT skip message IDs

* Rename two more static variables

* Convert hex drop thresholds to decimal

* Rename to text IDs
This commit is contained in:
Jordan Longstaff 2025-12-13 15:04:05 -05:00 committed by GitHub
parent 508d8bb07a
commit b84d745393
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 27 deletions

View File

@ -23,7 +23,7 @@
#define MESSAGE_DRAW_TEXT(play, gfxP, drawPos) Message_DrawTextDefault(play, gfxP)
#endif
u8 D_801C6A70 = 0;
u8 sMessageStartFrameCount = 0;
s16 sOcarinaButtonIndexBufPos = 0;
s16 sOcarinaButtonIndexBufLen = 0;
s16 sLastPlayedSong = 0xFF;
@ -69,7 +69,7 @@ s16 sOcarinaButtonStepG = 0;
s16 sOcarinaButtonStepB = 0;
s16 sOcarinaButtonFlashTimer = 12;
s16 sOcarinaButtonFlashColorIndex = 1;
s16 D_801C6A94 = 0;
s16 sOcarinaButtonDropYOffset = 0;
#if MM_VERSION >= N64_US
#define MSGCTX_UNK120D4 msgCtx->unk120D4
@ -3218,7 +3218,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
}
msgCtx->messageHasSetSfx = false;
D_801C6A70 = 0;
sMessageStartFrameCount = 0;
msgCtx->textboxSkipped = false;
msgCtx->textIsCredits = false;
var_fv0 = 1.0f;
@ -3331,7 +3331,7 @@ void Message_PauseMenu_ShowDescription(PlayState* play, u16 textId, u8 textBoxPo
gSaveContext.prevHudVisibility = gSaveContext.hudVisibility;
}
msgCtx->messageHasSetSfx = false;
D_801C6A70 = 0;
sMessageStartFrameCount = 0;
msgCtx->textboxSkipped = false;
msgCtx->textIsCredits = false;
@ -4595,7 +4595,7 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
case MSGMODE_OCARINA_FAIL_NO_TEXT:
msgCtx->stateTimer--;
if (msgCtx->stateTimer == 0) {
D_801C6A94 = 1;
sOcarinaButtonDropYOffset = 1;
if (msgCtx->msgMode == MSGMODE_SONG_PROMPT_FAIL) {
Message_ContinueTextbox(play, 0x1B89);
Message_Decode(play);
@ -4609,10 +4609,10 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
case MSGMODE_OCARINA_NOTES_DROP:
case MSGMODE_SONG_PROMPT_NOTES_DROP:
for (i = 0; i < 5; i++) {
msgCtx->ocarinaButtonsPosY[i] += D_801C6A94;
msgCtx->ocarinaButtonsPosY[i] += sOcarinaButtonDropYOffset;
}
D_801C6A94 += D_801C6A94;
if (D_801C6A94 >= 0x226) {
sOcarinaButtonDropYOffset += sOcarinaButtonDropYOffset;
if (sOcarinaButtonDropYOffset >= 550) {
Message_ResetOcarinaButtonAlphas();
if (msgCtx->msgMode == MSGMODE_SONG_PROMPT_NOTES_DROP) {
msgCtx->msgMode = MSGMODE_OCARINA_AWAIT_INPUT;
@ -5019,15 +5019,15 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
ocarinaError = func_8019B5AC();
if (ocarinaError == OCARINA_ERROR_2) {
Audio_PlaySfx(NA_SE_SY_OCARINA_ERROR);
D_801C6A94 = 1;
sOcarinaButtonDropYOffset = 1;
msgCtx->msgMode = MSGMODE_3B;
} else if (ocarinaError == OCARINA_ERROR_3) {
Audio_PlaySfx(NA_SE_SY_OCARINA_ERROR);
D_801C6A94 = 1;
sOcarinaButtonDropYOffset = 1;
msgCtx->msgMode = MSGMODE_3E;
} else {
Audio_PlaySfx(NA_SE_SY_OCARINA_ERROR);
D_801C6A94 = 1;
sOcarinaButtonDropYOffset = 1;
msgCtx->msgMode = MSGMODE_38;
}
}
@ -5044,11 +5044,11 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
case MSGMODE_3E:
// notes drop
for (i = 0; i < 5; i++) {
msgCtx->ocarinaButtonsPosY[i] += D_801C6A94;
msgCtx->ocarinaButtonsPosY[i] += sOcarinaButtonDropYOffset;
}
D_801C6A94 += D_801C6A94;
if (D_801C6A94 >= 0x226) {
sOcarinaButtonDropYOffset += sOcarinaButtonDropYOffset;
if (sOcarinaButtonDropYOffset >= 550) {
Message_ResetOcarinaButtonAlphas();
msgCtx->textBoxType = TEXTBOX_TYPE_BLACK;
msgCtx->textboxColorRed = msgCtx->textboxColorGreen = msgCtx->textboxColorBlue = 0;
@ -5301,14 +5301,14 @@ s16 sTextboxMidYPositions[] = {
s16 D_801D0448[] = { 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25 };
s16 D_801D045C[] = {
0x1B91,
0x1B90,
0x1B8F,
s16 sDoubleTimeSkipToNightTextIds[] = {
0x1B91, // Night of 1st day
0x1B90, // Night of 2nd day
0x1B8F, // Night of final day
};
s16 D_801D0464[] = {
0x1B92,
0x1B8E,
s16 sDoubleTimeSkipToDayTextIds[] = {
0x1B92, // Dawn of 2nd day
0x1B8E, // Dawn of final day
};
void Message_Update(PlayState* play) {
@ -5411,10 +5411,10 @@ void Message_Update(PlayState* play) {
switch (msgCtx->msgMode) {
case MSGMODE_TEXT_START:
D_801C6A70++;
sMessageStartFrameCount++;
temp = false;
if ((D_801C6A70 >= 4) || ((msgCtx->talkActor == NULL) && (D_801C6A70 >= 2))) {
if ((sMessageStartFrameCount >= 4) || ((msgCtx->talkActor == NULL) && (sMessageStartFrameCount >= 2))) {
temp = true;
}
if (temp) {
@ -5908,9 +5908,9 @@ void Message_Update(PlayState* play) {
if (interfaceCtx->restrictions.songOfDoubleTime == 0) {
if ((CURRENT_DAY != 3) || (gSaveContext.save.isNight == 0)) {
if (gSaveContext.save.isNight) {
Message_StartTextbox(play, D_801D0464[CURRENT_DAY - 1], NULL);
Message_StartTextbox(play, sDoubleTimeSkipToDayTextIds[CURRENT_DAY - 1], NULL);
} else {
Message_StartTextbox(play, D_801D045C[CURRENT_DAY - 1], NULL);
Message_StartTextbox(play, sDoubleTimeSkipToNightTextIds[CURRENT_DAY - 1], NULL);
}
play->msgCtx.ocarinaMode = OCARINA_MODE_PROCESS_DOUBLE_TIME;
} else {

View File

@ -1077,7 +1077,7 @@ sSaveDebugChecksum = 0x801C6A44; // size:0x4
D_801C6A48 = 0x801C6A48; // size:0x8
D_801C6A50 = 0x801C6A50; // size:0x8
D_801C6A58 = 0x801C6A58; // size:0x18
D_801C6A70 = 0x801C6A70; // size:0x4
sMessageStartFrameCount = 0x801C6A70; // size:0x4
D_801C6A74 = 0x801C6A74; // size:0x4
D_801C6A78 = 0x801C6A78; // size:0x4
D_801C6A7C = 0x801C6A7C; // size:0x4
@ -1086,7 +1086,7 @@ D_801C6A84 = 0x801C6A84; // size:0x4
D_801C6A88 = 0x801C6A88; // size:0x4
D_801C6A8C = 0x801C6A8C; // size:0x4
D_801C6A90 = 0x801C6A90; // size:0x4
D_801C6A94 = 0x801C6A94; // size:0x4
sOcarinaButtonDropYOffset = 0x801C6A94; // size:0x4
gPageSwitchNextButtonStatus = 0x801C6A98; // size:0x20
sBombersNotebookEventMessages = 0x801C6AB8; // size:0x70
gBombersNotebookWeekEventFlags = 0x801C6B28; // size:0x70