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
+1 -1
View File
@@ -18,7 +18,7 @@ void SaveContext_Init(void) {
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
gSaveContext.prevHudVisibility = HUD_VISIBILITY_ALL;
gSaveContext.options.language = 1;
gSaveContext.options.language = LANGUAGE_ENG;
gSaveContext.options.audioSetting = SAVE_AUDIO_STEREO;
gSaveContext.options.zTargetSetting = 0;
}
+4 -4
View File
@@ -197,7 +197,7 @@ void CutsceneCmd_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdMisc* cmd) {
if (isFirstFrame) {
loadedScene = play->loadedScene;
if (loadedScene->titleTextId != 0) {
func_80151A68(play, loadedScene->titleTextId);
Message_DisplaySceneTitleCard(play, loadedScene->titleTextId);
}
}
break;
@@ -1043,7 +1043,7 @@ void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) {
if (sCurOcarinaAction != cmd->textId) {
sCutsceneTextboxType = CS_TEXT_OCARINA_ACTION;
sCurOcarinaAction = cmd->textId;
func_80152434(play, cmd->textId);
Message_DisplayOcarinaStaff(play, cmd->textId);
return;
}
}
@@ -1098,7 +1098,7 @@ void CutsceneCmd_Text(PlayState* play, CutsceneContext* csCtx, CsCmdText* cmd) {
}
if ((talkState == TEXT_STATE_5) && Message_ShouldAdvance(play)) {
func_80152434(play, cmd->textId);
Message_DisplayOcarinaStaff(play, cmd->textId);
}
}
@@ -1565,7 +1565,7 @@ void Cutscene_HandleEntranceTriggers(PlayState* play) {
if ((Entrance_GetTransitionFlags(((void)0, gSaveContext.save.entrance) +
((void)0, gSaveContext.sceneLayer)) &
0x4000) != 0) {
func_80151A68(play, scene->titleTextId);
Message_DisplaySceneTitleCard(play, scene->titleTextId);
}
}
+1 -1
View File
@@ -93,7 +93,7 @@ void KaleidoSetup_Update(PlayState* play) {
(play->gameOverCtx.state == GAMEOVER_INACTIVE)) {
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if ((gSaveContext.save.cutsceneIndex < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) {
if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) {
if (!Play_InCsMode(play) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF))) {
if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
(gSaveContext.magicState != MAGIC_STATE_FILL)) {
if (!CHECK_EVENTINF(EVENTINF_17) && !(player->stateFlags1 & PLAYER_STATE1_20)) {
+5598 -166
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -2,7 +2,6 @@
#include "message_data_static.h"
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
// fontWidth
f32 sNESFontWidths[160] = {
8.0f, 8.0f, 6.0f, 9.0f, 9.0f, 14.0f, 12.0f, 3.0f, 7.0f, 7.0f, 7.0f, 9.0f, 4.0f, 6.0f, 4.0f, 9.0f,
10.0f, 5.0f, 9.0f, 9.0f, 10.0f, 9.0f, 9.0f, 9.0f, 9.0f, 9.0f, 6.0f, 6.0f, 9.0f, 11.0f, 9.0f, 11.0f,
File diff suppressed because it is too large Load Diff
+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 {
+1 -1
View File
@@ -1072,7 +1072,7 @@ void Play_Update(PlayState* this) {
this->pauseCtx.bombersNotebookOpen = false;
sBombersNotebook.loadState = BOMBERS_NOTEBOOK_LOAD_STATE_NONE;
this->msgCtx.msgLength = 0;
this->msgCtx.msgMode = 0;
this->msgCtx.msgMode = MSGMODE_NONE;
this->msgCtx.currentTextId = 0;
this->msgCtx.stateTimer = 0;
Audio_PlaySfx(NA_SE_SY_CANCEL);
+6 -7
View File
@@ -638,7 +638,7 @@ void Sram_SaveEndOfCycle(PlayState* play) {
}
gSaveContext.save.saveInfo.playerData.rupees = 0;
gSaveContext.save.saveInfo.unk_F41 = 0;
gSaveContext.save.saveInfo.scarecrowSpawnSongSet = false;
gSaveContext.powderKegTimer = 0;
gSaveContext.unk_1014 = 0;
gSaveContext.jinxTimer = 0;
@@ -1304,7 +1304,7 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible;
}
if (gSaveContext.save.saveInfo.unk_F41) {
if (gSaveContext.save.saveInfo.scarecrowSpawnSongSet) {
Lib_MemCpy(gScarecrowSpawnSongPtr, gSaveContext.save.saveInfo.scarecrowSpawnSong,
sizeof(gSaveContext.save.saveInfo.scarecrowSpawnSong));
@@ -1649,7 +1649,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
} else {
if (phi_s2) {
gSaveContext.options.optionId = 0xA51D;
gSaveContext.options.language = 1;
gSaveContext.options.language = LANGUAGE_ENG;
gSaveContext.options.audioSetting = SAVE_AUDIO_STEREO;
gSaveContext.options.languageSetting = 0;
gSaveContext.options.zTargetSetting = 0;
@@ -1657,7 +1657,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
Lib_MemCpy(&gSaveContext.options, sramCtx->saveBuf, sizeof(SaveOptions));
if (gSaveContext.options.optionId != 0xA51D) {
gSaveContext.options.optionId = 0xA51D;
gSaveContext.options.language = 1;
gSaveContext.options.language = LANGUAGE_ENG;
gSaveContext.options.audioSetting = SAVE_AUDIO_STEREO;
gSaveContext.options.languageSetting = 0;
gSaveContext.options.zTargetSetting = 0;
@@ -1671,7 +1671,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
gSaveContext.flashSaveAvailable = D_801F6AF2;
}
gSaveContext.options.language = 1;
gSaveContext.options.language = LANGUAGE_ENG;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram_NES/func_801457CC.s")
@@ -1853,8 +1853,7 @@ void Sram_InitSave(FileSelectState* fileSelect2, SramContext* sramCtx) {
*/
void Sram_WriteSaveOptionsToBuffer(SramContext* sramCtx) {
if (gSaveContext.flashSaveAvailable) {
// TODO: macros for languages
gSaveContext.options.language = 1;
gSaveContext.options.language = LANGUAGE_ENG;
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext.options, sizeof(SaveOptions));
}
}