Z_message (2 NON_MATCHINGS) (#1398)

* matched func_8014D62C

* matched func_8014D304

* matched func_80149048

* matched func_80159438 & func_8014CDF0

* matched Message_GetState

* matched func_80152CAC

* matched func_80149454

* matched func_801491DC

* matched func_80150A84

* matched func_801496C8

* matched func_80149C18

* func_8014995C progress

* matched 8014995C

* matched func_80153EF0

* fix MessageContext lottery guess array size to match func_801496C8

* matched 80148D64

* matched func_8014AAD0

* progress func_8014CFDC

* matched func_8014CFDC

* progress func_801514B0

* progress#2 func_801514B0

* matched func_801514B0

* progress func_8014C70C

* Progress on few functions

* fix some variables & func name

* change unk11F00 type and usages

* func_8014C70C matched

* match func_8015268c

* fix building

* format

* engi message WIP

* enums, cleanup

* missed one

* oops

* even more enums

* another oops

* func_8015E7EC NON_MATCHING

* cleanup Message_DrawTextCredits

* MSGMODE cleanup

* import sFontWidths

* Import z_message_nes data

* Message_DrawTextNES draft

* fix types in message_nes

* Message_DrawTextNES NON_EQUIVALENT

* Message_DrawTextNES improvement

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Import bss

* fixes

* Data clean up

* Delete Message_Decode m2c output

* Readd Message_Update data

* import data

* func declaration

* cleanup

* Language enum

* fix naming, some flags

* Update functions and variables related to the bombers notebook event queue.

* Update renamed variables.txt

* format

* attempt Message_DecodeCredits

* begin Message_DecodeNES

* decode cleanup

* incremental improvements on Message_DecodeNES

* oops

* more progress

* first attempt at Message_Decode

* cleanup Message_Decode

* Message_Decode progress

* good progress on decode loops

* more progress

* good Message_Decode progress, thank anon

* decode creep

* big improvements, thanks anon/hatal

* small nes improvement

* cleanup

* match Message_DrawTextDefault, big progress on Message_DrawTextNES

* namefixer for save structs

* Some cleanup/fix non-equivalencies in decodes

* cleanup

* Small cleanup

* func_80150A84

* TextBoxType enum usage

* Format

* match Message_DecodeCredit by Maide, small improvement in Message_DrawTextNES

* comments

* some docs

* cleanup, improve matches

* Some improvement

Co-Authored-By: Santiago <github-santaclose-noreplay@NA.com>

* Fixes

* Missed

* Match Message_DrawTextNES

* Move functions to z64message.h

* string macros

* Small cleanups

* 1 more small thing

* decompme scratches

* Cleanup

* Item enum

* PR

* SEGMENT_ROM_START

* PR

* format

* ocarina cleanup

---------

Co-authored-by: andzura <andzura@andzura.fr>
Co-authored-by: Angie <angheloalf95@gmail.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Co-authored-by: Zoey Zolotova <zoey.zolotova@gmail.com>
Co-authored-by: Santiago <github-santaclose-noreplay@NA.com>
This commit is contained in:
Derek Hensley
2023-10-03 14:51:45 -07:00
committed by GitHub
parent f08a69a2cb
commit 9e72c240d9
88 changed files with 7398 additions and 815 deletions
+29 -28
View File
@@ -1709,7 +1709,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) {
if (CHECK_EVENTINF(EVENTINF_41)) {
// Related to swamp boat (non-minigame)?
for (i = EQUIP_SLOT_C_LEFT; i <= EQUIP_SLOT_C_RIGHT; i++) {
if ((GET_CUR_FORM_BTN_ITEM(i) != ITEM_PICTOGRAPH_BOX) || (msgCtx->msgMode != 0)) {
if ((GET_CUR_FORM_BTN_ITEM(i) != ITEM_PICTOGRAPH_BOX) || (msgCtx->msgMode != MSGMODE_NONE)) {
if (gSaveContext.buttonStatus[i] == BTN_ENABLED) {
restoreHudVisibility = true;
}
@@ -3657,7 +3657,7 @@ void Magic_Update(PlayState* play) {
case MAGIC_STATE_CONSUME_LENS:
// Slowly consume magic while Lens of Truth is active
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
(msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
!Play_InCsMode(play)) {
@@ -3700,7 +3700,7 @@ void Magic_Update(PlayState* play) {
// fallthrough
case MAGIC_STATE_CONSUME_GORON_ZORA:
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == 0) &&
(msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if (!Play_InCsMode(play)) {
interfaceCtx->magicConsumptionTimer--;
@@ -3722,7 +3722,7 @@ void Magic_Update(PlayState* play) {
case MAGIC_STATE_CONSUME_GIANTS_MASK:
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
(msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if (!Play_InCsMode(play)) {
interfaceCtx->magicConsumptionTimer--;
@@ -3932,7 +3932,7 @@ void Interface_DrawItemButtons(PlayState* play) {
if ((gSaveContext.hudVisibility == HUD_VISIBILITY_NONE) ||
(gSaveContext.hudVisibility == HUD_VISIBILITY_NONE_ALT) ||
(gSaveContext.hudVisibility == HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE) ||
(msgCtx->msgMode != 0)) {
(msgCtx->msgMode != MSGMODE_NONE)) {
temp = 0;
} else if (player->stateFlags1 & PLAYER_STATE1_200000) {
temp = 70;
@@ -4400,8 +4400,8 @@ void Interface_DrawClock(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
if ((R_TIME_SPEED != 0) &&
((msgCtx->msgMode == 0) || ((play->actorCtx.flags & ACTORCTX_FLAG_1) && !Play_InCsMode(play)) ||
(msgCtx->msgMode == 0) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
((msgCtx->msgMode == MSGMODE_NONE) || ((play->actorCtx.flags & ACTORCTX_FLAG_1) && !Play_InCsMode(play)) ||
(msgCtx->msgMode == MSGMODE_NONE) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
(gSaveContext.gameMode == GAMEMODE_END_CREDITS)) &&
!FrameAdvance_IsEnabled(&play->state) && !Environment_IsTimeStopped() && (gSaveContext.save.day <= 3)) {
/**
@@ -5440,31 +5440,31 @@ void Interface_StartMoonCrash(PlayState* play) {
play->transitionType = TRANS_TYPE_FADE_WHITE;
}
void Interface_GetTimerDigits(u64 timer, s16* timerArr) {
u64 time = timer;
void Interface_GetTimerDigits(OSTime time, s16* timerArr) {
OSTime t = time;
// 6 minutes
timerArr[0] = time / SECONDS_TO_TIMER(360);
time -= timerArr[0] * SECONDS_TO_TIMER(360);
timerArr[0] = t / SECONDS_TO_TIMER(360);
t -= timerArr[0] * SECONDS_TO_TIMER(360);
// minutes
timerArr[1] = time / SECONDS_TO_TIMER(60);
time -= timerArr[1] * SECONDS_TO_TIMER(60);
timerArr[1] = t / SECONDS_TO_TIMER(60);
t -= timerArr[1] * SECONDS_TO_TIMER(60);
// 10 seconds
timerArr[3] = time / SECONDS_TO_TIMER(10);
time -= timerArr[3] * SECONDS_TO_TIMER(10);
timerArr[3] = t / SECONDS_TO_TIMER(10);
t -= timerArr[3] * SECONDS_TO_TIMER(10);
// seconds
timerArr[4] = time / SECONDS_TO_TIMER(1);
time -= timerArr[4] * SECONDS_TO_TIMER(1);
timerArr[4] = t / SECONDS_TO_TIMER(1);
t -= timerArr[4] * SECONDS_TO_TIMER(1);
// 100 milliseconds
timerArr[6] = time / SECONDS_TO_TIMER_PRECISE(0, 10);
time -= timerArr[6] * SECONDS_TO_TIMER_PRECISE(0, 10);
timerArr[6] = t / SECONDS_TO_TIMER_PRECISE(0, 10);
t -= timerArr[6] * SECONDS_TO_TIMER_PRECISE(0, 10);
// 10 milliseconds
timerArr[7] = time;
timerArr[7] = t;
}
#define IS_POSTMAN_TIMER_DRAWN \
@@ -5500,8 +5500,8 @@ void Interface_DrawTimers(PlayState* play) {
// Not satisfying any of these conditions will pause the timer
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
((msgCtx->msgMode == 0) ||
((msgCtx->msgMode != 0) && (msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId <= 0x1BB6))) &&
((msgCtx->msgMode == MSGMODE_NONE) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId >= 0x1BB2) &&
(msgCtx->currentTextId <= 0x1BB6))) &&
!(player->stateFlags1 & PLAYER_STATE1_200) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {
@@ -5950,7 +5950,7 @@ void Interface_UpdateBottleTimers(PlayState* play) {
// Not satisfying any of these conditions will pause the bottle timer
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
((msgCtx->msgMode == 0) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
((msgCtx->msgMode == MSGMODE_NONE) || ((msgCtx->currentTextId >= 0x100) && (msgCtx->currentTextId <= 0x200)) ||
((msgCtx->currentTextId >= 0x1BB2) && (msgCtx->currentTextId <= 0x1BB6))) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) &&
!Play_InCsMode(play)) {
@@ -6870,7 +6870,7 @@ void Interface_Update(PlayState* play) {
interfaceCtx->aButtonRoll = -15700.0f;
interfaceCtx->aButtonState = A_BTN_STATE_2;
if ((msgCtx->msgMode != 0) && (msgCtx->textboxYTarget == 0x26)) {
if ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->textboxYTarget == 38)) {
R_A_BTN_Y_OFFSET = -14;
} else {
R_A_BTN_Y_OFFSET = 0;
@@ -7018,8 +7018,9 @@ void Interface_Update(PlayState* play) {
// Update Sun Song
if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
// exit out of ocarina mode after suns song finishes playing
if ((msgCtx->ocarinaAction != 0x39) && (gSaveContext.sunsSongState == SUNSSONG_START)) {
play->msgCtx.ocarinaMode = 4;
if ((msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOTIME_DONE) &&
(gSaveContext.sunsSongState == SUNSSONG_START)) {
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
}
// handle suns song in areas where time moves
@@ -7039,7 +7040,7 @@ void Interface_Update(PlayState* play) {
// Daytime has been reached. End suns song effect
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
R_TIME_SPEED = sPrevTimeSpeed;
play->msgCtx.ocarinaMode = 4;
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
}
} else {
// Daytime
@@ -7047,7 +7048,7 @@ void Interface_Update(PlayState* play) {
// Nighttime has been reached. End suns song effect
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
R_TIME_SPEED = sPrevTimeSpeed;
play->msgCtx.ocarinaMode = 4;
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
}
}
} else {