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

@ -144,10 +144,10 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) {
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos);
if (this->unk_1E6 != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
this->unk_1E6 = 0;
}
} else if (func_8002F194(&this->actor, globalCtx)) {
} else if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) {
this->unk_1E6 = 1;
} else if (this->actor.world.pos.y <= player->actor.world.pos.y) {
func_8002F2F4(&this->actor, globalCtx);
@ -167,7 +167,7 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) {
Vec3f playerPos = { -398.0f, 84.0f, 0.0f };
s16 rotDiff;
if (func_8002F194(&this->actor, globalCtx)) {
if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) {
Animation_Change(&this->skelAnime, &gChildZelda1Anim_10B38, 1.0f, 0.0f,
Animation_GetLastFrame(&gChildZelda1Anim_10B38), ANIMMODE_ONCE_INTERP, -10.0f);
this->unk_1E8 = Gameplay_CreateSubCamera(globalCtx);
@ -187,7 +187,7 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) {
player->actor.speedXZ = 0.0f;
this->unk_1E2 = 0;
this->actionFunc = func_80B4B240;
func_800F5C64(NA_BGM_APPEAR);
Audio_PlayFanfare(NA_BGM_APPEAR);
} else {
if (1) {} // necessary to match
rotDiff = ABS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y);
@ -225,24 +225,24 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) {
animHeaderSeg = &gChildZelda1Anim_11348;
sp3C = 1;
this->actor.textId = 0x702E;
func_8010B680(globalCtx, this->actor.textId, NULL);
Message_StartTextbox(globalCtx, this->actor.textId, NULL);
this->unk_1E2++;
break;
}
break;
case 1:
if ((func_8010BDBC(msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) {
globalCtx->envCtx.fillScreen = false;
Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp74, &sp68);
Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 25.0f);
player->actor.world.pos = sp58;
this->actor.textId = 0x702F;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2++;
}
break;
case 2:
if ((func_8010BDBC(msgCtx) == 4) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(globalCtx)) {
if (msgCtx->choiceIndex == 0) {
animHeaderSeg = &gChildZelda1Anim_13F10;
sp3C = 2;
@ -260,27 +260,27 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) {
animHeaderSeg = &gChildZelda1Anim_143A8;
sp3C = 1;
this->actor.textId = 0x7032;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2++;
}
break;
case 4:
if ((func_8010BDBC(msgCtx) == 4) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(globalCtx)) {
if (msgCtx->choiceIndex == 0) {
animHeaderSeg = &gChildZelda1Anim_132D8;
sp3C = 2;
this->unk_1E2 = 9;
} else {
this->actor.textId = 0x7034;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2++;
}
}
break;
case 5:
if ((func_8010BDBC(msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) {
this->actor.textId = 0x7033;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2--;
}
break;
@ -290,26 +290,26 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) {
animHeaderSeg = &gChildZelda1Anim_12B88;
sp3C = 1;
this->actor.textId = 0x7031;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2++;
}
break;
case 7:
if ((func_8010BDBC(msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) {
this->actor.textId = 0x7030;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2++;
}
break;
case 8:
if ((func_8010BDBC(msgCtx) == 4) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(globalCtx)) {
if (msgCtx->choiceIndex == 0) {
animHeaderSeg = &gChildZelda1Anim_138E0;
sp3C = 2;
this->unk_1E2 = 3;
} else {
this->actor.textId = 0x7031;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2--;
}
}
@ -426,7 +426,7 @@ void func_80B4BBC4(EnZl1* this, GlobalContext* globalCtx) {
func_8002DF54(globalCtx, &this->actor, 1);
func_8002F7DC(&player->actor, NA_SE_VO_LI_SURPRISE_KID);
this->actor.textId = 0x7039;
func_8010B680(globalCtx, this->actor.textId, NULL);
Message_StartTextbox(globalCtx, this->actor.textId, NULL);
this->unk_1E2 = 0;
this->actionFunc = func_80B4BF2C;
}
@ -496,25 +496,25 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
switch (this->unk_1E2) {
case 0:
if ((func_8010BDBC(msgCtx) == 4) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(globalCtx)) {
if (msgCtx->choiceIndex == 0) {
this->actor.textId = 0x703B;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2++;
} else {
this->actor.textId = 0x703A;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
this->unk_1E2 = 0;
}
}
break;
case 1:
if ((func_8010BDBC(msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(globalCtx)) {
this->actor.textId = 0xFFFF;
globalCtx->talkWithPlayer(globalCtx, &this->actor);
func_8002F434(&this->actor, globalCtx, GI_LETTER_ZELDA, 120.0f, 10.0f);
globalCtx->msgCtx.msgMode = 0x36;
globalCtx->msgCtx.unk_E3E7 = 4;
globalCtx->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
globalCtx->msgCtx.stateTimer = 4;
this->unk_1E2++;
} else {
break;
@ -531,9 +531,9 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
}
break;
case 3:
if ((func_8010BDBC(msgCtx) == 6) && (func_80106BC8(globalCtx) != 0)) {
if ((Message_GetState(msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) {
this->actor.textId = 0x703C;
func_8010B720(globalCtx, this->actor.textId);
Message_ContinueTextbox(globalCtx, this->actor.textId);
Flags_SetEventChkInf(0x40);
this->unk_1E2 = 6;
}
@ -542,7 +542,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
if (player->actor.world.pos.y < this->actor.world.pos.y) {
break;
} else {
if (func_8002F194(&this->actor, globalCtx)) {
if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) {
this->unk_1E2++;
} else {
func_8002F2F4(&this->actor, globalCtx);
@ -550,12 +550,12 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
}
break;
case 5:
if (func_8002F334(&this->actor, globalCtx)) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
this->unk_1E2--;
}
break;
case 6:
if (func_8002F334(&this->actor, globalCtx)) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
func_8002DF54(globalCtx, &this->actor, 7);
Interface_ChangeAlpha(50);
this->actor.flags &= ~0x100;