1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 22:30:15 +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

@ -202,9 +202,9 @@ s16 EnGo_SetFlagsGetStates(GlobalContext* globalCtx, Actor* thisx) {
f32 yRange = fabsf(thisx->yDistToPlayer) + 1.0f;
xzRange = thisx->xzDistToPlayer + 1.0f;
switch (func_8010BDBC(&globalCtx->msgCtx)) {
switch (Message_GetState(&globalCtx->msgCtx)) {
if (globalCtx) {}
case 2:
case TEXT_STATE_CLOSING:
switch (thisx->textId) {
case 0x3008:
gSaveContext.infTable[14] |= 1;
@ -256,8 +256,8 @@ s16 EnGo_SetFlagsGetStates(GlobalContext* globalCtx, Actor* thisx) {
break;
}
break;
case 4:
if (func_80106BC8(globalCtx)) {
case TEXT_STATE_CHOICE:
if (Message_ShouldAdvance(globalCtx)) {
switch (thisx->textId) {
case 0x300A:
if (globalCtx->msgCtx.choiceIndex == 0) {
@ -269,7 +269,7 @@ s16 EnGo_SetFlagsGetStates(GlobalContext* globalCtx, Actor* thisx) {
} else {
thisx->textId = 0x300D;
}
func_8010B720(globalCtx, thisx->textId);
Message_ContinueTextbox(globalCtx, thisx->textId);
unkState = 1;
break;
case 0x3034:
@ -284,7 +284,7 @@ s16 EnGo_SetFlagsGetStates(GlobalContext* globalCtx, Actor* thisx) {
} else {
thisx->textId = 0x3033;
}
func_8010B720(globalCtx, thisx->textId);
Message_ContinueTextbox(globalCtx, thisx->textId);
unkState = 1;
break;
case 0x3054:
@ -293,7 +293,7 @@ s16 EnGo_SetFlagsGetStates(GlobalContext* globalCtx, Actor* thisx) {
unkState = 2;
} else {
thisx->textId = 0x3056;
func_8010B720(globalCtx, thisx->textId);
Message_ContinueTextbox(globalCtx, thisx->textId);
unkState = 1;
}
gSaveContext.infTable[11] |= 0x10;
@ -301,15 +301,15 @@ s16 EnGo_SetFlagsGetStates(GlobalContext* globalCtx, Actor* thisx) {
}
}
break;
case 5:
if (func_80106BC8(globalCtx)) {
case TEXT_STATE_EVENT:
if (Message_ShouldAdvance(globalCtx)) {
switch (thisx->textId) {
case 0x3035:
gSaveContext.infTable[16] |= 0x800;
case 0x3032:
case 0x3033:
thisx->textId = 0x3034;
func_8010B720(globalCtx, thisx->textId);
Message_ContinueTextbox(globalCtx, thisx->textId);
unkState = 1;
break;
default:
@ -318,16 +318,16 @@ s16 EnGo_SetFlagsGetStates(GlobalContext* globalCtx, Actor* thisx) {
}
}
break;
case 6:
if (func_80106BC8(globalCtx)) {
case TEXT_STATE_DONE:
if (Message_ShouldAdvance(globalCtx)) {
unkState = 3;
}
break;
case 0:
case 1:
case 3:
case 7:
case 9:
case TEXT_STATE_NONE:
case TEXT_STATE_DONE_HAS_NEXT:
case TEXT_STATE_DONE_FADING:
case TEXT_STATE_SONG_DEMO_DONE:
case TEXT_STATE_9:
break;
}
return unkState;
@ -338,7 +338,7 @@ s32 func_80A3ED24(GlobalContext* globalCtx, EnGo* this, struct_80034A14_arg1* ar
if (arg2->unk_00) {
arg2->unk_00 = unkFunc2(globalCtx, &this->actor);
return false;
} else if (func_8002F194(&this->actor, globalCtx)) {
} else if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) {
arg2->unk_00 = 1;
return true;
} else if (!func_8002F2CC(&this->actor, globalCtx, arg3)) {
@ -865,20 +865,20 @@ void EnGo_BiggoronActionFunc(EnGo* this, GlobalContext* globalCtx) {
this->unk_21E = 100;
this->unk_1E0.unk_00 = 0;
EnGo_SetupAction(this, EnGo_Eyedrops);
globalCtx->msgCtx.msgMode = 0x37;
globalCtx->msgCtx.msgMode = MSGMODE_PAUSED;
gSaveContext.timer2State = 0;
OnePointCutscene_Init(globalCtx, 4190, -99, &this->actor, MAIN_CAM);
} else {
this->unk_1E0.unk_00 = 0;
EnGo_SetupAction(this, EnGo_GetItem);
func_80106CCC(globalCtx);
Message_CloseTextbox(globalCtx);
EnGo_GetItem(this, globalCtx);
}
}
} else if (((this->actor.params & 0xF0) == 0) && (this->unk_1E0.unk_00 == 2)) {
EnGo_SetupAction(this, EnGo_GetItem);
globalCtx->msgCtx.unk_E3E7 = 4;
globalCtx->msgCtx.msgMode = 0x36;
globalCtx->msgCtx.stateTimer = 4;
globalCtx->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
} else {
if ((DECR(this->unk_212) == 0) && !EnGo_IsCameraModified(this, globalCtx)) {
EnGo_ReverseAnimation(this);
@ -986,11 +986,11 @@ void func_80A40C78(EnGo* this, GlobalContext* globalCtx) {
gSaveContext.bgsFlag = true;
} else if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_PRESCRIPTION) {
this->actor.textId = 0x3058;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E0.unk_00 = 1;
} else if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) {
this->actor.textId = 0x305C;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E0.unk_00 = 1;
Environment_ClearBgsDayCount();
}
@ -1000,7 +1000,7 @@ void func_80A40C78(EnGo* this, GlobalContext* globalCtx) {
void EnGo_Eyedrops(EnGo* this, GlobalContext* globalCtx) {
if (DECR(this->unk_21E) == 0) {
this->actor.textId = 0x305A;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E0.unk_00 = 1;
EnGo_SetupAction(this, func_80A40DCC);
}
@ -1010,7 +1010,7 @@ void func_80A40DCC(EnGo* this, GlobalContext* globalCtx) {
if (this->unk_1E0.unk_00 == 2) {
EnGo_ChangeAnimation(this, 1);
this->skelAnime.curFrame = Animation_GetLastFrame(&gGoronAnim_004930);
func_80106CCC(globalCtx);
Message_CloseTextbox(globalCtx);
EnGo_SetupAction(this, EnGo_GetItem);
EnGo_GetItem(this, globalCtx);
}