mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
z_message progress (#701)
* 8 functions matching, 1 non-matching, 45 untouched * match func_801518B0 * match func_8014CC14 * matching 8 func, 1 non-matching * matched func_80148CBC * matched func_80156758 * matched func_80147564 * matched func_80151BB4 * matched func80152EC0/Message_Spawn_Song_Effect * matched func_80151C9C * WIP func_80148B98 * WIP func_80151938 * matched func_80151938 * matched func_80148B98 * matched func_80147734 * matched func_80147624 * WIP func_8014EBC * match func_801518B0 * matched func_80147564 * matched func80152EC0/Message_Spawn_Song_Effect * matched func_80151C9C * WIP func_80148B98 * matched func_80151938 * matched func_80148B98 * matched func_80147734 * matched func_80147624 * WIP#2 func_8014EBC * matched func_80149EBC * WIP func_8014CCB4 * matched func_8014CCB4 * matched func_80151A68 * WIP func_8014D62C * fix func_8015A68 signature * z_message_nes & z_message_staff progress * z_message_nes & z_message_staff renaming * documenting z_message * cleaning & renaming * documenting MessageContext * matched func_80151A68 * format * naming convention fix * re-add func_80147564 * apply renaming of Message_ShouldAdvanceSilent on the whole project * re-format, add clang-format off/on in z_message.c needed for matching * rename staff => credits; add renames in actorfixer. * change rupees array to ascii * remove useless comments * change MessageContext.decodedBuffer to a union * remove decodedBuffer from actorfixer * applied AngheloAlf suggestions & ran sfxconvert on z_message.c * rename message_struct => message_data_static; revert decodedBuffer as union creating differences. * use true/false instead of 1/0 * use SET_FULLSCREEN_VIEWPORT macro in func_80152c64 * AngheloAlf suggestions. * extract assign from dayTime calculation for readability in Message_LoadTimeNES * remove bss_reordering from osFlash, idle & boot_main to typedef MessageTableEntry in message_data_static & make decodedBuffer an union. * remove useless casts * Changes hexa to ascii chars when it's meaningful; add comments to func_8014CCB4 to show what hexa constant means. * Hensldm suggestions * ran actorfixer on new changes; fix new bss reordering error introduced with rebase * use new TIME_TO_MINUTES_F macro * re-ran format.sh * hensldm suggestions #2 + overall cleaning * remove useless parenthesis * Update include/message_data_static.h Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com> * actorfixer and format * more fixes Co-authored-by: Andzura <andzura@andzura.fr> Co-authored-by: abaud <adrien.baud@inria.fr> Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
This commit is contained in:
co-authored by
Andzura
abaud
Anghelo Carvajal
parent
02cb971616
commit
4f3202fd7e
@@ -159,14 +159,14 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
temp_v0 = Message_GetState(&globalCtx->msgCtx);
|
||||
if (temp_v0 != 4) {
|
||||
if (temp_v0 != 5) {
|
||||
if ((temp_v0 == 6) && (func_80147624(globalCtx) != 0)) {
|
||||
if ((temp_v0 == 6) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
this->actionFunc = func_80952734;
|
||||
return;
|
||||
}
|
||||
// Duplicate return node #17. Try simplifying control flow for better match
|
||||
return;
|
||||
}
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
func_801477B4(globalCtx);
|
||||
Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel);
|
||||
this->actionFunc = func_809529AC;
|
||||
@@ -175,7 +175,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
// Duplicate return node #17. Try simplifying control flow for better match
|
||||
return;
|
||||
}
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
|
||||
if (temp_v0_2 != 0) {
|
||||
if (temp_v0_2 != 1) {
|
||||
@@ -211,7 +211,7 @@ which is long, messy, and contains some rather nasty-looking control flow, inclu
|
||||
temp_v0 = Message_GetState(&globalCtx->msgCtx);
|
||||
if (temp_v0 != 4) {
|
||||
if (temp_v0 != 5) {
|
||||
if ((temp_v0 == 6) && (func_80147624(globalCtx) != 0)) {
|
||||
if ((temp_v0 == 6) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
this->actionFunc = func_80952734;
|
||||
return;
|
||||
}
|
||||
@@ -248,13 +248,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
if (temp_v0 != 6) {
|
||||
goto block_17;
|
||||
}
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
goto block_17;
|
||||
}
|
||||
this->actionFunc = func_80952734;
|
||||
return;
|
||||
block_5:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
goto block_17;
|
||||
}
|
||||
func_801477B4(globalCtx);
|
||||
@@ -262,7 +262,7 @@ block_5:
|
||||
this->actionFunc = func_809529AC;
|
||||
return;
|
||||
block_7:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
goto block_17;
|
||||
}
|
||||
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
|
||||
@@ -350,13 +350,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
if (temp_v0 != 6) {
|
||||
goto block_17;
|
||||
}
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
goto block_17;
|
||||
}
|
||||
this->actionFunc = func_80952734;
|
||||
return;
|
||||
block_5:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
goto block_17;
|
||||
}
|
||||
func_801477B4(globalCtx);
|
||||
@@ -364,7 +364,7 @@ block_5:
|
||||
this->actionFunc = func_809529AC;
|
||||
return;
|
||||
block_7:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
goto block_17;
|
||||
}
|
||||
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
|
||||
@@ -420,13 +420,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
if (temp_v0 != 6) {
|
||||
return;
|
||||
}
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
return;
|
||||
}
|
||||
this->actionFunc = func_80952734;
|
||||
return;
|
||||
block_5:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
return;
|
||||
}
|
||||
func_801477B4(globalCtx);
|
||||
@@ -434,7 +434,7 @@ block_5:
|
||||
this->actionFunc = func_809529AC;
|
||||
return;
|
||||
block_7:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
return;
|
||||
}
|
||||
temp_v0_2 = globalCtx->msgCtx.choiceIndex;
|
||||
@@ -557,7 +557,7 @@ There's a couple of other obvious things here:
|
||||
Well, at least the bottom half looks respectable now. Again, there is no code after the switch, so the next thing up, namely
|
||||
|
||||
```C
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
return;
|
||||
}
|
||||
```
|
||||
@@ -578,13 +578,13 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
if (temp_v0 != 6) {
|
||||
return;
|
||||
}
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
return;
|
||||
}
|
||||
this->actionFunc = func_80952734;
|
||||
return;
|
||||
block_5:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
return;
|
||||
}
|
||||
func_801477B4(globalCtx);
|
||||
@@ -592,7 +592,7 @@ block_5:
|
||||
this->actionFunc = func_809529AC;
|
||||
return;
|
||||
block_7:
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
func_801477B4(globalCtx);
|
||||
@@ -647,7 +647,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (func_80147624(globalCtx) == 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) == 0) {
|
||||
return;
|
||||
}
|
||||
func_801477B4(globalCtx);
|
||||
@@ -656,7 +656,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
func_801477B4(globalCtx);
|
||||
@@ -700,7 +700,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
func_801477B4(globalCtx);
|
||||
Actor_PickUp((Actor *) this, globalCtx, 0x35, this->actor.xzDistToPlayer, this->actor.playerHeightRel);
|
||||
this->actionFunc = func_809529AC;
|
||||
@@ -708,7 +708,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
if (Message_ShouldAdvance(globalCtx) != 0) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
func_801477B4(globalCtx);
|
||||
|
||||
@@ -183,7 +183,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) {
|
||||
if ((temp_v0_2 == 5) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
if (this->actor.textId == 0x2AD9) {
|
||||
Flags_SetSwitch(globalCtx, this->actor.params);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
|
||||
@@ -500,7 +500,7 @@ void func_80C102D4(EnRecepgirl* this, GlobalContext* globalCtx) {
|
||||
if (temp_v0_2 == 2) {
|
||||
this->actor.textId = 0x2ADC; // hear directions again?
|
||||
func_80C10148(this);
|
||||
} else if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) {
|
||||
} else if ((temp_v0_2 == 5) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
if (this->actor.textId == 0x2AD9) { // "Welcome..."
|
||||
Flags_SetSwitch(globalCtx, this->actor.params);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
|
||||
|
||||
@@ -288,7 +288,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) {
|
||||
func_80C10148(this);
|
||||
return;
|
||||
}
|
||||
if (((temp_v0_2 & 0xFF) == 5) && (func_80147624(globalCtx) != 0)) {
|
||||
if (((temp_v0_2 & 0xFF) == 5) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
temp_v0_3 = this->actor.textId;
|
||||
if (temp_v0_3 == 0x2AD9) {
|
||||
Flags_SetSwitch(globalCtx, (s32) this->actor.params);
|
||||
@@ -347,7 +347,7 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (((temp_v0_2 & 0xFF) == 5) && (func_80147624(globalCtx) != 0)) {
|
||||
if (((temp_v0_2 & 0xFF) == 5) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
if (this->actor.textId == 0x2AD9) {
|
||||
Flags_SetSwitch(globalCtx, this->actor.params);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f);
|
||||
@@ -397,7 +397,7 @@ somehow we skipped over `t0`. Where is this in the code? The `153` in the middle
|
||||
return;
|
||||
}
|
||||
|
||||
if (((temp_v0_2 & 0xFF) == 5) && (func_80147624(globalCtx) != 0)) {
|
||||
if (((temp_v0_2 & 0xFF) == 5) && (Message_ShouldAdvance(globalCtx) != 0)) {
|
||||
```
|
||||
|
||||
If you look at the conditionals and the declaration of `temp_v0_2`, you may notice something odd: `temp_v0_2` is a `u8`. Therefore the `& 0xFF` does nothing! It's surprisingly common for this to happen, be it leaving out a `& 0xFF` or adding an extraneous one. If we remove it, we get a match:
|
||||
|
||||
+22
-22
@@ -1801,7 +1801,7 @@ void func_80105818(GlobalContext* globalCtx, u32 uParm2, TransitionActorEntry* p
|
||||
// void func_80109F78(void);
|
||||
s32 func_8010A000(GlobalContext* globalCtx);
|
||||
s32 func_8010A074(GlobalContext* globalCtx);
|
||||
// void func_8010A0A4(void);
|
||||
s32 func_8010A0A4(GlobalContext* globalCtx);
|
||||
// void func_8010A0F0(void);
|
||||
// void func_8010A164(void);
|
||||
// void func_8010A194(void);
|
||||
@@ -2609,10 +2609,10 @@ void func_80147198(SramContext* param_1);
|
||||
// void Sram_nop8014750C(UNK_TYPE4 param_1);
|
||||
// void func_80147520(void);
|
||||
void func_80147564(GlobalContext* globalCtx);
|
||||
s32 func_80147624(GlobalContext* globalCtx);
|
||||
s32 func_80147734(GlobalContext* globalCtx);
|
||||
s32 Message_ShouldAdvance(GlobalContext* globalCtx);
|
||||
s32 Message_ShouldAdvanceSilent(GlobalContext* globalCtx);
|
||||
void func_801477B4(GlobalContext* globalCtx);
|
||||
// void func_80147818(GlobalContext* globalCtx, UNK_PTR puParm2, UNK_TYPE4 uParm3, UNK_TYPE4 uParm4);
|
||||
void func_80147818(GlobalContext* globalCtx, UNK_PTR puParm2, UNK_TYPE4 uParm3, UNK_TYPE4 uParm4);
|
||||
// void func_80147F18(GlobalContext* globalCtx, UNK_PTR puParm2, UNK_TYPE4 uParm3, UNK_TYPE4 uParm4);
|
||||
// void func_80148558(GlobalContext* globalCtx, UNK_PTR puParm2, UNK_TYPE4 uParm3, UNK_TYPE4 uParm4);
|
||||
void func_80148B98(GlobalContext* globalCtx, u8 bParm2);
|
||||
@@ -2623,28 +2623,28 @@ void func_80148B98(GlobalContext* globalCtx, u8 bParm2);
|
||||
// void func_80149454(void);
|
||||
// void func_801496C8(void);
|
||||
// void func_8014995C(void);
|
||||
// void func_80149C18(void);
|
||||
// void func_80149EBC(void);
|
||||
void func_80149C18(GlobalContext* globalCtx);
|
||||
// void Message_FindMessage(void);
|
||||
void func_80149F74(GlobalContext* globalCtx, u32** ppuParm2);
|
||||
// void func_8014AAD0(void);
|
||||
void func_8014ADBC(GlobalContext* globalCtx, UNK_PTR puParm2);
|
||||
// void func_8014C70C(void);
|
||||
// void func_8014CC14(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
|
||||
void Message_LoadChar(GlobalContext* globalCtx, u16 codePointIndex, s32* offset, f32* arg3, s16 arg4);
|
||||
// void func_8014CCB4(void);
|
||||
// void func_8014CDF0(void);
|
||||
// void func_8014CFDC(void);
|
||||
// void func_8014D304(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
void func_8014D304(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void func_8014D62C(void);
|
||||
// void func_8014D7B4(void);
|
||||
// void func_80150A84(void);
|
||||
void func_80150A84(GlobalContext* globalCtx);
|
||||
void func_80150D08(GlobalContext* globalCtx, u32 uParm2);
|
||||
// void func_801514B0(void);
|
||||
void Message_StartTextbox(GlobalContext* globalCtx, u16 textId, Actor* Actor);
|
||||
void func_80151938(GlobalContext* globalCtx, u16 textId);
|
||||
void func_80151A68(GlobalContext* globalCtx, u16 textId);
|
||||
void func_80151BB4(GlobalContext* globalCtx, u32 uParm2);
|
||||
void func_80151BB4(GlobalContext* globalCtx, u8 uParm2);
|
||||
// void func_80151C9C(void);
|
||||
// void func_80151DA4(void);
|
||||
void func_80151DA4(GlobalContext* globalCtx, u16 arg2);
|
||||
void func_80152434(GlobalContext* globalCtx, u16 arg2);
|
||||
// void func_80152464(void);
|
||||
u8 Message_GetState(MessageContext* msgCtx);
|
||||
@@ -2656,23 +2656,23 @@ u8 Message_GetState(MessageContext* msgCtx);
|
||||
// void func_80153750(void);
|
||||
// void func_80153E7C(void);
|
||||
// void func_80153EF0(void);
|
||||
// void func_801541D4(void);
|
||||
void func_801541D4(GlobalContext* globalCtx, Gfx** gfxp);
|
||||
// void func_80156758(void);
|
||||
void func_8015680C(GlobalContext* globalCtx);
|
||||
void func_801586A4(GlobalContext* globalCtx);
|
||||
void Message_Init(GlobalContext* globalCtx);
|
||||
void func_801588D0(GlobalContext* globalCtx, s16 param_2);
|
||||
// void func_80158988(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
|
||||
// void func_80158A24(void);
|
||||
// void func_80158C04(void);
|
||||
// void func_80158D98(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
|
||||
// void func_80158FB0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void func_8015926C(void);
|
||||
void Message_FindMessageNES(GlobalContext* globalCtx, u16 textId);
|
||||
// void Message_LoadCharNES(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
|
||||
// void Message_LoadPluralRupeesNES(void);
|
||||
// void Message_LoadLocalizedRupeesNES(void);
|
||||
// void Message_LoadRupeesNES(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
|
||||
// void Message_LoadTimeNES(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
// void Message_LoadAreaTextNES(void);
|
||||
// void func_80159438(void);
|
||||
// void func_8015966C(void);
|
||||
void func_8015966C(GlobalContext* globalCtx, UNK_PTR puParm2, UNK_TYPE arg3);
|
||||
// void func_8015A144(void);
|
||||
// void func_8015B198(void);
|
||||
// void func_8015E750(void);
|
||||
void func_8015B198(GlobalContext* globalCtx);
|
||||
void Message_FindCreditsMessage(GlobalContext *globalCtx, u16 textId);
|
||||
void func_8015E7EC(GlobalContext* globalCtx, UNK_PTR puParm2);
|
||||
// void func_8015F8A8(UNK_TYPE4 ctxt);
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef MESSAGE_DATA_STATIC_H
|
||||
#define MESSAGE_DATA_STATIC_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
typedef struct MessageTableEntry{
|
||||
/* 0x0 */ u16 textId;
|
||||
/* 0x2 */ u8 typePos;
|
||||
/* 0x4 */ const char* segment;
|
||||
} MessageTableEntry; // size = 0x8;
|
||||
|
||||
#endif
|
||||
+5
-7
@@ -1412,9 +1412,7 @@ extern u16 D_801C6A44;
|
||||
// extern UNK_TYPE1 D_801C6A98;
|
||||
// extern UNK_TYPE1 D_801C6AB8;
|
||||
// extern UNK_TYPE1 D_801C6B28;
|
||||
// extern UNK_TYPE1 D_801C6B98;
|
||||
// extern UNK_TYPE1 D_801CED40;
|
||||
// extern UNK_TYPE1 D_801CFB08;
|
||||
// extern UNK_TYPE2 D_801CFC78;
|
||||
// extern UNK_TYPE1 D_801CFC7A;
|
||||
// extern UNK_TYPE1 D_801CFC7C;
|
||||
@@ -1424,8 +1422,8 @@ extern u16 D_801C6A44;
|
||||
// extern UNK_TYPE1 D_801CFC8C;
|
||||
// extern UNK_TYPE1 D_801CFC8E;
|
||||
// extern UNK_TYPE1 D_801CFC92;
|
||||
// extern UNK_TYPE1 D_801CFC98;
|
||||
// extern UNK_TYPE2 D_801CFCA4;
|
||||
extern u8 D_801CFC98;
|
||||
extern s16 D_801CFCA4[9];
|
||||
// extern UNK_TYPE2 D_801CFCAC;
|
||||
// extern UNK_TYPE1 D_801CFCB8;
|
||||
// extern UNK_TYPE2 D_801CFCD8;
|
||||
@@ -1517,11 +1515,11 @@ extern char D_801D039C[];
|
||||
// extern UNK_TYPE1 D_801D0428;
|
||||
// extern UNK_TYPE1 D_801D045A;
|
||||
// extern UNK_TYPE1 D_801D0462;
|
||||
// extern UNK_TYPE1 D_801D0468;
|
||||
//extern UNK_TYPE1 D_801D0468;
|
||||
// extern UNK_TYPE1 D_801D0470;
|
||||
extern char D_801D06F0[];
|
||||
// extern char D_801D06F0[];
|
||||
// extern UNK_TYPE1 D_801D0710;
|
||||
extern char D_801D0714[];
|
||||
// extern char D_801D0714[];
|
||||
// extern UNK_TYPE1 D_801D07C4;
|
||||
// extern UNK_TYPE1 D_801D07DC;
|
||||
// extern UNK_TYPE1 D_801D080C;
|
||||
|
||||
+63
-15
@@ -21,6 +21,7 @@
|
||||
#include "ichain.h"
|
||||
#include "sequence.h"
|
||||
#include "sfx.h"
|
||||
#include "message_data_static.h"
|
||||
|
||||
#include "z64actor.h"
|
||||
#include "z64animation.h"
|
||||
@@ -174,7 +175,7 @@ typedef struct {
|
||||
} msgBuf;
|
||||
/* 0x11D80 */ u8* messageStart;
|
||||
/* 0x11D84 */ u8* messageEnd;
|
||||
/* 0x11D88 */ u8 unk_11D88;
|
||||
/* 0x11D88 */ u8 unk_11D88; // current Char Buffer ?
|
||||
} Font; // size = 0x11D8C
|
||||
|
||||
// Game Info aka. Static Context
|
||||
@@ -839,44 +840,91 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* 0x00000 */ View view;
|
||||
/* 0x00168 */ Font font;
|
||||
/* 0x11EF4 */ char unk_11EF4[0x10];
|
||||
/* 0x11F04 */ u16 unk11F04;
|
||||
/* 0x11EF4 */ char unk_11EF4[0x4];
|
||||
/* 0x11EF8 */ UNK_PTR unk11EF8;
|
||||
/* 0x11EFC */ UNK_TYPE1 unk11EFC[0x8];
|
||||
/* 0x11F04 */ u16 currentTextId;
|
||||
/* 0x11F06 */ UNK_TYPE1 pad11F06[0x4];
|
||||
/* 0x11F0A */ u8 unk11F0A;
|
||||
/* 0x11F0B */ UNK_TYPE1 pad11F0B[0x5];
|
||||
/* 0x11F10 */ s32 unk11F10;
|
||||
/* 0x11F14 */ UNK_TYPE1 pad11F14[0xE];
|
||||
/* 0x11F14 */ UNK_TYPE1 pad11F14[0x6];
|
||||
/* 0x11F1A */ s16 unk11F1A[3];
|
||||
/* 0x11F20 */ UNK_TYPE1 pad11F20[0x2];
|
||||
/* 0x11F22 */ u8 msgMode;
|
||||
/* 0x11F23 */ UNK_TYPE1 pad11F23[0xFD];
|
||||
/* 0x11F23 */ UNK_TYPE1 pad11F23;
|
||||
/* 0x11F24 */ union {
|
||||
u8 schar[206];
|
||||
u16 wchar[103];
|
||||
} decodedBuffer;
|
||||
/* 0x11FF2 */ u16 unk11FF2;
|
||||
/* 0x11FF4 */ s16 unk11FF4;
|
||||
/* 0x11FF6 */ s16 unk11FF6;
|
||||
/* 0x11FF8 */ UNK_TYPE1 unk11FF8[0x6];
|
||||
/* 0x11FFE */ s16 unk11FFE[0x3];
|
||||
/* 0x12004 */ s16 unk12004;
|
||||
/* 0x12006 */ s16 unk12006;
|
||||
/* 0x12008 */ u8 unk12008[0x16];
|
||||
/* 0x1201E */ s16 unk1201E;
|
||||
/* 0x12020 */ u8 unk12020;
|
||||
/* 0x12021 */ u8 choiceIndex;
|
||||
/* 0x12022 */ u8 unk12022;
|
||||
/* 0x12023 */ u8 unk12023;
|
||||
/* 0x12024 */ UNK_TYPE1 unk12024[0x6];
|
||||
/* 0x12024 */ s16 unk12024;
|
||||
/* 0x12026 */ u16 unk12026;
|
||||
/* 0x12028 */ u16 songPlayed;
|
||||
/* 0x1202A */ u16 ocarinaMode;
|
||||
/* 0x1202C */ u16 ocarinaAction;
|
||||
/* 0x1202E */ u16 unk1202E;
|
||||
/* 0x12030 */ s16 unk_12030;
|
||||
/* 0x12032 */ UNK_TYPE1 unk_12032[0x2];
|
||||
/* 0x12034 */ UNK_TYPE1 pad12034[0x10];
|
||||
/* 0x12034 */ UNK_TYPE1 pad12034[0x6];
|
||||
/* 0x1203A */ s16 unk1203A;
|
||||
/* 0x1203C */ s16 unk1203C;
|
||||
/* 0x1203E */ s16 pad1203E;
|
||||
/* 0x12040 */ Actor* unkActor;
|
||||
/* 0x12044 */ s16 unk12044;
|
||||
/* 0x12046 */ UNK_TYPE1 pad12046[0x2];
|
||||
/* 0x12046 */ s16 unk12046;
|
||||
/* 0x12048 */ u8 unk12048; // EnKakasi
|
||||
/* 0x12049 */ UNK_TYPE1 pad12049[0xB];
|
||||
/* 0x12054 */ s16 unk12054[5]; // Number entry
|
||||
/* 0x1205A */ UNK_TYPE1 pad1205A[0xC];
|
||||
/* 0x12049 */ UNK_TYPE1 pad12049[0x1];
|
||||
/* 0x1204A */ s16 unk1204A[0x5];
|
||||
/* 0x12054 */ s16 unk12054[3]; // First, second and third digits in lottery code guess
|
||||
/* 0x1205A */ UNK_TYPE1 pad1205A[0xE];
|
||||
/* 0x12068 */ s16 unk12068;
|
||||
/* 0x1206A */ s16 unk1206A;
|
||||
/* 0x1206C */ s32 unk1206C;
|
||||
/* 0x12070 */ s32 unk12070;
|
||||
/* 0x12074 */ UNK_TYPE1 pad12074[0x4];
|
||||
/* 0x12078 */ s32 bankRupeesSelected;
|
||||
/* 0x1207C */ s32 bankRupees;
|
||||
/* 0x12080 */ UNK_TYPE1 pad12080[0x30];
|
||||
/* 0x12080 */ MessageTableEntry* messageEntryTable;
|
||||
/* 0x12084 */ MessageTableEntry* messageEntryTableNes;
|
||||
/* 0x12088 */ UNK_TYPE4 unk12088;
|
||||
/* 0x1208C */ MessageTableEntry* messageTableStaff;
|
||||
/* 0x12090 */ s16 unk12090;
|
||||
/* 0x12092 */ s16 unk12092;
|
||||
/* 0x12094 */ s8 unk12094;
|
||||
/* 0x12095 */ UNK_TYPE1 unk12095[0x3];
|
||||
/* 0x12098 */ f32 unk12098; // Text_Scale?
|
||||
/* 0x1209C */ s16 unk1209C;
|
||||
/* 0x1209E */ UNK_TYPE1 unk1209E[0x2];
|
||||
/* 0x120A0 */ s32 unk120A0;
|
||||
/* 0x120A4 */ UNK_TYPE1 unk120A4[0xC];
|
||||
/* 0x120B0 */ u8 unk120B0;
|
||||
/* 0x120B1 */ u8 unk120B1;
|
||||
/* 0x120B2 */ UNK_TYPE1 pad120B2[0x22];
|
||||
/* 0x120D4 */ UNK_TYPE2 unk120D4;
|
||||
/* 0x120D6 */ UNK_TYPE2 unk120D6;
|
||||
/* 0x120B2 */ u8 unk120B2[0xC];
|
||||
/* 0x120BE */ s16 unk120BE;
|
||||
/* 0x120C0 */ s16 unk120C0;
|
||||
/* 0x120C2 */ s16 unk120C2;
|
||||
/* 0x120C4 */ s32 unk120C4;
|
||||
/* 0x120C8 */ s16 unk120C8;
|
||||
/* 0x120CA */ s16 unk120CA;
|
||||
/* 0x120CC */ s16 unk120CC;
|
||||
/* 0x120CE */ s16 unk120CE;
|
||||
/* 0x120D0 */ s16 unk120D0;
|
||||
/* 0x120D2 */ s16 unk120D2;
|
||||
/* 0x120D4 */ s16 unk120D4;
|
||||
/* 0x120D6 */ s16 unk120D6;
|
||||
/* 0x120D8 */ UNK_TYPE1 pad120D8[0x8];
|
||||
} MessageContext; // size = 0x120E0
|
||||
|
||||
|
||||
+2
-2
@@ -1055,7 +1055,7 @@ void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx,
|
||||
dialogState = Message_GetState(&globalCtx->msgCtx);
|
||||
if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8)) {
|
||||
csCtx->frames--;
|
||||
if ((dialogState == 4) && func_80147624(globalCtx)) {
|
||||
if ((dialogState == 4) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (globalCtx->msgCtx.choiceIndex == 0) {
|
||||
if (cmd->base == 0x33BD) {
|
||||
func_8019F230();
|
||||
@@ -1093,7 +1093,7 @@ void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx,
|
||||
}
|
||||
}
|
||||
|
||||
if (dialogState == 5 && func_80147624(globalCtx) != 0) {
|
||||
if (dialogState == 5 && Message_ShouldAdvance(globalCtx) != 0) {
|
||||
func_80152434(globalCtx, cmd->base);
|
||||
}
|
||||
}
|
||||
|
||||
+470
-23
File diff suppressed because it is too large
Load Diff
+269
-7
@@ -1,18 +1,280 @@
|
||||
#include "global.h"
|
||||
#include "message_data_static.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_801588D0.s")
|
||||
#if 0
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_80158988.s")
|
||||
//fontWidth
|
||||
extern f32 D_801D0470[159];
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_80158A24.s")
|
||||
//rupeesTextLocalization
|
||||
u8 D_801D06F0[4][8] = { { "rupee(s)" }, //EN
|
||||
{ "rubin(e)" }, //DE
|
||||
{ "rubis" }, //FR
|
||||
{ "rupia(s)" } //SPA
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_80158C04.s")
|
||||
// rupeesTextLength
|
||||
u8 D_801D0710[4] = {8,8,5,8};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_80158D98.s")
|
||||
//TextArea
|
||||
char D_801D0714[11][16] = {
|
||||
"Great Bay Coast",
|
||||
"Zora Cape",
|
||||
"Snowhead",
|
||||
"Mountain Village",
|
||||
"Clock Town",
|
||||
"Milk Road",
|
||||
"Woodfall",
|
||||
"Southern Swamp",
|
||||
"Ikana Canyon",
|
||||
"Stone Tower",
|
||||
"Entrance"
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_80158FB0.s")
|
||||
//TextAreaLength
|
||||
s16 D_801D07C4[11] = {15,9,8,16,10,9,8,14,12,11,8};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_8015926C.s")
|
||||
#endif
|
||||
|
||||
extern f32 D_801D0470[159];
|
||||
extern u8 D_801D06F0[4][8];
|
||||
extern u8 D_801D0710[4];
|
||||
extern u8 D_801D0714[11][16];
|
||||
extern s16 D_801D07C4[11];
|
||||
|
||||
void Message_FindMessageNES(GlobalContext* globalCtx, u16 textId) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
Font* font = &msgCtx->font;
|
||||
MessageTableEntry* msgEntry = msgCtx->messageEntryTableNes;
|
||||
const char* segment = msgEntry->segment;
|
||||
const char* foundSegment;
|
||||
const char* nextSegment;
|
||||
|
||||
while (msgEntry->textId != 0xFFFF) {
|
||||
if (msgEntry->textId == textId) {
|
||||
foundSegment = msgEntry->segment;
|
||||
msgEntry++;
|
||||
nextSegment = msgEntry->segment;
|
||||
font->messageStart = foundSegment - segment;
|
||||
font->messageEnd = nextSegment - foundSegment;
|
||||
return;
|
||||
}
|
||||
msgEntry++;
|
||||
}
|
||||
|
||||
msgEntry = msgCtx->messageEntryTableNes;
|
||||
foundSegment = msgEntry->segment;
|
||||
msgEntry++;
|
||||
nextSegment = msgEntry->segment;
|
||||
font->messageStart = foundSegment - segment;
|
||||
font->messageEnd = nextSegment - foundSegment;
|
||||
}
|
||||
|
||||
void Message_LoadCharNES(GlobalContext* globalCtx, u8 codePointIndex, s32* offset, f32* arg3, s16 decodedBufPos) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s32 temp1 = *offset;
|
||||
f32 temp2 = *arg3;
|
||||
|
||||
Font_LoadCharNES(globalCtx, codePointIndex, temp1);
|
||||
msgCtx->decodedBuffer.schar[decodedBufPos] = codePointIndex;
|
||||
temp1 += FONT_CHAR_TEX_SIZE;
|
||||
temp2 += (16.0f * msgCtx->unk12098);
|
||||
*offset = temp1;
|
||||
*arg3 = temp2;
|
||||
}
|
||||
|
||||
void Message_LoadPluralRupeesNES(GlobalContext* globalCtx, s16* decodedBufPos, s32* offset, f32* arg3) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s16 p = *decodedBufPos;
|
||||
s32 o = *offset;
|
||||
f32 f = *arg3;
|
||||
|
||||
msgCtx->decodedBuffer.schar[p] = 0x20;
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'R', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'R';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'u', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'u';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'p', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'p';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'e', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'e';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'e', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'e';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 's', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 's';
|
||||
|
||||
f += 16.0f * msgCtx->unk12098 * 6.0f;
|
||||
*decodedBufPos = p;
|
||||
*offset = o;
|
||||
*arg3 = f;
|
||||
}
|
||||
|
||||
void Message_LoadLocalizedRupeesNES(GlobalContext* globalCtx, s16* decodedBufPos, s32* offset, f32* arg3) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s16 p = *decodedBufPos;
|
||||
s32 o = *offset;
|
||||
f32 f = *arg3;
|
||||
u8 j;
|
||||
|
||||
msgCtx->decodedBuffer.schar[p] = ' ';
|
||||
p++;
|
||||
|
||||
for (j = 0; j < D_801D0710[gSaveContext.language - 1]; j++) {
|
||||
Font_LoadCharNES(globalCtx, D_801D06F0[gSaveContext.language - 1][j], o);
|
||||
msgCtx->decodedBuffer.schar[p] = D_801D06F0[gSaveContext.language - 1][j];
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
p++;
|
||||
}
|
||||
|
||||
p--;
|
||||
f += 16.0f * msgCtx->unk12098 * (D_801D0710[gSaveContext.language - 1] + 1);
|
||||
*decodedBufPos = p;
|
||||
*offset = o;
|
||||
*arg3 = f;
|
||||
}
|
||||
|
||||
void Message_LoadRupeesNES(GlobalContext* globalCtx, s16* decodedBufPos, s32* offset, f32* arg3, s16 singular) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s16 p = *decodedBufPos;
|
||||
s32 o = *offset;
|
||||
f32 f = *arg3;
|
||||
|
||||
msgCtx->decodedBuffer.schar[p] = ' ';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'R', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'R';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'u', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'u';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'p', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'p';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'e', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'e';
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 'e', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 'e';
|
||||
|
||||
if (singular != 1) {
|
||||
p++;
|
||||
Font_LoadCharNES(globalCtx, 's', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = 's';
|
||||
f += 16.0f * msgCtx->unk12098 * 6.0f;
|
||||
} else {
|
||||
f += 16.0f * msgCtx->unk12098 * 5.0f;
|
||||
}
|
||||
|
||||
*decodedBufPos = p;
|
||||
*offset = o;
|
||||
*arg3 = f;
|
||||
}
|
||||
|
||||
void Message_LoadTimeNES(GlobalContext* globalCtx, u8 arg1, s32* offset, f32* arg3, s16* decodedBufPos) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s16 p = *decodedBufPos;
|
||||
s32 o = *offset;
|
||||
f32 f = *arg3;
|
||||
u32 dayTime;
|
||||
s16 digits[4];
|
||||
f32 timeInMinutes;
|
||||
s32 day;
|
||||
s16 i;
|
||||
|
||||
if (arg1 == 0xCF) {
|
||||
day = gSaveContext.day;
|
||||
dayTime = 0x40000 - ((day % 5) << 16) - (u16)(-0x4000 + gSaveContext.time);
|
||||
} else {
|
||||
dayTime = 0x10000 - (u16)(-0x4000 + gSaveContext.time);
|
||||
}
|
||||
timeInMinutes = TIME_TO_MINUTES_F(dayTime);
|
||||
|
||||
digits[0] = 0;
|
||||
digits[1] = (timeInMinutes / 60.0f);
|
||||
while (digits[1] >= 10) {
|
||||
digits[0]++;
|
||||
digits[1] -= 10;
|
||||
}
|
||||
|
||||
digits[2] = 0;
|
||||
digits[3] = (s32)timeInMinutes % 60;
|
||||
while (digits[3] >= 10) {
|
||||
digits[2]++;
|
||||
digits[3] -= 10;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
Font_LoadCharNES(globalCtx, digits[i] + '0', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = digits[i] + '0';
|
||||
p++;
|
||||
if (i == 1) {
|
||||
Font_LoadCharNES(globalCtx, ':', o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
msgCtx->decodedBuffer.schar[p] = ':';
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
f += 5.0f * (16.0f * msgCtx->unk12098);
|
||||
*decodedBufPos = p - 1;
|
||||
*offset = o;
|
||||
*arg3 = f;
|
||||
}
|
||||
|
||||
void Message_LoadAreaTextNES(GlobalContext* globalCtx, s32* offset, f32* arg2, s16* decodedBufPos) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
s16 p = *decodedBufPos;
|
||||
s32 o = *offset;
|
||||
f32 f = *arg2;
|
||||
s16 i;
|
||||
u8 currentChar;
|
||||
s16 currentArea;
|
||||
s16 stringLimit;
|
||||
|
||||
if ((func_8010A0A4(globalCtx) != 0) || (globalCtx->sceneNum == SCENE_SECOM)) {
|
||||
currentArea = 10;
|
||||
} else {
|
||||
currentArea = globalCtx->pauseCtx.unk_238[4];
|
||||
}
|
||||
stringLimit = D_801D07C4[currentArea];
|
||||
|
||||
for (i = 0; i < stringLimit; i++) {
|
||||
msgCtx->decodedBuffer.schar[p] = D_801D0714[currentArea][i];
|
||||
currentChar = msgCtx->decodedBuffer.schar[p];
|
||||
if (currentChar != ' ') {
|
||||
Font_LoadCharNES(globalCtx, D_801D0714[currentArea][i], o);
|
||||
o += FONT_CHAR_TEX_SIZE;
|
||||
}
|
||||
currentChar = msgCtx->decodedBuffer.schar[p];
|
||||
p++;
|
||||
f += (D_801D0470[currentChar - ' '] * msgCtx->unk12098);
|
||||
}
|
||||
|
||||
p--;
|
||||
f += (stringLimit - 1) * (16.0f * msgCtx->unk12098);
|
||||
*decodedBufPos = p;
|
||||
*offset = o;
|
||||
*arg2 = f;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_nes/func_80159438.s")
|
||||
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
#include "global.h"
|
||||
#include "message_data_static.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_staff/func_8015E750.s")
|
||||
void Message_FindCreditsMessage(GlobalContext* globalCtx, u16 textId) {
|
||||
MessageContext* msgCtx = &globalCtx->msgCtx;
|
||||
Font* font = &msgCtx->font;
|
||||
MessageTableEntry* msgEntry = msgCtx->messageTableStaff;
|
||||
const char* segment = msgEntry->segment;
|
||||
const char* foundSegment;
|
||||
const char* nextSegment;
|
||||
|
||||
while (msgEntry->textId != 0xFFFF) {
|
||||
if (msgEntry->textId == textId) {
|
||||
foundSegment = msgEntry->segment;
|
||||
font->charBuf[font->unk_11D88][0] = msgEntry->typePos;
|
||||
msgEntry++;
|
||||
nextSegment = msgEntry->segment;
|
||||
font->messageStart = foundSegment - segment;
|
||||
font->messageEnd = nextSegment - foundSegment;
|
||||
return;
|
||||
}
|
||||
msgEntry++;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_staff/func_8015E7EC.s")
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ void func_80954340(BgIngate* this, GlobalContext* globalCtx) {
|
||||
void func_809543D4(BgIngate* this, GlobalContext* globalCtx) {
|
||||
u8 talkState = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
if (((talkState == 4) || (talkState == 5)) && func_80147624(globalCtx)) {
|
||||
if (((talkState == 4) || (talkState == 5)) && Message_ShouldAdvance(globalCtx)) {
|
||||
switch (this->dyna.actor.textId) {
|
||||
case 0x9E4:
|
||||
this->dyna.actor.textId = 0x9E5;
|
||||
|
||||
@@ -1566,7 +1566,7 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.msgMode != 0) &&
|
||||
(globalCtx->msgCtx.unk11F04 == 0x5E6) && !FrameAdvance_IsEnabled(&globalCtx->state) &&
|
||||
(globalCtx->msgCtx.currentTextId == 0x5E6) && !FrameAdvance_IsEnabled(&globalCtx->state) &&
|
||||
(globalCtx->sceneLoadFlag == 0) && (ActorCutscene_GetCurrentIndex() == -1) &&
|
||||
(globalCtx->csCtx.state == 0)) {
|
||||
time = gSaveContext.time;
|
||||
|
||||
@@ -356,7 +356,7 @@ void func_808B93A0(DoorWarp1* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 4 && func_80147624(globalCtx)) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 4 && Message_ShouldAdvance(globalCtx)) {
|
||||
func_801477B4(globalCtx);
|
||||
if (globalCtx->msgCtx.choiceIndex == 0) {
|
||||
func_8019F208();
|
||||
|
||||
@@ -290,7 +290,7 @@ void func_80BD3118(EnAh* this, GlobalContext* globalCtx) {
|
||||
|
||||
s32 func_80BD3198(EnAh* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
u16 temp = globalCtx->msgCtx.unk11F04;
|
||||
u16 temp = globalCtx->msgCtx.currentTextId;
|
||||
|
||||
if (player->stateFlags1 & 0x40) {
|
||||
if (this->unk_2DA != temp) {
|
||||
|
||||
@@ -1243,7 +1243,7 @@ void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) {
|
||||
u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
if (temp_v0 == 5) {
|
||||
if (func_80147624(globalCtx)) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
if (this->unk_32C & 1) {
|
||||
this->unk_32C &= ~0x1;
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
@@ -1265,7 +1265,7 @@ void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
} else if (temp_v0 == 4) {
|
||||
if (func_80147624(globalCtx)) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
this->unk_32C |= 0x8;
|
||||
@@ -1285,7 +1285,7 @@ void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80BEF18C(EnAkindonuts* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
globalCtx->msgCtx.unk12023 = 4;
|
||||
this->unk_33C = 0;
|
||||
@@ -1310,7 +1310,7 @@ void func_80BEF20C(EnAkindonuts* this, GlobalContext* globalCtx) {
|
||||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 6);
|
||||
}
|
||||
|
||||
if ((sp27 == 5) && func_80147624(globalCtx)) {
|
||||
if ((sp27 == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (this->unk_32C & 1) {
|
||||
this->unk_32C &= ~0x1;
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
@@ -1341,7 +1341,7 @@ void func_80BEF360(EnAkindonuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80BEF450(EnAkindonuts* this, GlobalContext* globalCtx) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) {
|
||||
if ((Message_GetState(&globalCtx->msgCtx) == 6) && Message_ShouldAdvance(globalCtx)) {
|
||||
func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
|
||||
this->actionFunc = func_80BEF4B8;
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ void func_80BDEFE4(EnAl* this, GlobalContext* globalCtx) {
|
||||
|
||||
s32 func_80BDF064(EnAl* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
u16 sp22 = globalCtx->msgCtx.unk11F04;
|
||||
u16 sp22 = globalCtx->msgCtx.currentTextId;
|
||||
Actor* sp1C = func_80BDE1A0(this, globalCtx, 4, 0xA4);
|
||||
Actor* temp_v0 = func_80BDE1A0(this, globalCtx, 4, 0x234);
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ void EnAni_IdleStanding(EnAni* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnAni_Talk(EnAni* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 2 && globalCtx->msgCtx.unk11F04 == 0x6DE) {
|
||||
if (Message_GetState(&globalCtx->msgCtx) == 2 && globalCtx->msgCtx.currentTextId == 0x6DE) {
|
||||
this->actionFunc = EnAni_IdleInPain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ void func_809C1D64(EnAob01* this, GlobalContext* globalCtx) {
|
||||
u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
if (temp_v0 == 4) {
|
||||
if (func_80147624(globalCtx)) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
if (gSaveContext.rupees < 10) {
|
||||
@@ -457,7 +457,7 @@ void func_809C1D64(EnAob01* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ((temp_v0 == 5) && func_80147624(globalCtx)) {
|
||||
} else if ((temp_v0 == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
globalCtx->msgCtx.unk12023 = 4;
|
||||
this->unk_210 = 0;
|
||||
@@ -561,7 +561,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) {
|
||||
this->unk_2D2 &= ~8;
|
||||
}
|
||||
} else if (sp2F == 4) {
|
||||
if (func_80147624(globalCtx)) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
@@ -577,7 +577,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
} else if (sp2F == 5) {
|
||||
if (func_80147624(globalCtx)) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
if (this->unk_2D2 & 0x10) {
|
||||
this->unk_2D2 &= ~0x10;
|
||||
@@ -588,7 +588,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) {
|
||||
func_809C16DC(this, globalCtx);
|
||||
}
|
||||
}
|
||||
} else if ((sp2F == 14) && func_80147624(globalCtx)) {
|
||||
} else if ((sp2F == 14) && Message_ShouldAdvance(globalCtx)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
this->unk_434 = globalCtx->msgCtx.bankRupeesSelected;
|
||||
func_809C16DC(this, globalCtx);
|
||||
@@ -749,7 +749,7 @@ void func_809C2A64(EnAob01* this, GlobalContext* globalCtx) {
|
||||
u8 sp2F = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
if (func_809C15BC(this)) {
|
||||
if ((sp2F == 5) && func_80147624(globalCtx)) {
|
||||
if ((sp2F == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
this->unk_434 = 0;
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
globalCtx->msgCtx.unk12023 = 4;
|
||||
@@ -778,7 +778,7 @@ void func_809C2A64(EnAob01* this, GlobalContext* globalCtx) {
|
||||
void func_809C2BE4(EnAob01* this, GlobalContext* globalCtx) {
|
||||
u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
if (((temp_v0 == 5) || (temp_v0 == 6)) && func_80147624(globalCtx)) {
|
||||
if (((temp_v0 == 5) || (temp_v0 == 6)) && Message_ShouldAdvance(globalCtx)) {
|
||||
if (gSaveContext.weekEventReg[63] & 2) {
|
||||
gSaveContext.weekEventReg[63] &= (u8)~2;
|
||||
}
|
||||
@@ -819,7 +819,7 @@ void func_809C2D0C(EnAob01* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((sp2F == 5) && func_80147624(globalCtx)) {
|
||||
if ((sp2F == 5) && Message_ShouldAdvance(globalCtx)) {
|
||||
this->unk_2D2 &= ~0x40;
|
||||
this->unk_2D2 &= ~0x80;
|
||||
if (this->unk_434 >= 150) {
|
||||
|
||||
@@ -514,7 +514,7 @@ void func_80BA9758(EnBaba* this, GlobalContext* globalCtx) {
|
||||
void func_80BA9848(EnBaba* this, GlobalContext* globalCtx) {
|
||||
u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
if (((temp_v0 == 5) || (temp_v0 == 6)) && func_80147624(globalCtx)) {
|
||||
if (((temp_v0 == 5) || (temp_v0 == 6)) && Message_ShouldAdvance(globalCtx)) {
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
globalCtx->msgCtx.unk12023 = 4;
|
||||
this->actionFunc = func_80BA9B80;
|
||||
@@ -526,7 +526,7 @@ void func_80BA98EC(EnBaba* this, GlobalContext* globalCtx) {
|
||||
u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
|
||||
|
||||
if (temp_v0 == 5) {
|
||||
if (func_80147624(globalCtx)) {
|
||||
if (Message_ShouldAdvance(globalCtx)) {
|
||||
if (this->unk_40A & 1) {
|
||||
this->unk_40A &= ~1;
|
||||
globalCtx->msgCtx.msgMode = 0x43;
|
||||
@@ -556,7 +556,7 @@ void func_80BA98EC(EnBaba* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
} else if (temp_v0 == 6) {
|
||||
if (func_80147624(globalCtx) && (globalCtx->msgCtx.unk120B1 == 0)) {
|
||||
if (Message_ShouldAdvance(globalCtx) && (globalCtx->msgCtx.unk120B1 == 0)) {
|
||||
gSaveContext.weekEventReg[81] |= 2;
|
||||
func_80BA8C4C(globalCtx, 0xD670);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user