mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-13 11:24:40 +00:00
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
This commit is contained in:
parent
03636166b3
commit
a497f33bda
216 changed files with 7052 additions and 16801 deletions
|
@ -4,6 +4,11 @@
|
|||
#include "textures/do_action_static/do_action_static.h"
|
||||
#include "textures/icon_item_static/icon_item_static.h"
|
||||
|
||||
// TODO extract this information from the texture definitions themselves
|
||||
#define DO_ACTION_TEX_WIDTH 48
|
||||
#define DO_ACTION_TEX_HEIGHT 16
|
||||
#define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex))
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 scene;
|
||||
/* 0x01 */ u8 flags1;
|
||||
|
@ -700,7 +705,7 @@ void func_80083108(GlobalContext* globalCtx) {
|
|||
gSaveContext.buttonStatus[3] = BTN_DISABLED;
|
||||
Interface_ChangeAlpha(50);
|
||||
}
|
||||
} else if (msgCtx->msgMode == 0) {
|
||||
} else if (msgCtx->msgMode == MSGMODE_NONE) {
|
||||
if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) {
|
||||
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
|
||||
sp28 = 1;
|
||||
|
@ -2031,30 +2036,32 @@ void func_80086D5C(s32* buf, u16 size) {
|
|||
}
|
||||
}
|
||||
|
||||
void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 arg2) {
|
||||
void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 loadOffset) {
|
||||
static void* sDoActionTextures[] = { gAttackDoActionENGTex, gCheckDoActionENGTex };
|
||||
|
||||
if (action >= 0x1D) {
|
||||
action = 0x0A;
|
||||
if (action >= DO_ACTION_MAX) {
|
||||
action = DO_ACTION_NONE;
|
||||
}
|
||||
|
||||
if (gSaveContext.language != 0) {
|
||||
action += 0x1D;
|
||||
if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
action += DO_ACTION_MAX;
|
||||
}
|
||||
|
||||
if (gSaveContext.language == 2) {
|
||||
action += 0x1D;
|
||||
if (gSaveContext.language == LANGUAGE_FRA) {
|
||||
action += DO_ACTION_MAX;
|
||||
}
|
||||
|
||||
if ((action != 0x0A) && (action != 0x27) && (action != 0x44)) {
|
||||
if ((action != DO_ACTION_NONE) && (action != DO_ACTION_MAX + DO_ACTION_NONE) &&
|
||||
(action != 2 * DO_ACTION_MAX + DO_ACTION_NONE)) {
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + (arg2 * 0x180),
|
||||
(u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0,
|
||||
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160,
|
||||
interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
|
||||
(u32)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
|
||||
0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
} else {
|
||||
gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment);
|
||||
func_80086D5C(SEGMENTED_TO_VIRTUAL(sDoActionTextures[arg2]), 0x180 / 4);
|
||||
func_80086D5C(SEGMENTED_TO_VIRTUAL(sDoActionTextures[loadOffset]), DO_ACTION_TEX_SIZE / 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2098,20 +2105,20 @@ void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) {
|
|||
void Interface_LoadActionLabelB(GlobalContext* globalCtx, u16 action) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
if (gSaveContext.language != 0) {
|
||||
action += 0x1D;
|
||||
if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
action += DO_ACTION_MAX;
|
||||
}
|
||||
|
||||
if (gSaveContext.language == 2) {
|
||||
action += 0x1D;
|
||||
if (gSaveContext.language == LANGUAGE_FRA) {
|
||||
action += DO_ACTION_MAX;
|
||||
}
|
||||
|
||||
interfaceCtx->unk_1FC = action;
|
||||
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + 0x180,
|
||||
(u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0, &interfaceCtx->loadQueue,
|
||||
NULL, "../z_parameter.c", 2228);
|
||||
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
|
||||
(u32)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE, 0,
|
||||
&interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
interfaceCtx->unk_1FA = 1;
|
||||
|
@ -2445,9 +2452,9 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
|
|||
break;
|
||||
|
||||
case 7:
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
|
||||
(msgCtx->msgMode == MSGMODE_NONE) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||
(globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {
|
||||
if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) ||
|
||||
((gSaveContext.equips.buttonItems[1] != ITEM_LENS) &&
|
||||
(gSaveContext.equips.buttonItems[2] != ITEM_LENS) &&
|
||||
|
@ -2633,8 +2640,9 @@ void func_80088B34(s16 arg0) {
|
|||
void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture) {
|
||||
OPEN_DISPS(gfxCtx, "../z_parameter.c", 2820);
|
||||
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, texture, G_IM_FMT_IA, 48, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, texture, G_IM_FMT_IA, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOLOD);
|
||||
|
||||
gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
|
||||
|
||||
|
@ -2700,13 +2708,13 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
|
|||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x300, G_IM_FMT_IA, 48, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, G_IM_FMT_IA,
|
||||
DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
dxdy = (1 << 10) / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
width = 48.0f / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
height = 16.0f / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
width = DO_ACTION_TEX_WIDTH / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
height = DO_ACTION_TEX_HEIGHT / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
gSPTextureRectangle(
|
||||
OVERLAY_DISP++, R_START_LABEL_X(gSaveContext.language) << 2,
|
||||
R_START_LABEL_Y(gSaveContext.language) << 2, (R_START_LABEL_X(gSaveContext.language) + width) << 2,
|
||||
|
@ -3164,15 +3172,16 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha);
|
||||
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x180, G_IM_FMT_IA, 48, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE, G_IM_FMT_IA,
|
||||
DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
R_B_LABEL_DD = (1 << 10) / (WREG(37 + gSaveContext.language) / 100.0f);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, R_B_LABEL_X(gSaveContext.language) << 2,
|
||||
R_B_LABEL_Y(gSaveContext.language) << 2, (R_B_LABEL_X(gSaveContext.language) + 48) << 2,
|
||||
(R_B_LABEL_Y(gSaveContext.language) + 16) << 2, G_TX_RENDERTILE, 0, 0, R_B_LABEL_DD,
|
||||
R_B_LABEL_DD);
|
||||
R_B_LABEL_Y(gSaveContext.language) << 2,
|
||||
(R_B_LABEL_X(gSaveContext.language) + DO_ACTION_TEX_WIDTH) << 2,
|
||||
(R_B_LABEL_Y(gSaveContext.language) + DO_ACTION_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0, 0,
|
||||
R_B_LABEL_DD, R_B_LABEL_DD);
|
||||
}
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
@ -3239,7 +3248,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) {
|
||||
Interface_DrawActionLabel(globalCtx->state.gfxCtx, interfaceCtx->doActionSegment);
|
||||
} else {
|
||||
Interface_DrawActionLabel(globalCtx->state.gfxCtx, interfaceCtx->doActionSegment + 0x180);
|
||||
Interface_DrawActionLabel(globalCtx->state.gfxCtx, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE);
|
||||
}
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
@ -3355,7 +3364,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((gSaveContext.timer2State == 5) && (func_8010BDBC(&globalCtx->msgCtx) == 5)) {
|
||||
if ((gSaveContext.timer2State == 5) && (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT)) {
|
||||
// Trade quest timer reached 0
|
||||
D_8015FFE6 = 40;
|
||||
gSaveContext.cutsceneIndex = 0;
|
||||
|
@ -3393,7 +3402,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
|
||||
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) &&
|
||||
!(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx) && (gSaveContext.minigameState != 1) &&
|
||||
(globalCtx->shootingGalleryStatus <= 1) &&
|
||||
|
@ -3474,7 +3483,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((gSaveContext.timer1State >= 3) && (msgCtx->unk_E300 == 0)) {
|
||||
if ((gSaveContext.timer1State >= 3) && (msgCtx->msgLength == 0)) {
|
||||
D_8015FFE0--;
|
||||
if (D_8015FFE0 == 0) {
|
||||
if (gSaveContext.timer1Value != 0) {
|
||||
|
@ -3659,7 +3668,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
D_8015FFE6 = 40;
|
||||
gSaveContext.timer2State = 5;
|
||||
gSaveContext.cutsceneIndex = 0;
|
||||
func_8010B680(globalCtx, 0x71B0, NULL);
|
||||
Message_StartTextbox(globalCtx, 0x71B0, NULL);
|
||||
func_8002DF54(globalCtx, NULL, 8);
|
||||
} else {
|
||||
D_8015FFE6 = 40;
|
||||
|
@ -3683,7 +3692,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
|||
gSaveContext.timer2Value++;
|
||||
if (gSaveContext.eventInf[1] & 1) {
|
||||
if (gSaveContext.timer2Value == 240) {
|
||||
func_8010B680(globalCtx, 0x6083, NULL);
|
||||
Message_StartTextbox(globalCtx, 0x6083, NULL);
|
||||
gSaveContext.eventInf[1] &= ~1;
|
||||
gSaveContext.timer2State = 0;
|
||||
}
|
||||
|
@ -3799,20 +3808,21 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
Input* debugInput = &globalCtx->state.input[2];
|
||||
|
||||
if (CHECK_BTN_ALL(debugInput->press.button, BTN_DLEFT)) {
|
||||
gSaveContext.language = 0;
|
||||
gSaveContext.language = LANGUAGE_ENG;
|
||||
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
|
||||
} else if (CHECK_BTN_ALL(debugInput->press.button, BTN_DUP)) {
|
||||
gSaveContext.language = 1;
|
||||
gSaveContext.language = LANGUAGE_GER;
|
||||
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
|
||||
} else if (CHECK_BTN_ALL(debugInput->press.button, BTN_DRIGHT)) {
|
||||
gSaveContext.language = 2;
|
||||
gSaveContext.language = LANGUAGE_FRA;
|
||||
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
|
||||
}
|
||||
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
|
||||
if ((gSaveContext.minigameState == 1) || (gSaveContext.sceneSetupIndex < 4) ||
|
||||
((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.sceneSetupIndex == 4))) {
|
||||
if ((msgCtx->msgMode == 0) || ((msgCtx->msgMode != 0) && (globalCtx->sceneNum == SCENE_BOWLING))) {
|
||||
if ((msgCtx->msgMode == MSGMODE_NONE) ||
|
||||
((msgCtx->msgMode != MSGMODE_NONE) && (globalCtx->sceneNum == SCENE_BOWLING))) {
|
||||
if (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) {
|
||||
func_80083108(globalCtx);
|
||||
}
|
||||
|
@ -3952,7 +3962,7 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
HealthMeter_Update(globalCtx);
|
||||
|
||||
if ((gSaveContext.timer1State >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
|
||||
(msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {}
|
||||
|
||||
if (gSaveContext.rupeeAccumulator != 0) {
|
||||
|
@ -4002,8 +4012,8 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
interfaceCtx->unk_1EC = 0;
|
||||
interfaceCtx->unk_1EE = interfaceCtx->unk_1F0;
|
||||
action = interfaceCtx->unk_1EE;
|
||||
if ((action == 0x1D) || (action == 0x1E)) {
|
||||
action = 0xA;
|
||||
if ((action == DO_ACTION_MAX) || (action == DO_ACTION_MAX + 1)) {
|
||||
action = DO_ACTION_NONE;
|
||||
}
|
||||
Interface_LoadActionLabel(interfaceCtx, action, 0);
|
||||
}
|
||||
|
@ -4022,8 +4032,8 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
interfaceCtx->unk_1EC = 0;
|
||||
interfaceCtx->unk_1EE = interfaceCtx->unk_1F0;
|
||||
action = interfaceCtx->unk_1EE;
|
||||
if ((action == 0x1D) || (action == 0x1E)) {
|
||||
action = 0xA;
|
||||
if ((action == DO_ACTION_MAX) || (action == DO_ACTION_MAX + 1)) {
|
||||
action = DO_ACTION_NONE;
|
||||
}
|
||||
Interface_LoadActionLabel(interfaceCtx, action, 0);
|
||||
}
|
||||
|
@ -4032,9 +4042,9 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
|
||||
WREG(7) = interfaceCtx->unk_1F4;
|
||||
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) && (msgCtx->msgMode == 0) &&
|
||||
(globalCtx->sceneLoadFlag == 0) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) &&
|
||||
(globalCtx->transitionMode == 0) &&
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
|
||||
(msgCtx->msgMode == MSGMODE_NONE) && (globalCtx->sceneLoadFlag == 0) &&
|
||||
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (globalCtx->transitionMode == 0) &&
|
||||
((globalCtx->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(globalCtx))) {
|
||||
if ((gSaveContext.magicAcquired != 0) && (gSaveContext.magicLevel == 0)) {
|
||||
gSaveContext.magicLevel = gSaveContext.doubleMagic + 1;
|
||||
|
@ -4100,8 +4110,9 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
|
||||
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
|
||||
// exit out of ocarina mode after suns song finishes playing
|
||||
if ((msgCtx->unk_E3F0 != 0x31) && (gSaveContext.sunsSongState == SUNSSONG_START)) {
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
if ((msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE) &&
|
||||
(gSaveContext.sunsSongState == SUNSSONG_START)) {
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
}
|
||||
|
||||
// handle suns song in areas where time moves
|
||||
|
@ -4119,12 +4130,12 @@ void Interface_Update(GlobalContext* globalCtx) {
|
|||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gTimeIncrement = sPrevTimeIncrement;
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
}
|
||||
} else if (gSaveContext.dayTime > 0xC001) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
gTimeIncrement = sPrevTimeIncrement;
|
||||
globalCtx->msgCtx.unk_E3EE = 4;
|
||||
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
}
|
||||
} else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) {
|
||||
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xC001)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue