1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-15 20:35:13 +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:
Tharo 2021-11-23 01:20:30 +00:00 committed by GitHub
parent 03636166b3
commit a497f33bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
216 changed files with 7052 additions and 16801 deletions

View file

@ -13,10 +13,8 @@ void GameOver_FadeInLights(GlobalContext* globalCtx) {
}
}
// This variable has the same problem as z_message's data going to rodata.
// A fix for this is planned, and will be taken care of with z_message.
// For now this variable is externed from z_message's rodata.s file.
extern s16 D_80153D80; // todo: rename to `timer` and make this in function static (after rodata issue is resolved)
// This variable cannot be moved into this file as all of z_message_PAL rodata is in the way
extern s16 gGameOverTimer;
void GameOver_Update(GlobalContext* globalCtx) {
GameOverContext* gameOverCtx = &globalCtx->gameOverCtx;
@ -28,7 +26,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
switch (gameOverCtx->state) {
case GAMEOVER_DEATH_START:
func_80106CCC(globalCtx);
Message_CloseTextbox(globalCtx);
gSaveContext.timer1State = 0;
gSaveContext.timer2State = 0;
@ -75,7 +73,7 @@ void GameOver_Update(GlobalContext* globalCtx) {
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0;
Environment_InitGameOverLights(globalCtx);
D_80153D80 = 20;
gGameOverTimer = 20;
if (1) {}
v90 = VREG(90);
v91 = VREG(91);
@ -91,9 +89,9 @@ void GameOver_Update(GlobalContext* globalCtx) {
break;
case GAMEOVER_DEATH_DELAY_MENU:
D_80153D80--;
gGameOverTimer--;
if (D_80153D80 == 0) {
if (gGameOverTimer == 0) {
globalCtx->pauseCtx.state = 8;
gameOverCtx->state++;
func_800AA15C();
@ -102,13 +100,13 @@ void GameOver_Update(GlobalContext* globalCtx) {
case GAMEOVER_REVIVE_START:
gameOverCtx->state++;
D_80153D80 = 0;
gGameOverTimer = 0;
Environment_InitGameOverLights(globalCtx);
ShrinkWindow_SetVal(0x20);
return;
case GAMEOVER_REVIVE_RUMBLE:
D_80153D80 = 50;
gGameOverTimer = 50;
gameOverCtx->state++;
if (1) {}
@ -121,28 +119,28 @@ void GameOver_Update(GlobalContext* globalCtx) {
break;
case GAMEOVER_REVIVE_WAIT_GROUND:
D_80153D80--;
gGameOverTimer--;
if (D_80153D80 == 0) {
D_80153D80 = 64;
if (gGameOverTimer == 0) {
gGameOverTimer = 64;
gameOverCtx->state++;
}
break;
case GAMEOVER_REVIVE_WAIT_FAIRY:
D_80153D80--;
gGameOverTimer--;
if (D_80153D80 == 0) {
D_80153D80 = 50;
if (gGameOverTimer == 0) {
gGameOverTimer = 50;
gameOverCtx->state++;
}
break;
case GAMEOVER_REVIVE_FADE_OUT:
Environment_FadeOutGameOverLights(globalCtx);
D_80153D80--;
gGameOverTimer--;
if (D_80153D80 == 0) {
if (gGameOverTimer == 0) {
gameOverCtx->state = GAMEOVER_INACTIVE;
}
break;