From a20ec30b07d285476e3df67396a23f7764c10eb4 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 18 Jun 2025 10:57:24 +0200 Subject: [PATCH] start documenting textvox --- charmap.txt | 1 + include/music_util.h | 2 +- include/string_format.h | 6 + include/structs/str_3001B64.h | 66 --- include/text_2.h | 2 +- include/text_3.h | 6 +- include/textbox.h | 12 + ld_script.ld | 4 +- src/dungeon_message.c | 4 +- src/ground_main.c | 10 +- src/ground_script.c | 25 +- src/music_util.c | 2 +- src/string_format.c | 236 +++++---- src/text_2.c | 26 +- src/text_3.c | 16 +- src/{code_809A560.c => textbox.c} | 843 ++++++++++++++++-------------- sym_ewram.txt | 2 +- sym_iwram_init.txt | 2 +- 18 files changed, 640 insertions(+), 625 deletions(-) delete mode 100644 include/structs/str_3001B64.h create mode 100644 include/textbox.h rename src/{code_809A560.c => textbox.c} (68%) diff --git a/charmap.txt b/charmap.txt index 18e570513..b3ebae639 100644 --- a/charmap.txt +++ b/charmap.txt @@ -540,6 +540,7 @@ UNK_MACRO_5F_2 = 23 5F 02 2E UNK_MACRO_5F_3 = 23 5F 03 2E UNK_MACRO_5F_4 = 23 5F 04 2E UNK_MACRO_5F_5 = 23 5F 05 2E +WAIT_FRAMES = 23 7E @ #~ Next char is the number of frames to wait before printing the next character @ COLOR FORMATTING MACROS @ diff --git a/include/music_util.h b/include/music_util.h index b26301dab..24fca99fb 100644 --- a/include/music_util.h +++ b/include/music_util.h @@ -19,6 +19,6 @@ void StopSound(u16 songIndex); void FadeOutSound(u16 songIndex, u16 speed); bool8 IsSoundPlaying(u16 songIndex); void PlayMenuSoundEffect(u32 arrId); -void sub_8011A04(void); +void PlayDialogueTextSound(void); #endif // GUARD_MUSIC_UTIL_H diff --git a/include/string_format.h b/include/string_format.h index 0a5e1770c..220d6a3ce 100644 --- a/include/string_format.h +++ b/include/string_format.h @@ -30,4 +30,10 @@ const u8 *FormatString(const u8 *str, u8 *dst, u8 *dstMax, u16 flags); void PrintFormattedStringOnWindow(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr); void PrintFormattedStringOnWindow2(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr, s32 lineSpacing); +#define STR_FORMAT_FLAG_DIALOGUE_SOUND 0x4 +#define STR_FORMAT_FLAG_SPEAKER_NAME 0x8 +#define STR_FORMAT_FLAG_INSTANT_TEXT 0x20 +#define STR_FORMAT_FLAG_INSTANT_TEXT_ON_AB_PRESS 0x40 +#define STR_FORMAT_FLAG_NEW_LINE_TERMINATES 0x80 + #endif // GUARD_STRING_FORMAT_H diff --git a/include/structs/str_3001B64.h b/include/structs/str_3001B64.h deleted file mode 100644 index 62de2c874..000000000 --- a/include/structs/str_3001B64.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef GUARD_STR_3001B64_H -#define GUARD_STR_3001B64_H - -#include "structs/menu.h" -#include "structs/str_file_system.h" -#include "structs/str_mon_portrait.h" - -// Maybe Position32? -struct unkStruct_3001B64_sub_sub -{ - s32 a0; - s32 a4; -}; - -struct unkStruct_3001B64_sub -{ - // size: 0x24 - s16 unk0; - /* 0x2 */ s16 speciesID; - u8 unk4; - u8 unk5; - s8 unk6; - u8 unk7; - struct unkStruct_3001B64_sub_sub unk8; - MonPortraitMsg monPortrait; - /* 0x20 */ OpenedFile *faceFile; -}; - -struct unkStruct_3001B64_unkC -{ - u16 unk0; - u32 unk4; - u8 buffer[0x400]; -}; - -struct unkStruct_3001B64_unk418 -{ - u16 unk0; - u8 (*unk4)(void); - void (*unk8)(void); - u32 (*unkC)(void); -}; - -struct unkStruct_3001B64 -{ - // size: 0x5A8 - u32 unk0; - u32 unk4; - u32 unk8; - struct unkStruct_3001B64_unkC unkC; - u32 unk414; - const struct unkStruct_3001B64_unk418 *unk418; - const MenuItem *unk41C; - u32 unk420; - u32 unk424; - u32 unk428; - u8 *unk42C; - s32 unk430; - s32 unk434; - u32 fill438; - struct unkStruct_3001B64_sub unk43C[10]; - s16 unk5A4; -}; - -#endif // GUARD_STR_3001B61_H - diff --git a/include/text_2.h b/include/text_2.h index fa3f509fc..942664179 100644 --- a/include/text_2.h +++ b/include/text_2.h @@ -19,6 +19,6 @@ void sub_80089AC(const WindowTemplate *r4, DungeonPos *r5_Str); u32 DrawCharOnWindow(s32 x, s32 y, u32 chr, u32 color, u32 windowId); bool8 xxx_call_update_bg_vram(void); u32 DrawCharOnWindowInternal(Window *windows, s32 x, s32 y, u32 chr, u32 color, u32 windowId); -const u8 *xxx_get_next_char_from_string(const u8 *a1, u32 *dstChr); +const u8 *GetNextCharFromStr(const u8 *str, u32 *dstChr); #endif // GUARD_TEXT_2_H diff --git a/include/text_3.h b/include/text_3.h index 4106ff585..9f4d39351 100644 --- a/include/text_3.h +++ b/include/text_3.h @@ -21,8 +21,8 @@ typedef struct UnkDrawStringStruct u8 fill23; const u8 * (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct *); s32 unk28; - s32 unk2C; - s32 unk30; + s32 framesToWait; + s32 currFrames; } UnkDrawStringStruct; void PrintStringOnWindow(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr); @@ -36,6 +36,6 @@ void sub_8009524(s32 windowId); void sub_80095CC(s32 a0, s32 a1); s32 CalcEntriesTotalHeight(s32 entriesCount, s32 entryHeight); s32 CalcTwoLinesEntriesTotalHeight(s32 entriesCount, s32 entryHeight); -const u8 *xxx_handle_format_global(const u8 *str, UnkDrawStringStruct *unkStrPtr); +const u8 *HandleSpecialCharFormat(const u8 *str, UnkDrawStringStruct *unkStrPtr); #endif // GUARD_TEXT_3_H diff --git a/include/textbox.h b/include/textbox.h new file mode 100644 index 000000000..74883f0ac --- /dev/null +++ b/include/textbox.h @@ -0,0 +1,12 @@ +#ifndef GUARD_TEXTBOX_H +#define GUARD_TEXTBOX_H + +void TextboxInit(void); +void TextboxFree(void); + +bool8 ScriptClearTextbox(void); +bool8 ScriptClearTextbox2(void); +void ResetTextboxPortrait(s16 id_); +bool8 ScriptPrintText(s32 scriptMsgType, s32 speakerId_, const char *text); + +#endif // GUARD_WONDER_MAIL_H diff --git a/ld_script.ld b/ld_script.ld index 5c7257704..89e92ac9d 100755 --- a/ld_script.ld +++ b/ld_script.ld @@ -336,7 +336,7 @@ SECTIONS { src/debug_field_map.o(.text); src/code_8099360.o(.text); src/palette_util.o(.text); - src/code_809A560.o(.text); + src/textbox.o(.text); src/unk_ds_only_feature.o(.text); src/script_item.o(.text); src/ground_lives_helper.o(.text); @@ -720,7 +720,7 @@ SECTIONS { src/debug_field_map.o(.rodata); src/code_8099360.o(.rodata); src/palette_util.o(.rodata); - src/code_809A560.o(.rodata); + src/textbox.o(.rodata); src/unk_ds_only_feature.o(.rodata); src/script_item.o(.rodata); src/ground_lives_helper.o(.rodata); diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 708b1e11a..b799c9050 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -242,10 +242,10 @@ void xxx_draw_string_80524F0(void) } while (1) { - txtPtr = xxx_handle_format_global(txtPtr, &sp); + txtPtr = HandleSpecialCharFormat(txtPtr, &sp); if (*txtPtr == '\0' || *txtPtr == '\r' || *txtPtr == '\n') break; - txtPtr = xxx_get_next_char_from_string(txtPtr, &currChr); + txtPtr = GetNextCharFromStr(txtPtr, &currChr); if (currChr == '`') { sp.x += 6; } diff --git a/src/ground_main.c b/src/ground_main.c index 0861bd24b..b94e21bd9 100644 --- a/src/ground_main.c +++ b/src/ground_main.c @@ -21,6 +21,7 @@ #include "ground_lives_helper.h" #include "script_item.h" #include "unk_ds_only_feature.h" +#include "textbox.h" EWRAM_DATA u32 gUnknown_20398A8 = {0}; EWRAM_DATA s32 gUnknown_20398AC = {0}; @@ -73,7 +74,6 @@ extern void FreeGroundLives(void); extern void FreeGroundObjects(void); extern void FreeGroundEffects(void); extern void FreeGroundEvents(void); -extern void sub_809A610(void); extern void sub_80A658C(void); extern void sub_809D508(void); extern void sub_80A7754(void); @@ -86,7 +86,6 @@ extern void sub_809D0AC(void); extern void sub_80A7744(void); extern void sub_809D490(void); extern void sub_80A62F0(void); -extern void sub_809A560(void); extern void AllocGroundMapAction(void); extern void AllocGroundEvents(void); extern void AllocGroundLives(void); @@ -123,7 +122,6 @@ extern void UpdateAdventureAchievements(void); extern void xxx_call_update_bg_sound_input(void); extern void sub_80A6E68(void); extern void sub_80060EC(void); -extern void ScriptPrintNullTextbox(void); extern void sub_809977C(void); extern void GroundMap_ExecuteEvent(s32, u32); extern void UpdateFadeInTile(s32); @@ -188,7 +186,7 @@ u32 xxx_script_related_8098468(s32 param_1) sub_809D490(); sub_80A62F0(); sub_809C5C4(); - sub_809A560(); + TextboxInit(); InitInternalScriptItemsData(); AllocGroundMapAction(); nullsub_117(); @@ -209,7 +207,7 @@ u32 xxx_script_related_8098468(s32 param_1) r7 = -1; while (gUnknown_20398A8 - 1 <= 1) { sub_809A71C(-1); - ScriptPrintNullTextbox(); + ScriptClearTextbox(); sub_809977C(); switch (gUnknown_20398B4) { case 0: @@ -383,7 +381,7 @@ u32 xxx_script_related_8098468(s32 param_1) FreeGroundEffects(); FreeGroundEvents(); FreeInternalScriptItemsData(); - sub_809A610(); + TextboxFree(); sub_809C618(); sub_80A658C(); sub_809D508(); diff --git a/src/ground_script.c b/src/ground_script.c index 33cf56af2..21167ec51 100644 --- a/src/ground_script.c +++ b/src/ground_script.c @@ -49,6 +49,7 @@ #include "structs/str_dungeon_setup.h" #include "ground_map_conversion_table.h" #include "unk_ds_only_feature.h" +#include "textbox.h" void GroundMap_Select(s16); void GroundMap_SelectDungeon(s32, DungeonLocation*, u32); @@ -84,12 +85,8 @@ u32 sub_809A6E4(); u32 sub_809A6F8(); u32 sub_809A738(); u32 sub_809A768(); -bool8 ScriptPrintNullTextbox(void); -bool8 ScriptPrintEmptyTextbox(void); -void sub_809A83C(s16); u32 sub_809AC7C(); u32 sub_809ADD8(); -bool8 ScriptPrintText(s32, s16, const char*); bool8 sub_809AEEC(const char*); bool8 sub_809AF2C(const char*); bool8 sub_809AF6C(s16, const char*); @@ -1134,13 +1131,13 @@ s16 HandleAction(Action *action, DebugLocation *debug) if (val != 0) { action->scriptData.branchDiscriminant = 3; sub_80A87AC(0, 0); - ScriptPrintNullTextbox(); + ScriptClearTextbox(); break; } else { action->scriptData.branchDiscriminant = -1; sub_80A87AC(0, 0); - ScriptPrintNullTextbox(); + ScriptClearTextbox(); break; } } @@ -1161,7 +1158,7 @@ s16 HandleAction(Action *action, DebugLocation *debug) } action->scriptData.branchDiscriminant = -1; sub_80A87AC(0, 0); - ScriptPrintNullTextbox(); + ScriptClearTextbox(); break; } @@ -1858,17 +1855,17 @@ s32 ExecuteScriptCommand(Action *action) break; } case 0x30: { - ScriptPrintNullTextbox(); + ScriptClearTextbox(); break; } case 0x31: { - ScriptPrintEmptyTextbox(); + ScriptClearTextbox2(); break; } case 0x2d: { switch ((u8)curCmd.argByte) { case 0: { - sub_809A83C(curCmd.argShort); + ResetTextboxPortrait(curCmd.argShort); break; } case 1: { @@ -1944,10 +1941,10 @@ s32 ExecuteScriptCommand(Action *action) break; } case 0x2f: { - s32 unk[2]; - unk[0] = curCmd.arg1; - unk[1] = curCmd.arg2; - sub_809ADD8(curCmd.argShort, unk); + PixelPos pos; + pos.x = curCmd.arg1; + pos.y = curCmd.arg2; + sub_809ADD8(curCmd.argShort, &pos); break; } case 0x32 ... 0x38: { diff --git a/src/music_util.c b/src/music_util.c index 757be00d5..8b602895b 100644 --- a/src/music_util.c +++ b/src/music_util.c @@ -129,7 +129,7 @@ void PlayMenuSoundEffect(u32 arrId) sSoundEffectCounter1 = 4; } -void sub_8011A04(void) +void PlayDialogueTextSound(void) { if (sSoundEffectCounter2 > 0) return; diff --git a/src/string_format.c b/src/string_format.c index 4a510fa1b..51e391adb 100644 --- a/src/string_format.c +++ b/src/string_format.c @@ -86,16 +86,16 @@ static EWRAM_DATA u8 sFormatBuffer_TeamName[FORMAT_BUFFER_LEN] = {0}; static EWRAM_DATA s32 gUnknown_202E738 = 0; static EWRAM_DATA s32 gUnknown_202E73C = 0; static EWRAM_DATA s32 gUnknown_202E740 = 0; -static EWRAM_DATA s32 gUnknown_202E744 = 0; -static EWRAM_DATA UnkDrawStringStruct gUnknown_202E748 = {0}; -static EWRAM_DATA u16 sUnknownTextFlags = 0; +static EWRAM_DATA s32 sPrintStringState = 0; +static EWRAM_DATA UnkDrawStringStruct sTextPrintStruct = {0}; +static EWRAM_DATA u16 sStringFormatFlags = 0; static EWRAM_DATA s32 gUnknown_202E780 = 0; static EWRAM_DATA s32 gUnknown_202E784 = 0; -static EWRAM_DATA s32 gUnknown_202E788 = 0; -static EWRAM_DATA s32 gUnknown_202E78C = 0; -static EWRAM_DATA bool8 gUnknown_202E790 = FALSE; +static EWRAM_DATA s32 sTextPrintSpeed = 0; +static EWRAM_DATA s32 sFramesBetweenCharPrints = 0; +static EWRAM_DATA bool8 sInstantText = FALSE; static EWRAM_DATA u8 sArrowFrames = 0; -static EWRAM_DATA const u8 *gUnknown_202E794 = NULL; +static EWRAM_DATA const u8 *sCurrStr = NULL; #define DIALOGUE_TEXT_BUFFER_SIZE 1000 static EWRAM_DATA u8 sDialogueTextBuffer[DIALOGUE_TEXT_BUFFER_SIZE] = {0}; @@ -146,7 +146,7 @@ static EWRAM_INIT WindowTemplates sUnknown_203B198 = { void sub_8014144(void) { - gUnknown_202E744 = 0; + sPrintStringState = 0; gUnknown_202E738 = 60; gUnknown_202E73C = 60; gUnknown_202E740 = 0; @@ -180,14 +180,21 @@ void CreateYesNoDialogueBoxAndPortrait_DefaultNo(const u8 *text, MonPortraitMsg CreateMenuDialogueBoxAndPortrait(text, NULL, -1, sYesNoMenuItems_DefaultNo, NULL, 3, 0, monPortraitPtr, flags | 0x300); } +enum +{ + STATE_FINISHED, + STATE_PRINT_CHAR, + STATE_PRINT_CHAR_SOUND_WAIT, +}; + // arm9.bin::0201D700 void CreateMenuDialogueBoxAndPortrait(const u8 *text, void *a1, u32 r9, const MenuItem *menuItems, void *arg_0, u32 a5, u32 unknownUnused, MonPortraitMsg *monPortraitPtr, u16 flags) { bool8 portraitOn = FALSE; FormatString(text, sDialogueTextBuffer, sDialogueTextBuffer + DIALOGUE_TEXT_BUFFER_SIZE - 1, flags); - gUnknown_202E794 = sDialogueTextBuffer; - gUnknown_202E748.unk24 = a1; + sCurrStr = sDialogueTextBuffer; + sTextPrintStruct.unk24 = a1; gUnknown_202EC10 = a5; sDialogueMenuItems = menuItems; gUnknown_202EC18 = arg_0; @@ -229,28 +236,28 @@ void CreateMenuDialogueBoxAndPortrait(const u8 *text, void *a1, u32 r9, const Me sUnknown_203B198.id[3] = gUnknown_80D48AC; ResetUnusedInputStruct(); ShowWindows(&sUnknown_203B198, TRUE, TRUE); - gUnknown_202E748.x = 4; - gUnknown_202E748.unk2 = 4; - gUnknown_202E748.unk8 = 0x70; - gUnknown_202E748.unkA = (gWindows[0].y * 8) + 34; - gUnknown_202E748.unk10 = 7; - gUnknown_202E748.unk1C = 0; - gUnknown_202E748.unk20 = 0; + sTextPrintStruct.x = 4; + sTextPrintStruct.unk2 = 4; + sTextPrintStruct.unk8 = 0x70; + sTextPrintStruct.unkA = (gWindows[0].y * 8) + 34; + sTextPrintStruct.unk10 = 7; + sTextPrintStruct.unk1C = 0; + sTextPrintStruct.unk20 = 0; SetCharacterMask((flags & 0x10) ? 8 : 3); - gUnknown_202E744 = 1; - sUnknownTextFlags = flags; - if (flags & 0x20) { - gUnknown_202E790 = TRUE; + sPrintStringState = 1; + sStringFormatFlags = flags; + if (flags & STR_FORMAT_FLAG_INSTANT_TEXT) { + sInstantText = TRUE; } else { - gUnknown_202E790 = FALSE; + sInstantText = FALSE; } if (flags & 0x400) { SetWindowBGColor(); } - gUnknown_202E788 = 1; - gUnknown_202E78C = 1; + sTextPrintSpeed = 1; + sFramesBetweenCharPrints = 1; UnpressButtons(); sArrowFrames = 0; gUnknown_202E784 = 0; @@ -270,7 +277,7 @@ void CreateMenuDialogueBoxAndPortrait(const u8 *text, void *a1, u32 r9, const Me void sub_8014490(void) { - gUnknown_202E744 = 0; + sPrintStringState = STATE_FINISHED; gUnknown_202EC1C = 0; } @@ -279,7 +286,7 @@ s32 sub_80144A4(s32 *a0) if (a0 != NULL) { *a0 = gUnknown_202EC1C; } - return gUnknown_202E744; + return sPrintStringState; } // arm9.bin::0201CEB0 @@ -289,35 +296,35 @@ void DrawDialogueBoxString(void) gUnknown_202E784++; while (keepLooping) { - switch (gUnknown_202E744) { - case 0: { + switch (sPrintStringState) { + case STATE_FINISHED: { keepLooping = FALSE; } break; - case 1: { - const u8 *str = gUnknown_202E794; - s32 r7; + case STATE_PRINT_CHAR: { + const u8 *str = sCurrStr; + s32 txtSpeed; - if (gUnknown_202E790) { - r7 = 99999; + if (sInstantText) { + txtSpeed = 99999; } else { - r7 = gUnknown_202E788; + txtSpeed = sTextPrintSpeed; } - gUnknown_202E748.unk2C = 0; + sTextPrintStruct.framesToWait = 0; sub_80073B8(0); - while (r7 > 0) { - str = xxx_handle_format_global(str, &gUnknown_202E748); - if (gUnknown_202E748.unk21 != 0) { + while (txtSpeed > 0) { + str = HandleSpecialCharFormat(str, &sTextPrintStruct); + if (sTextPrintStruct.unk21 != 0) { break; } - if (gUnknown_202E748.unk20 != 0) { - if (gUnknown_202E748.unk2 > 34) { - gUnknown_202E744 = 8; + if (sTextPrintStruct.unk20 != 0) { + if (sTextPrintStruct.unk2 > 34) { + sPrintStringState = 8; gUnknown_202E780 = gUnknown_202E738; } else { - gUnknown_202E744 = 7; + sPrintStringState = 7; gUnknown_202E780 = gUnknown_202E73C; } sArrowFrames = 0; @@ -328,75 +335,75 @@ void DrawDialogueBoxString(void) } if (*str == '\r' || *str == '\n') { - gUnknown_202E748.x = 4; - gUnknown_202E748.unk2 += 11; + sTextPrintStruct.x = 4; + sTextPrintStruct.unk2 += 11; str++; } else { u32 chr; - str = xxx_get_next_char_from_string(str, &chr); - gUnknown_202E748.x += DrawCharOnWindow(gUnknown_202E748.x, gUnknown_202E748.unk2, chr, gUnknown_202E748.unk10, 0); - gUnknown_202E748.unk2C = gUnknown_202E78C; + str = GetNextCharFromStr(str, &chr); + sTextPrintStruct.x += DrawCharOnWindow(sTextPrintStruct.x, sTextPrintStruct.unk2, chr, sTextPrintStruct.unk10, 0); + sTextPrintStruct.framesToWait = sFramesBetweenCharPrints; } - if (gUnknown_202E748.unk2 > 34) { - if (!(sUnknownTextFlags & 0x10)) { - gUnknown_202E748.unk1C = 0; - gUnknown_202E748.unk20 = 1; - gUnknown_202E744 = 8; + if (sTextPrintStruct.unk2 > 34) { + if (!(sStringFormatFlags & 0x10)) { + sTextPrintStruct.unk1C = 0; + sTextPrintStruct.unk20 = 1; + sPrintStringState = 8; sArrowFrames = 0; gUnknown_202E780 = gUnknown_202E738; break; } else { - gUnknown_202E748.unk2 = 4; + sTextPrintStruct.unk2 = 4; } } - r7--; + txtSpeed--; } sub_80073E0(0); - gUnknown_202E794 = str; + sCurrStr = str; ResetTouchScreenMenuInput(&sDialogueMenuTouchScreenInput); - if (gUnknown_202E794[0] == '\0') { + if (*sCurrStr == '\0') { if (sDialogueMenuItems != NULL) { - gUnknown_202E744 = 3; + sPrintStringState = 3; } else { - gUnknown_202E744 = 6; + sPrintStringState = 6; } keepLooping = FALSE; } else { - gUnknown_202E748.unk30 = 0; - if (gUnknown_202E748.unk20 != 0) { - if (gUnknown_202E744 == 1) { - gUnknown_202E744 = 7; + sTextPrintStruct.currFrames = 0; + if (sTextPrintStruct.unk20 != 0) { + if (sPrintStringState == 1) { + sPrintStringState = 7; sArrowFrames = 0; gUnknown_202E780 = gUnknown_202E738; } keepLooping = FALSE; } else { - gUnknown_202E744 = 2; + sPrintStringState = STATE_PRINT_CHAR_SOUND_WAIT; } } } break; - case 2: { - if (sUnknownTextFlags & 4) { - sub_8011A04(); + case STATE_PRINT_CHAR_SOUND_WAIT: { + if (sStringFormatFlags & STR_FORMAT_FLAG_DIALOGUE_SOUND) { + PlayDialogueTextSound(); } - if (!(sUnknownTextFlags & 2)) { - if (sUnknownTextFlags & 0x40 && gRealInputs.pressed & AB_BUTTONS) { - gUnknown_202E790 = TRUE; - gUnknown_202E748.unk30 = 99999; + if (!(sStringFormatFlags & 2)) { + if (sStringFormatFlags & STR_FORMAT_FLAG_INSTANT_TEXT_ON_AB_PRESS && gRealInputs.pressed & AB_BUTTONS) { + sInstantText = TRUE; + sTextPrintStruct.currFrames = 99999; } } - if (++gUnknown_202E748.unk30 > gUnknown_202E748.unk2C) { - gUnknown_202E744 = 1; - gUnknown_202E748.unk21 = 0; + if (++sTextPrintStruct.currFrames > sTextPrintStruct.framesToWait) { + sPrintStringState = STATE_PRINT_CHAR; + sTextPrintStruct.unk21 = 0; } else { keepLooping = FALSE; @@ -404,13 +411,13 @@ void DrawDialogueBoxString(void) } break; case 6: { - if (sUnknownTextFlags & 0x100) { - gUnknown_202E744 = 9; + if (sStringFormatFlags & 0x100) { + sPrintStringState = 9; sArrowFrames = 0; if (gUnknown_202E740 > 0) { gUnknown_202E780 = gUnknown_202E740 - gUnknown_202E784; if (gUnknown_202E780 < 0) { - gUnknown_202E744 = 11; + sPrintStringState = 11; gUnknown_202E780 = 0; } } @@ -419,7 +426,7 @@ void DrawDialogueBoxString(void) } } else { - gUnknown_202E744 = 11; + sPrintStringState = 11; } } break; @@ -427,13 +434,13 @@ void DrawDialogueBoxString(void) case 8: case 9: { bool8 buttonPress = FALSE; - gUnknown_202E748.unk20 = 0; + sTextPrintStruct.unk20 = 0; GetTouchScreenMenuInput(&sDialogueMenuTouchScreenInput, 0); - if (!(sUnknownTextFlags & 1)) { + if (!(sStringFormatFlags & 1)) { buttonPress = TRUE; } else { - if (sUnknownTextFlags & 2) { + if (sStringFormatFlags & 2) { if (gUnknown_202E780 > 0) { gUnknown_202E780--; } @@ -454,7 +461,7 @@ void DrawDialogueBoxString(void) if (!buttonPress) { sArrowFrames++; - if (!(sUnknownTextFlags & 0x2) && sArrowFrames & 8) { + if (!(sStringFormatFlags & 0x2) && sArrowFrames & 8) { SpriteSetAffine1(&sDialogueBoxArrowSprite, 0); SpriteSetAffine2(&sDialogueBoxArrowSprite, 0); SpriteSetObjMode(&sDialogueBoxArrowSprite, 0); @@ -467,93 +474,93 @@ void DrawDialogueBoxString(void) SpriteSetPriority(&sDialogueBoxArrowSprite, 0); SpriteSetPalNum(&sDialogueBoxArrowSprite, 15); - if (sUnknownTextFlags & 0x10) { + if (sStringFormatFlags & 0x10) { SpriteSetY(&sDialogueBoxArrowSprite, 120); SpriteSetX(&sDialogueBoxArrowSprite, 112); } else { - SpriteSetY(&sDialogueBoxArrowSprite, gUnknown_202E748.unkA + 1); - SpriteSetX(&sDialogueBoxArrowSprite, gUnknown_202E748.unk8); + SpriteSetY(&sDialogueBoxArrowSprite, sTextPrintStruct.unkA + 1); + SpriteSetX(&sDialogueBoxArrowSprite, sTextPrintStruct.unk8); } AddSprite(&sDialogueBoxArrowSprite, 0x100, NULL, NULL); } } else { - if (*gUnknown_202E794 == '\0') { - gUnknown_202E744 = 11; + if (*sCurrStr == '\0') { + sPrintStringState = 11; } - else if (gUnknown_202E744 == 9) { - gUnknown_202E744 = 11; + else if (sPrintStringState == 9) { + sPrintStringState = 11; } - else if (gUnknown_202E744 == 8) { - gUnknown_202E748.x = 4; - if (gUnknown_202E748.unk2 > 34) { - gUnknown_202E748.unk2 = 4; - if (sUnknownTextFlags & 0x10) { + else if (sPrintStringState == 8) { + sTextPrintStruct.x = 4; + if (sTextPrintStruct.unk2 > 34) { + sTextPrintStruct.unk2 = 4; + if (sStringFormatFlags & 0x10) { CallPrepareTextbox_8008C54(0); - gUnknown_202E744 = 1; + sPrintStringState = 1; } - else if (gUnknown_202E748.unk1C != 0) { + else if (sTextPrintStruct.unk1C != 0) { CallPrepareTextbox_8008C54(0); - gUnknown_202E744 = 1; + sPrintStringState = 1; } else { - gUnknown_202E744 = 10; - gUnknown_202E748.unk28 = 0; + sPrintStringState = 10; + sTextPrintStruct.unk28 = 0; } } else { - gUnknown_202E744 = 1; + sPrintStringState = 1; } } else { - gUnknown_202E744 = 1; + sPrintStringState = 1; } - gUnknown_202E748.unk8 = 0x70; - gUnknown_202E748.unkA = (gWindows[0].y * 8) + 34; + sTextPrintStruct.unk8 = 0x70; + sTextPrintStruct.unkA = (gWindows[0].y * 8) + 34; } keepLooping = FALSE; } break; case 10: { - gUnknown_202E748.unk28++; + sTextPrintStruct.unk28++; gIwramTextFunc3(0); - if (gUnknown_202E748.unk28 > 17) { - gUnknown_202E744 = 1; + if (sTextPrintStruct.unk28 > 17) { + sPrintStringState = 1; } keepLooping = FALSE; } break; case 11: { - if (sUnknownTextFlags & 0x200) { + if (sStringFormatFlags & 0x200) { ResetUnusedInputStruct(); ShowWindows(NULL, TRUE, TRUE); - gUnknown_202E744 = 0; + sPrintStringState = 0; } else { - gUnknown_202E744 = 0; + sPrintStringState = 0; } keepLooping = FALSE; } break; case 3: { sub_8014A88(); - gUnknown_202E744 = 4; + sPrintStringState = 4; keepLooping = FALSE; } break; case 4: { if (sub_8014B94()) { - gUnknown_202E744 = 5; + sPrintStringState = 5; } keepLooping = FALSE; } break; case 5: { nullsub_35(); - gUnknown_202E744 = 11; + sPrintStringState = 11; } break; } @@ -639,7 +646,7 @@ const u8 *FormatString(const u8 *str, u8 *dst, u8 *dstMax, u16 flags) if (currChar == '\0') break; if (currChar == '\r' || currChar == '\n') { - if (flags & 0x80) + if (flags & STR_FORMAT_FLAG_NEW_LINE_TERMINATES) break; r9 = TRUE; } @@ -647,7 +654,7 @@ const u8 *FormatString(const u8 *str, u8 *dst, u8 *dstMax, u16 flags) if (r10) { r10 = FALSE; r9 = FALSE; - if (flags & 8) { + if (flags & STR_FORMAT_FLAG_SPEAKER_NAME) { AppendString(gSpeakerNameBuffer, &dst, dstMax, flags); AppendString(": ", &dst, dstMax, flags); } @@ -760,7 +767,6 @@ const u8 *FormatString(const u8 *str, u8 *dst, u8 *dstMax, u16 flags) } if (txtPtr != NULL) { - if (AppendString(txtPtr, &dst, dstMax, flags)) break; } @@ -796,7 +802,7 @@ static bool8 AppendString(const u8 *str, u8 **dstPtr, u8 *dstMax, u16 flags) { u8 *dst = *dstPtr; while (*str != '\0') { - if (flags & 0x80 && *str == '\r') { + if (flags & STR_FORMAT_FLAG_NEW_LINE_TERMINATES && *str == '\r') { *dstPtr = dst; return TRUE; } diff --git a/src/text_2.c b/src/text_2.c index 65ed8e441..d68c8f04f 100644 --- a/src/text_2.c +++ b/src/text_2.c @@ -855,30 +855,30 @@ static s32 HexDigitValue(u8 chr) } // In NDS, this func is copied to 01FF8D80 -const u8 *xxx_get_next_char_from_string(const u8 *a1, u32 *dstChr) +const u8 *GetNextCharFromStr(const u8 *str, u32 *dstChr) { - s32 currChr = *a1; - if (currChr == 0x7E) { + s32 currChr = *str; + if (currChr == '~') { s32 hexDigit; - a1++; - hexDigit = (HexDigitValue(a1[0]) << 4) + HexDigitValue(a1[1]); - if (*a1 != '\0') { - a1++; - if (*a1 != '\0') { - a1++; + str++; + hexDigit = (HexDigitValue(str[0]) << 4) + HexDigitValue(str[1]); + if (*str != '\0') { + str++; + if (*str != '\0') { + str++; } } *dstChr = hexDigit; - return a1; + return str; } else if ((currChr >= 0x81 && currChr <= 0x84) || currChr == 0x87) { - *dstChr = a1[1] | (a1[0] << 8); - return a1 + 2; + *dstChr = str[1] | (str[0] << 8); + return str + 2; } else { *dstChr = currChr; - return a1 + 1; + return str + 1; } } diff --git a/src/text_3.c b/src/text_3.c index 0d3668bdd..12de1f996 100644 --- a/src/text_3.c +++ b/src/text_3.c @@ -3,7 +3,7 @@ #include "text_2.h" #include "text_3.h" -static const u8 *HandleTextFormat(Window *windows, const u8 *str, UnkDrawStringStruct *sp); +static const u8 *HandleCharFormatInternal(Window *windows, const u8 *str, UnkDrawStringStruct *sp); static s32 InterpretColorChar(u8 a0); static const u8 *sub_800915C(s16 *a0, const u8 *str); static void DrawStringInternal(Window *windows, s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr, s32 characterSpacing, s32 lineSpacing); @@ -90,7 +90,7 @@ s32 GetStringLineWidth(const u8 *str) const u8 *strPtr; u32 chr; - strPtr = xxx_get_next_char_from_string(str, &chr); + strPtr = GetNextCharFromStr(str, &chr); str = strPtr; if (chr == '\0') break; @@ -178,8 +178,8 @@ static void DrawStringInternal(Window *windows, s32 x, s32 y, const u8 *str, u32 sp.unkC = x; sp.unk10 = 7; while (TRUE) { - str = HandleTextFormat(windows, str, &sp); - str = xxx_get_next_char_from_string(str, &currChr); + str = HandleCharFormatInternal(windows, str, &sp); + str = GetNextCharFromStr(str, &currChr); if (currChr == '\0' || currChr == terminatingChr) break; @@ -245,9 +245,9 @@ static const u8 *sub_800915C(s16 *a0, const u8 *str) } // arm9.bin::02003844 -const u8 *xxx_handle_format_global(const u8 *str, UnkDrawStringStruct *unkStrPtr) +const u8 *HandleSpecialCharFormat(const u8 *str, UnkDrawStringStruct *unkStrPtr) { - return HandleTextFormat(gWindows, str, unkStrPtr); + return HandleCharFormatInternal(gWindows, str, unkStrPtr); } #if (GAME_VERSION == VERSION_RED) @@ -258,7 +258,7 @@ UNUSED static s32 sub_80091A8(s32 a0) #endif // arm9.bin::02003514 -static const u8 *HandleTextFormat(Window *windows, const u8 *str, UnkDrawStringStruct *sp) +static const u8 *HandleCharFormatInternal(Window *windows, const u8 *str, UnkDrawStringStruct *sp) { while (TRUE) { if (str[0] == '#') { @@ -370,7 +370,7 @@ static const u8 *HandleTextFormat(Window *windows, const u8 *str, UnkDrawStringS break; } else if (str[1] == '~') { - sp->unk2C = str[2]; + sp->framesToWait = str[2]; sp->unk21 = 1; str += 3; } diff --git a/src/code_809A560.c b/src/textbox.c similarity index 68% rename from src/code_809A560.c rename to src/textbox.c index 56f3eab14..76e8e8149 100644 --- a/src/code_809A560.c +++ b/src/textbox.c @@ -1,7 +1,7 @@ #include "global.h" #include "globaldata.h" +#include "textbox.h" #include "constants/dungeon.h" -#include "structs/str_3001B64.h" #include "code_800558C.h" #include "code_800D090.h" #include "music_util.h" @@ -34,13 +34,66 @@ #include "wonder_mail.h" #include "naming_screen.h" #include "script_item.h" +#include "structs/menu.h" +#include "structs/str_file_system.h" +#include "structs/str_mon_portrait.h" -static IWRAM_INIT struct unkStruct_3001B64 *gUnknown_3001B64 = { NULL }; +struct TextboxPortrait +{ + // size: 0x24 + s16 unk0; + /* 0x2 */ s16 speciesID; + u8 unk4; + u8 unk5; + s8 unk6; + u8 unk7; + PixelPos unk8; + MonPortraitMsg monPortrait; + /* 0x20 */ OpenedFile *faceFile; +}; + +struct TextboxText +{ + u16 flags; + u32 unk4; + u8 buffer[0x400]; +}; + +struct unkStruct_3001B64_unk418 +{ + u16 unk0; + u8 (*unk4)(void); + void (*unk8)(void); + u32 (*unkC)(void); +}; + +#define MAX_TEXTBOX_PORTRAITS 10 + +struct Textbox +{ + // size: 0x5A8 + u32 unk0; + u32 unk4; + u32 unk8; + struct TextboxText unkC; + u32 unk414; + const struct unkStruct_3001B64_unk418 *unk418; + const MenuItem *unk41C; + u32 unk420; + u32 unk424; + u32 unk428; + u8 *unk42C; + s32 unk430; + s32 unk434; + u32 fill438; + struct TextboxPortrait portraits[MAX_TEXTBOX_PORTRAITS]; + s16 unk5A4; +}; + +static IWRAM_INIT struct Textbox *sTextbox = { NULL }; extern bool8 sub_802FCF0(void); -u8 ScriptPrintText_809B2B8(struct unkStruct_3001B64_unkC *, s32, s32, const char *); -bool8 IsTextboxOpen_809B40C(struct unkStruct_3001B64_unkC *); -extern void ResetTextbox_809B294(void); +bool8 IsTextboxOpen_809B40C(struct TextboxText *); extern s32 sub_803B168(void); extern void sub_803B1BC(void); @@ -51,10 +104,7 @@ struct unkStruct_8096AF8 /* 0x4 */ s16 targetSpecies; }; -u32 xxx_script_textboxes_809A680(u32 param_1, u32 param_2); void sub_809A62C(void); -void sub_809A7EC(void); -void sub_809A83C(s16 index); extern void sub_80A8EC0(u8 *, u32); Pokemon *sub_808D3BC(void); Pokemon *sub_808D3F8(void); @@ -79,9 +129,7 @@ void MakuhitaDojo_Delete(); u32 HandleMakuhitaDojoState(); s16 sub_802FED0(); u8 sub_801FB50(); -void NamingScreen_Free(); s32 sub_80160D8(); -void ResetTextbox_809B294(); s32 sub_801A8AC(); void sub_801A928(); s32 sub_8016080(); @@ -132,7 +180,6 @@ void sub_8011C28(); u8 CreateHelperPelipperMenu(); u8 CreateWigglytuffShop(); u8 sub_8099328(); -void GetScriptVarScenario(s32 varId,u32 *outMain,u32 *outSub); u32 sub_802E90C(); void sub_802E918(); u32 sub_80282DC(u8 *r0); @@ -166,6 +213,10 @@ void sub_809C414(void); void sub_809C4B0(void); void sub_809C550(void); +#define TEXTBOX_FLAG_INTANT_TEXT 0x20 +#define TEXTBOX_FLAG_SPEAKER 0x100 // Speaker's name + dialogue sound +#define TEXTBOX_FLAG_DIALOGUE_SOUND 0x200 // Only dialogue sound + struct Unk8116040Struct { s16 x; @@ -217,14 +268,20 @@ static const MenuItem sEmptyMenuItems[] = {NULL, 0}, }; -static const u32 gUnknown_8116134[] = +static const u32 sTextboxTypes[] = { 1, 1, 1, 1, 1 }; -static const u16 gUnknown_8116148[] = +static const u16 sFlagSets[] = { - 226, 194, 450, 706, 1, 289, 257, 269, 261, 0 + 0x02 | 0x40 | 0x80 | TEXTBOX_FLAG_INTANT_TEXT, + 0x02 | 0x40 | 0x80, + 0x02 | 0x40 | 0x80 | TEXTBOX_FLAG_SPEAKER, + 0x02 | 0x40 | 0x80 | TEXTBOX_FLAG_DIALOGUE_SOUND, + 0x01, + // These are effectively unused + 0x121, 0x101, 0x10D, 0x105, 0 }; ALIGNED(4) static const u8 sInvalidText[] = _("{COLOR RED_W}invalidity{RESET}"); @@ -232,86 +289,88 @@ ALIGNED(4) static const u8 sUndefineText[] = _("{COLOR RED_W}undefine{RESET}"); ALIGNED(4) static const u8 sSpeechBubbleText[] = _("{SPEECH_BUBBLE}"); ALIGNED(4) static const u8 sYellowSpeechBubbleText[] = _("{COLOR YELLOW_N}{SPEECH_BUBBLE}{RESET}"); ALIGNED(4) static const u8 sYellowStringText[] = _("{COLOR YELLOW_N}%s{RESET}"); -// TODO: Convert to actual string -ALIGNED(4) static const u8 gUnknown_8116190[] = {0x25, 0x73, 0x23, 0x5b, 0x49, 0x5d, 0x23, 0x7e, 0x20, 0x81, 0x40, 0x23, 0x57, 0x0a, 0x23, 0x5b, 0x4f, 0x5d, 0x23, 0x7e, 0x20, 0x81, 0x40, 0x00}; EWRAM_DATA u16 gUnknown_20399DC = 0; EWRAM_DATA u16 gUnknown_20399DE = 0; -void sub_809A560(void) +static void ResetAllTextboxPortraits(void); +static bool8 ScriptPrintTextInternal(struct TextboxText *ptr, u32 flags_, s32 a2_, const char *text); +static u32 ResetTextboxType(u32 param_1, u32 param_2); +static void ResetTextbox(void); + +void TextboxInit(void) { sub_8014144(); - gUnknown_3001B64 = MemoryAlloc(sizeof(struct unkStruct_3001B64), 6); - gUnknown_3001B64->unk0 = 0; - gUnknown_3001B64->unk4 = -1; - gUnknown_3001B64->unk8 = -1; + sTextbox = MemoryAlloc(sizeof(struct Textbox), 6); + sTextbox->unk0 = 0; + sTextbox->unk4 = -1; + sTextbox->unk8 = -1; gUnknown_20399DC = 0; gUnknown_20399DE = 0; sub_80095CC(0,0x14); ShowWindows(0,1,1); sub_8009408(0,0x14); - ResetTextbox_809B294(); - gUnknown_3001B64->unk414 = 0; - gUnknown_3001B64->unk418 = NULL; - gUnknown_3001B64->unk41C = 0; - gUnknown_3001B64->unk420 = 0; - gUnknown_3001B64->unk424 = 0; - gUnknown_3001B64->unk428 = 0; - gUnknown_3001B64->unk42C = NULL; - gUnknown_3001B64->unk430 = -1; - gUnknown_3001B64->unk434 = -1; - sub_809A7EC(); - gUnknown_3001B64->unk5A4 = -1; + ResetTextbox(); + sTextbox->unk414 = 0; + sTextbox->unk418 = NULL; + sTextbox->unk41C = 0; + sTextbox->unk420 = 0; + sTextbox->unk424 = 0; + sTextbox->unk428 = 0; + sTextbox->unk42C = NULL; + sTextbox->unk430 = -1; + sTextbox->unk434 = -1; + ResetAllTextboxPortraits(); + sTextbox->unk5A4 = -1; } -void sub_809A610(void) +void TextboxFree(void) { sub_809A62C(); - MemoryFree(gUnknown_3001B64); - gUnknown_3001B64 = NULL; + FREE_AND_SET_NULL(sTextbox); } void sub_809A62C(void) { s32 index; - gUnknown_3001B64->unk0 = 0; - gUnknown_3001B64->unk4 = -1; - gUnknown_3001B64->unk8 = -1; + sTextbox->unk0 = 0; + sTextbox->unk4 = -1; + sTextbox->unk8 = -1; gUnknown_20399DC = 0; gUnknown_20399DE = 0; - for(index = 0; index < 10; index++) - { - sub_809A83C(index); + for (index = 0; index < MAX_TEXTBOX_PORTRAITS; index++) { + ResetTextboxPortrait(index); } - gUnknown_3001B64->unk414 = 0; - xxx_script_textboxes_809A680(0, 1); + sTextbox->unk414 = 0; + ResetTextboxType(0, 1); } -u32 xxx_script_textboxes_809A680(u32 param_1, u32 param_2) +static u32 ResetTextboxType(u32 param_1, u32 unused) { - switch(param_1) { + switch (param_1) { case 0: - ResetTextbox_809B294(); + ResetTextbox(); ShowWindows(0,1,1); break; case 1: - ResetTextbox_809B294(); + ResetTextbox(); break; case 2: - ResetTextbox_809B294(); + ResetTextbox(); break; case 3: - ResetTextbox_809B294(); + ResetTextbox(); break; case 4: - ResetTextbox_809B294(); + ResetTextbox(); break; default: - ResetTextbox_809B294(); + ResetTextbox(); ShowWindows(0,1,1); + break; } - gUnknown_3001B64->unk0 = param_1; + sTextbox->unk0 = param_1; return 1; } @@ -330,25 +389,27 @@ u16 sub_809A70C(u16 r0) return gUnknown_20399DC; } -void nullsub_209(void) {} +UNUSED static void nullsub_209(void) +{ +} void sub_809A71C(s32 param_1) { - gUnknown_3001B64->unk4 = param_1; - gUnknown_3001B64->unk8 = param_1; + sTextbox->unk4 = param_1; + sTextbox->unk8 = param_1; sub_801416C(param_1, param_1); } void sub_809A738(s32 param_1, s32 param_2) { - gUnknown_3001B64->unk4 = param_1; - gUnknown_3001B64->unk8 = param_2; + sTextbox->unk4 = param_1; + sTextbox->unk8 = param_2; sub_801416C(param_1, param_2); } u8 IsTextboxOpen_809A750(void) { - return IsTextboxOpen_809B40C(&gUnknown_3001B64->unkC); + return IsTextboxOpen_809B40C(&sTextbox->unkC); } u32 sub_809A768(void) @@ -356,87 +417,83 @@ u32 sub_809A768(void) return 0; } -u8 ScriptPrintNullTextbox(void) +// I think these two functions are functionally equivalent. +bool8 ScriptClearTextbox(void) { - switch(gUnknown_3001B64->unk0) - { + switch (sTextbox->unk0) { case 3: - return ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC,4,-1,0); + return ScriptPrintTextInternal(&sTextbox->unkC,4,-1,0); case 1: case 2: - return ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC,0x84,-1,0); + return ScriptPrintTextInternal(&sTextbox->unkC,0x84,-1,0); default: - xxx_script_textboxes_809A680(0, 1); - return 0; + ResetTextboxType(0, 1); + return FALSE; } } -u8 ScriptPrintEmptyTextbox(void) +bool8 ScriptClearTextbox2(void) { - switch(gUnknown_3001B64->unk0) - { + switch (sTextbox->unk0) { case 3: case 1: case 2: - return ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC,4,-1,0); + return ScriptPrintTextInternal(&sTextbox->unkC,4,-1,0); default: - xxx_script_textboxes_809A680(0, 1); - return 0; + ResetTextboxType(0, 1); + return FALSE; } } -void sub_809A7EC(void) +static void ResetAllTextboxPortraits(void) { - s32 counter; - struct unkStruct_3001B64_sub *temp; + s32 i; + struct TextboxPortrait *ptr = &sTextbox->portraits[0]; - temp = &gUnknown_3001B64->unk43C[0]; - - for(counter = 0; counter < 10; counter++, temp++) - { - temp->unk0 |= -1; - temp->speciesID = MONSTER_NONE; - temp->unk4 = 0; - temp->unk5 = 0; - temp->unk6 |= -1; - temp->unk7 = 0; - temp->unk8.a0 = 0; - temp->unk8.a4 = 0; - temp->monPortrait.faceFile = NULL; - temp->monPortrait.faceData = NULL; - temp->monPortrait.spriteId = 0; - temp->faceFile = NULL; + for (i = 0; i < MAX_TEXTBOX_PORTRAITS; i++, ptr++) { + ptr->unk0 = -1; + ptr->speciesID = MONSTER_NONE; + ptr->unk4 = 0; + ptr->unk5 = 0; + ptr->unk6 = -1; + ptr->unk7 = 0; + ptr->unk8.x = 0; + ptr->unk8.y = 0; + ptr->monPortrait.faceFile = NULL; + ptr->monPortrait.faceData = NULL; + ptr->monPortrait.spriteId = 0; + ptr->faceFile = NULL; } } -void sub_809A83C(s16 param_1) +void ResetTextboxPortrait(s16 id_) { - s32 param1 = param_1; - struct unkStruct_3001B64_sub *temp = &gUnknown_3001B64->unk43C[param1]; + s32 id = id_; + struct TextboxPortrait *ptr = &sTextbox->portraits[id]; - temp->unk0 = -1; - temp->speciesID = 0; - temp->unk4 = 0; - temp->unk5 = 0; - temp->unk6 = -1; - temp->unk7 = 0; - temp->unk8.a0 = 0; - temp->unk8.a4 = 0; - temp->monPortrait.faceFile = NULL; - temp->monPortrait.faceData = NULL; - temp->monPortrait.spriteId = 0; - strcpy(gFormatBuffer_Monsters[param_1], sInvalidText); - strcpy(gFormatBuffer_Names[param_1], sInvalidText); - TRY_CLOSE_FILE_AND_SET_NULL(temp->faceFile); + ptr->unk0 = -1; + ptr->speciesID = MONSTER_NONE; + ptr->unk4 = 0; + ptr->unk5 = 0; + ptr->unk6 = -1; + ptr->unk7 = 0; + ptr->unk8.x = 0; + ptr->unk8.y = 0; + ptr->monPortrait.faceFile = NULL; + ptr->monPortrait.faceData = NULL; + ptr->monPortrait.spriteId = 0; + strcpy(gFormatBuffer_Monsters[id_], sInvalidText); + strcpy(gFormatBuffer_Names[id_], sInvalidText); + TRY_CLOSE_FILE_AND_SET_NULL(ptr->faceFile); } -bool8 sub_809A8B8(s32 param_1, s32 param_2) +static bool8 sub_809A8B8(s32 param_1, s32 param_2) { bool8 ret; s16 local_26; - s32 iVar5 = (s16) param_1; + s32 portraitId = (s16) param_1; s16 local_28 = (s16) param_2; - struct unkStruct_3001B64_sub *unkPtr = &gUnknown_3001B64->unk43C[iVar5]; + struct TextboxPortrait *unkPtr = &sTextbox->portraits[portraitId]; u8 uVar9 = 1; u8 byte1 = 0; @@ -517,14 +574,14 @@ bool8 sub_809A8B8(s32 param_1, s32 param_2) if (sVar3 >= 0) { unkPtr->unk0 = local_28; unkPtr->speciesID = sub_80A8BFC(sVar3); - strcpy(gFormatBuffer_Monsters[iVar5], sUndefineText); - strcpy(gFormatBuffer_Names[iVar5], sUndefineText); + strcpy(gFormatBuffer_Monsters[portraitId], sUndefineText); + strcpy(gFormatBuffer_Names[portraitId], sUndefineText); unkPtr->unk4 = uVar9; unkPtr->unk5 = byte1; unkPtr->unk6 = 0xff; unkPtr->unk7 = 0; - unkPtr->unk8.a0 = 0; - unkPtr->unk8.a4 = 0; + unkPtr->unk8.x = 0; + unkPtr->unk8.y = 0; unkPtr->monPortrait.faceFile = NULL; unkPtr->monPortrait.faceData = NULL; unkPtr->monPortrait.spriteId = 0; @@ -533,26 +590,26 @@ bool8 sub_809A8B8(s32 param_1, s32 param_2) else if (local_26 != 0) { unkPtr->unk0 = local_28; unkPtr->speciesID = local_26; - strcpy(gFormatBuffer_Monsters[iVar5], sUndefineText); - strcpy(gFormatBuffer_Names[iVar5], sUndefineText); + strcpy(gFormatBuffer_Monsters[portraitId], sUndefineText); + strcpy(gFormatBuffer_Names[portraitId], sUndefineText); unkPtr->unk4 = uVar9; unkPtr->unk5 = byte1; unkPtr->unk6 = 0xff; unkPtr->unk7 = 0; - unkPtr->unk8.a0 = 0; - unkPtr->unk8.a4 = 0; + unkPtr->unk8.x = 0; + unkPtr->unk8.y = 0; unkPtr->monPortrait.faceFile = NULL; unkPtr->monPortrait.faceData = NULL; unkPtr->monPortrait.spriteId = 0; ret = TRUE; } else { - sub_809A83C(iVar5); + ResetTextboxPortrait(portraitId); ret = FALSE; } } else { - sub_809A83C(iVar5); + ResetTextboxPortrait(portraitId); ret = FALSE; } @@ -563,10 +620,10 @@ bool8 sub_809AB4C(s32 a0_, s32 a1_) { s32 a0 = (s16) a0_; s32 a1 = (s16) a1_; - struct unkStruct_3001B64_sub *unkPtr = &gUnknown_3001B64->unk43C[a0]; + struct TextboxPortrait *ptr = &sTextbox->portraits[a0]; if (sub_809A8B8(a0, a1)) { - CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[a0], unkPtr->speciesID); + CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[a0], ptr->speciesID); strcpy(gFormatBuffer_Names[a0], sSpeechBubbleText); return TRUE; } @@ -579,10 +636,10 @@ bool8 sub_809ABB4(s32 a0_, s32 a1_) { s32 a0 = (s16) a0_; s32 a1 = (s16) a1_; - struct unkStruct_3001B64_sub *unkPtr = &gUnknown_3001B64->unk43C[a0]; + struct TextboxPortrait *ptr = &sTextbox->portraits[a0]; if (sub_809A8B8(a0, a1)) { - CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[a0], unkPtr->speciesID); + CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[a0], ptr->speciesID); strcpy(gFormatBuffer_Names[a0], gFormatBuffer_Monsters[a0]); return TRUE; } @@ -595,7 +652,7 @@ bool8 sub_809AC18(s32 a0_, s32 a1_) { s32 a0 = (s16) a0_; s32 a1 = (s16) a1_; - struct unkStruct_3001B64_sub *unkPtr = &gUnknown_3001B64->unk43C[a0]; + struct TextboxPortrait *unkPtr = &sTextbox->portraits[a0]; if (sub_809A8B8(a0, a1)) { CopyCyanMonsterNametoBuffer(gFormatBuffer_Monsters[a0], unkPtr->speciesID); @@ -612,18 +669,18 @@ bool8 sub_809AC7C(s32 a0_, s32 a1_, s32 a2_) s32 a0 = (s16) a0_; s32 r5 = (s8) a1_; u8 a2 = (u8) a2_; - struct unkStruct_3001B64_sub *unkPtr = &gUnknown_3001B64->unk43C[a0]; + struct TextboxPortrait *unkPtr = &sTextbox->portraits[a0]; TRY_CLOSE_FILE_AND_SET_NULL(unkPtr->faceFile); if (unkPtr->speciesID >= 0 && r5 != -1 && unkPtr->speciesID != 0) { if (a2 != 0x15) { unkPtr->unk7 = a2; - unkPtr->unk8.a0 = 0; - unkPtr->unk8.a4 = 0; + unkPtr->unk8.x = 0; + unkPtr->unk8.y = 0; } - unkPtr->monPortrait.pos.x = gUnknown_8116040[unkPtr->unk7].x + unkPtr->unk8.a0; - unkPtr->monPortrait.pos.y = gUnknown_8116040[unkPtr->unk7].y + unkPtr->unk8.a4; + unkPtr->monPortrait.pos.x = gUnknown_8116040[unkPtr->unk7].x + unkPtr->unk8.x; + unkPtr->monPortrait.pos.y = gUnknown_8116040[unkPtr->unk7].y + unkPtr->unk8.y; unkPtr->monPortrait.flip = gUnknown_8116040[unkPtr->unk7].flip; unkPtr->monPortrait.unkE = 0; if (r5 == -2) { @@ -684,18 +741,18 @@ bool8 sub_809AC7C(s32 a0_, s32 a1_, s32 a2_) unkPtr->unk6 = 0xFF; unkPtr->unk7 = 0; - unkPtr->unk8.a0 = 0; - unkPtr->unk8.a4 = 0; + unkPtr->unk8.x = 0; + unkPtr->unk8.y = 0; unkPtr->monPortrait.faceFile = NULL; unkPtr->monPortrait.faceData = NULL; unkPtr->monPortrait.spriteId = 0; return FALSE; } -bool8 sub_809ADD8(s32 a0_, struct unkStruct_3001B64_sub_sub *a1) +bool8 sub_809ADD8(s32 a0_, PixelPos *a1) { s32 a0 = (s16) a0_; - struct unkStruct_3001B64_sub *unkPtr = &gUnknown_3001B64->unk43C[a0]; + struct TextboxPortrait *unkPtr = &sTextbox->portraits[a0]; if (unkPtr->speciesID < 0) return FALSE; @@ -703,89 +760,89 @@ bool8 sub_809ADD8(s32 a0_, struct unkStruct_3001B64_sub_sub *a1) return FALSE; unkPtr->unk8 = *a1; - unkPtr->monPortrait.pos.x = gUnknown_8116040[unkPtr->unk7].x + unkPtr->unk8.a0; - unkPtr->monPortrait.pos.y = gUnknown_8116040[unkPtr->unk7].y + unkPtr->unk8.a4; + unkPtr->monPortrait.pos.x = gUnknown_8116040[unkPtr->unk7].x + unkPtr->unk8.x; + unkPtr->monPortrait.pos.y = gUnknown_8116040[unkPtr->unk7].y + unkPtr->unk8.y; return TRUE; } -MonPortraitMsg *sub_809AE3C(s32 a0_) +static MonPortraitMsg *GetSpeakerPortrait(s32 portraitId_) { - s32 a0 = (s16) a0_; + s32 portraitId = (s16) portraitId_; - if (a0 >= 0) { - struct unkStruct_3001B64_sub *unkPtr = &gUnknown_3001B64->unk43C[a0]; - if (unkPtr->speciesID != MONSTER_NONE && unkPtr->unk6 == -1) { - sub_809AC7C(a0, 0, 0); + if (portraitId >= 0) { + struct TextboxPortrait *portraitPtr = &sTextbox->portraits[portraitId]; + if (portraitPtr->speciesID != MONSTER_NONE && portraitPtr->unk6 == -1) { + sub_809AC7C(portraitId, 0, 0); } - if (unkPtr->monPortrait.faceFile != NULL) { - return &unkPtr->monPortrait; + if (portraitPtr->monPortrait.faceFile != NULL) { + return &portraitPtr->monPortrait; } } return NULL; } -bool8 ScriptPrintText(s32 a0, s32 a1_, const char *text) +bool8 ScriptPrintText(s32 scriptMsgType, s32 speakerId_, const char *text) { - s32 a1 = (s16) a1_; + s32 speakerId = (s16) speakerId_; if (text == NULL) { - return ScriptPrintNullTextbox(); + return ScriptClearTextbox(); } else if (text[0] == '\0') { - return ScriptPrintEmptyTextbox(); + return ScriptClearTextbox2(); } else { - xxx_script_textboxes_809A680(gUnknown_8116134[a0], 0); - return ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC, gUnknown_8116148[a0], a1, text); + ResetTextboxType(sTextboxTypes[scriptMsgType], 0); + return ScriptPrintTextInternal(&sTextbox->unkC, sFlagSets[scriptMsgType], speakerId, text); } } bool8 sub_809AEEC(const char *text) { if (text == NULL) { - return ScriptPrintNullTextbox(); + return ScriptClearTextbox(); } else if (text[0] == '\0') { - return ScriptPrintNullTextbox(); + return ScriptClearTextbox(); } else { - xxx_script_textboxes_809A680(2, 1); - return ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC, 0xC2, -1, text); + ResetTextboxType(2, 1); + return ScriptPrintTextInternal(&sTextbox->unkC, 0xC2, -1, text); } } bool8 sub_809AF2C(const char *text) { if (text == NULL) { - return ScriptPrintNullTextbox(); + return ScriptClearTextbox(); } else if (text[0] == '\0') { - return ScriptPrintNullTextbox(); + return ScriptClearTextbox(); } else { - xxx_script_textboxes_809A680(2, 1); - return ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC, 0xC2, -1, text); + ResetTextboxType(2, 1); + return ScriptPrintTextInternal(&sTextbox->unkC, 0xC2, -1, text); } } bool8 sub_809AF6C(s32 unused, const char *text) { if (text == NULL) { - return ScriptPrintNullTextbox(); + return ScriptClearTextbox(); } else if (text[0] == '\0') { - return ScriptPrintNullTextbox(); + return ScriptClearTextbox(); } else { - xxx_script_textboxes_809A680(3, 1); - return ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC, 0x65, -1, text); + ResetTextboxType(3, 1); + return ScriptPrintTextInternal(&sTextbox->unkC, 0x65, -1, text); } } bool8 sub_809AFAC(void) { - return (gUnknown_3001B64->unk0 == 4); + return (sTextbox->unk0 == 4); } void sub_809AFC8(s32 a0_, s32 a1, s32 a2_, const char *text) @@ -812,15 +869,15 @@ void sub_809B028(const MenuItem * menuItems, s32 a1_, s32 a2, s32 a3, s32 a4_, c s32 a1 = (u8) a1_; s32 a4 = (s16) a4_; - xxx_script_textboxes_809A680(gUnknown_8116134[a3], 0); - gUnknown_3001B64->unk414 = 1; - gUnknown_3001B64->unk418 = NULL; - gUnknown_3001B64->unk41C = menuItems; - gUnknown_3001B64->unk420 = 2; - gUnknown_3001B64->unk424 = (a1 != 0) ? 2 : 0; - gUnknown_3001B64->unk428 = 0; - gUnknown_3001B64->unk430 = a2; - if (gUnknown_8116148[a3] & 0x100) { + ResetTextboxType(sTextboxTypes[a3], 0); + sTextbox->unk414 = 1; + sTextbox->unk418 = NULL; + sTextbox->unk41C = menuItems; + sTextbox->unk420 = 2; + sTextbox->unk424 = (a1 != 0) ? 2 : 0; + sTextbox->unk428 = 0; + sTextbox->unk430 = a2; + if (sFlagSets[a3] & TEXTBOX_FLAG_SPEAKER) { if (a4 < 0) { strcpy(gSpeakerNameBuffer, sYellowSpeechBubbleText); } @@ -829,9 +886,12 @@ void sub_809B028(const MenuItem * menuItems, s32 a1_, s32 a2, s32 a3, s32 a4_, c } } - CreateMenuDialogueBoxAndPortrait(text, sub_809B428, a2, menuItems, 0, 4, 0, sub_809AE3C(a4), - ((gUnknown_8116148[a3] & 0x100) ? 0xC : 0) | ((gUnknown_8116148[a3] & 0x200) ? 0x4 : 0) | ((gUnknown_8116148[a3] & 0x20) ? 0x21 : 1)); // What an ugly way to get flags lol - if (gUnknown_3001B64->unk424 & 2) { + CreateMenuDialogueBoxAndPortrait(text, sub_809B428, a2, menuItems, 0, 4, 0, GetSpeakerPortrait(a4), + ((sFlagSets[a3] & TEXTBOX_FLAG_SPEAKER) ? STR_FORMAT_FLAG_SPEAKER_NAME | STR_FORMAT_FLAG_DIALOGUE_SOUND : 0) + | ((sFlagSets[a3] & TEXTBOX_FLAG_DIALOGUE_SOUND) ? STR_FORMAT_FLAG_DIALOGUE_SOUND : 0) + | ((sFlagSets[a3] & 0x20) ? 0x21 : 1)); // What an ugly way to get flags lol + + if (sTextbox->unk424 & 2) { sub_809A6E4(1); } } @@ -839,10 +899,10 @@ void sub_809B028(const MenuItem * menuItems, s32 a1_, s32 a2, s32 a3, s32 a4_, c bool8 sub_809B18C(s32 *sp) { if (sp != NULL) { - *sp = gUnknown_3001B64->unk430; + *sp = sTextbox->unk430; } - return (gUnknown_3001B64->unk420 == 3); + return (sTextbox->unk420 == 3); } bool8 sub_809B1C0(s32 a0, u32 kind, u8 *a2) @@ -866,15 +926,15 @@ bool8 sub_809B1D4(s32 a0, u32 kind, s32 a2, u8 *a3) break; } - xxx_script_textboxes_809A680(4, 0); - gUnknown_3001B64->unk414 = a0; - gUnknown_3001B64->unk418 = NULL; - gUnknown_3001B64->unk41C = NULL; - gUnknown_3001B64->unk420 = 1; - gUnknown_3001B64->unk424 = kind; - gUnknown_3001B64->unk428 = a2; - gUnknown_3001B64->unk42C = a3; - gUnknown_3001B64->unk430 = -1; + ResetTextboxType(4, 0); + sTextbox->unk414 = a0; + sTextbox->unk418 = NULL; + sTextbox->unk41C = NULL; + sTextbox->unk420 = 1; + sTextbox->unk424 = kind; + sTextbox->unk428 = a2; + sTextbox->unk42C = a3; + sTextbox->unk430 = -1; return TRUE; } @@ -882,68 +942,69 @@ bool8 sub_809B1D4(s32 a0, u32 kind, s32 a2, u8 *a3) bool8 sub_809B260(s32 *a0) { if (a0 != NULL) { - *a0 = gUnknown_3001B64->unk430; + *a0 = sTextbox->unk430; } - return (gUnknown_3001B64->unk420 == 3); + return (sTextbox->unk420 == 3); } -void ResetTextbox_809B294(void) +static void ResetTextbox(void) { SetCharacterMask(3); - ScriptPrintText_809B2B8(&gUnknown_3001B64->unkC, 0, -1, NULL); + // All this function call does is basically setting textboxText->unk4 = 0; + ScriptPrintTextInternal(&sTextbox->unkC, 0, -1, NULL); } -u8 ScriptPrintText_809B2B8(struct unkStruct_3001B64_unkC *ptr, s32 a1_, s32 a2_, const char *text) +static bool8 ScriptPrintTextInternal(struct TextboxText *textboxText, u32 flags_, s32 speakerId_, const char *text) { - u16 a1 = (u16) a1_; - s32 a2 = (s16) a2_; + u16 flags = (u16) flags_; + s32 speakerId = (s16) speakerId_; - ptr->unk0 = a1; + textboxText->flags = flags; if (text == NULL) { - if (a1 == 0) { - ptr->unk4 = 0; + if (flags == 0) { + textboxText->unk4 = 0; return FALSE; } - if (a1 & 4) { + if (flags & 4) { sub_8014490(); - xxx_script_textboxes_809A680(0, 1); + ResetTextboxType(0, 1); } return TRUE; } - ptr->unk4 = 1; - if (a1 & 0x100) { - if (a2 < 0) { + textboxText->unk4 = 1; + if (flags & TEXTBOX_FLAG_SPEAKER) { + if (speakerId < 0) { strcpy(gSpeakerNameBuffer, sYellowSpeechBubbleText); } else { - sprintfStatic(gSpeakerNameBuffer, sYellowStringText, gFormatBuffer_Names[a2]); + sprintfStatic(gSpeakerNameBuffer, sYellowStringText, gFormatBuffer_Names[speakerId]); } } - if (gUnknown_3001B64->unk0 == 3) { - sprintfStatic(ptr->buffer, gUnknown_8116190, text); - text = ptr->buffer; + if (sTextbox->unk0 == 3) { + sprintfStatic(textboxText->buffer, _("%s#[I]{WAIT_FRAMES 0x20}{0x81}{0x40}{WAIT_PRESS}\n#[O]{WAIT_FRAMES 0x20}{0x81}{0x40}"), text); // #[I] and #[O] are text macros to be documented + text = textboxText->buffer; } - CreateMenuDialogueBoxAndPortrait(text, sub_809B428, -1, NULL, 0, 3, 0, sub_809AE3C(a2), - ((a1 & 0x100) ? 0xC : 0) - | ((a1 & 0x200) ? 0x4 : 0) - | ((gUnknown_3001B64->unk0 == 3) ? 0x10 : 0) - | ((gUnknown_3001B64->unk0 == 2) ? 0x10 : 0) - | ((a1 & 0x20) ? 0x20 : 0) - | ((a1 & 0x40) ? 0x1 : 0) - | ((a1 & 0x80) ? 0x100 : 0) - | ((a1 & 0x4) ? 0x200 : 0) - | ((gUnknown_3001B64->unk4 != -1) ? 0x2 : 0) + CreateMenuDialogueBoxAndPortrait(text, sub_809B428, -1, NULL, 0, 3, 0, GetSpeakerPortrait(speakerId), + ((flags & TEXTBOX_FLAG_SPEAKER) ? STR_FORMAT_FLAG_SPEAKER_NAME | STR_FORMAT_FLAG_DIALOGUE_SOUND : 0) + | ((flags & TEXTBOX_FLAG_DIALOGUE_SOUND) ? STR_FORMAT_FLAG_DIALOGUE_SOUND : 0) + | ((sTextbox->unk0 == 3) ? 0x10 : 0) + | ((sTextbox->unk0 == 2) ? 0x10 : 0) + | ((flags & TEXTBOX_FLAG_INTANT_TEXT) ? STR_FORMAT_FLAG_INSTANT_TEXT : 0) + | ((flags & 0x40) ? 0x1 : 0) + | ((flags & 0x80) ? 0x100 : 0) + | ((flags & 0x4) ? 0x200 : 0) + | ((sTextbox->unk4 != -1) ? 0x2 : 0) ); return TRUE; } -bool8 IsTextboxOpen_809B40C(struct unkStruct_3001B64_unkC *a0) +bool8 IsTextboxOpen_809B40C(struct TextboxText *a0) { switch (a0->unk4) { case 0: @@ -981,7 +1042,7 @@ void sub_809B474(void) { const struct unkStruct_3001B64_unk418 *unkStructPtr; - switch (gUnknown_3001B64->unk0) { + switch (sTextbox->unk0) { case 0: case 1: case 2: @@ -989,36 +1050,36 @@ void sub_809B474(void) default: break; case 4: - switch (gUnknown_3001B64->unk420) { + switch (sTextbox->unk420) { case 1: if (!sub_809B648()) { - gUnknown_3001B64->unk420 = 3; - xxx_script_textboxes_809A680(0, 1); + sTextbox->unk420 = 3; + ResetTextboxType(0, 1); break; } - unkStructPtr = gUnknown_3001B64->unk418; + unkStructPtr = sTextbox->unk418; if (unkStructPtr != NULL) { if (unkStructPtr->unk4 != NULL) { - ResetTextbox_809B294(); + ResetTextbox(); if (!unkStructPtr->unk4()) { - gUnknown_3001B64->unk430 = -1; - gUnknown_3001B64->unk420 = 3; - xxx_script_textboxes_809A680(0, 1); + sTextbox->unk430 = -1; + sTextbox->unk420 = 3; + ResetTextboxType(0, 1); break; } } sub_809A6E4(unkStructPtr->unk0); } - gUnknown_3001B64->unk420 = 2; + sTextbox->unk420 = 2; // Fallthrough case 2: - unkStructPtr = gUnknown_3001B64->unk418; + unkStructPtr = sTextbox->unk418; if (unkStructPtr != NULL) { s32 retVal = unkStructPtr->unkC(); if (retVal == 0 || retVal == 1) break; - gUnknown_3001B64->unk430 = (retVal == 2) ? -1 : 0; + sTextbox->unk430 = (retVal == 2) ? -1 : 0; if (unkStructPtr->unk8 != NULL) { unkStructPtr->unk8(); } @@ -1027,8 +1088,8 @@ void sub_809B474(void) else if (sub_809B648()) { break; } - gUnknown_3001B64->unk420 = 3; - xxx_script_textboxes_809A680(0, 1); + sTextbox->unk420 = 3; + ResetTextboxType(0, 1); break; } break; @@ -1039,17 +1100,17 @@ void sub_809B474(void) void sub_809B57C(void) { DrawDialogueBoxString(); - switch (gUnknown_3001B64->unk0) { + switch (sTextbox->unk0) { case 1: case 2: case 3: - switch (gUnknown_3001B64->unk420) { + switch (sTextbox->unk420) { default: { s32 sp; if (sub_80144A4(&sp) == 0) { GroundScriptLock(1, sp); - gUnknown_3001B64->unk420 = 3; - gUnknown_3001B64->unk430 = sp; + sTextbox->unk420 = 3; + sTextbox->unk430 = sp; } break; } @@ -1058,7 +1119,7 @@ void sub_809B57C(void) s32 sp; if (sub_80144A4(&sp) == 0) { GroundScriptLockJumpZero(0); - gUnknown_3001B64->unk0 = 0; + sTextbox->unk0 = 0; } break; } @@ -1066,7 +1127,7 @@ void sub_809B57C(void) break; } - if (gUnknown_3001B64->unk434 < 0) { + if (sTextbox->unk434 < 0) { sub_8005838(0, 0); } else { @@ -1286,28 +1347,28 @@ static const struct unkStruct_3001B64_unk418 gUnknown_8116318 = bool8 sub_809B648(void) { - switch (gUnknown_3001B64->unk414) { + switch (sTextbox->unk414) { case 2: - if (gUnknown_3001B64->unk420 != 1) { + if (sTextbox->unk420 != 1) { u32 pressed = gRealInputs.pressed; if ((pressed & AB_BUTTONS) != 0) { - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; return 0; } if (sub_8094D14()) { - gUnknown_3001B64->unk430 = 2; + sTextbox->unk430 = 2; return 0; } else { return 1; } } - ResetTextbox_809B294(); + ResetTextbox(); return 1; case 3: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); + if (sTextbox->unk420 == 1) { + ResetTextbox(); return 1; } else { @@ -1320,13 +1381,13 @@ bool8 sub_809B648(void) } break; case 4: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - if (gUnknown_3001B64->unk424 == 0) { - CreateConfirmNameMenu(0, gUnknown_3001B64->unk42C); + if (sTextbox->unk420 == 1) { + ResetTextbox(); + if (sTextbox->unk424 == 0) { + CreateConfirmNameMenu(0, sTextbox->unk42C); } else { - CreateConfirmNameMenu(2, gUnknown_3001B64->unk42C); + CreateConfirmNameMenu(2, sTextbox->unk42C); } return 1; } @@ -1334,14 +1395,14 @@ bool8 sub_809B648(void) s32 var = sub_8016080(); if (var == 3) { CleanConfirmNameMenu(); - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; } else if (var == 2) { - if (gUnknown_3001B64->unk424 == 0) { + if (sTextbox->unk424 == 0) { return 1; } CleanConfirmNameMenu(); - gUnknown_3001B64->unk430 = 0; + sTextbox->unk430 = 0; return 0; } else { @@ -1350,67 +1411,67 @@ bool8 sub_809B648(void) } break; case 5: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - CreateConfirmNameMenu(1, gUnknown_3001B64->unk42C); + if (sTextbox->unk420 == 1) { + ResetTextbox(); + CreateConfirmNameMenu(1, sTextbox->unk42C); } else { s32 var = sub_8016080(); if (var == 3) { CleanConfirmNameMenu(); - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; return 0; } else if (var == 2) { - if (gUnknown_3001B64->unk424 == 0) { + if (sTextbox->unk424 == 0) { return 1; } CleanConfirmNameMenu(); - gUnknown_3001B64->unk430 = 0; + sTextbox->unk430 = 0; return 0; } } return 1; case 6: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - NamingScreen_Init(4,gUnknown_3001B64->unk42C); + if (sTextbox->unk420 == 1) { + ResetTextbox(); + NamingScreen_Init(4,sTextbox->unk42C); } else { s32 var = NamingScreen_HandleInput(); if (var == 3) { NamingScreen_Free(); - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; return 0; } else if (var == 2) { - if (gUnknown_3001B64->unk424 == 0) { + if (sTextbox->unk424 == 0) { return 1; } NamingScreen_Free(); - gUnknown_3001B64->unk430 = 0; + sTextbox->unk430 = 0; return 0; } } return 1; case 7: - sub_801D014((void *) gUnknown_3001B64->unk42C); - gUnknown_3001B64->unk418 = &gUnknown_81161A8; + sub_801D014((void *) sTextbox->unk42C); + sTextbox->unk418 = &gUnknown_81161A8; PlayMenuSoundEffect(4); return 1; case 8: - sub_801D014((void *) gUnknown_3001B64->unk42C); - gUnknown_3001B64->unk418 = &gUnknown_81161B8; + sub_801D014((void *) sTextbox->unk42C); + sTextbox->unk418 = &gUnknown_81161B8; PlayMenuSoundEffect(4); return 1; case 9: - ResetTextbox_809B294(); - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - if (!sub_8015080(gUnknown_3001B64->unk42C, gUnknown_811610C)) { - gUnknown_3001B64->unk430 = -1; + ResetTextbox(); + if (sTextbox->unk420 == 1) { + ResetTextbox(); + if (!sub_8015080(sTextbox->unk42C, gUnknown_811610C)) { + sTextbox->unk430 = -1; return 0; } PlayMenuSoundEffect(4); @@ -1419,22 +1480,22 @@ bool8 sub_809B648(void) switch( sub_801516C()) { case 3: - gUnknown_3001B64->unk430 = sub_8015198(); + sTextbox->unk430 = sub_8015198(); sub_80151A4(); return 0; case 2: - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; sub_80151A4(); return 0; } } return 1; case 10: - ResetTextbox_809B294(); - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - if (!sub_8015080(gUnknown_3001B64->unk42C, sEmptyMenuItems)) { - gUnknown_3001B64->unk430 = -1; + ResetTextbox(); + if (sTextbox->unk420 == 1) { + ResetTextbox(); + if (!sub_8015080(sTextbox->unk42C, sEmptyMenuItems)) { + sTextbox->unk430 = -1; return 0; } PlayMenuSoundEffect(4); @@ -1442,21 +1503,21 @@ bool8 sub_809B648(void) else { switch( sub_801516C()) { case 3: - gUnknown_3001B64->unk430 = sub_8015198(); + sTextbox->unk430 = sub_8015198(); sub_80151A4(); return 0; case 2: - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; sub_80151A4(); return 0; } } return 1; case 11: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - if (!sub_80211AC(gUnknown_3001B64->unk424,3)) { - gUnknown_3001B64->unk430 = -1; + if (sTextbox->unk420 == 1) { + ResetTextbox(); + if (!sub_80211AC(sTextbox->unk424,3)) { + sTextbox->unk430 = -1; return 0; } PlayMenuSoundEffect(4); @@ -1464,22 +1525,22 @@ bool8 sub_809B648(void) else { switch(sub_8021274(1)) { case 3: - gUnknown_3001B64->unk430 = sub_802132C(); + sTextbox->unk430 = sub_802132C(); sub_80213A0(); return 0; case 2: - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; sub_80213A0(); return 0; } } return 1; case 0xc: - if (gUnknown_3001B64->unk420 == 1) { + if (sTextbox->unk420 == 1) { s32 var = sub_80A2654(GetScriptVarValue(0,0x12)); - ResetTextbox_809B294(); + ResetTextbox(); if (!sub_802F73C(3,0,10,1)) { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } if ((var != -1) && (!sub_802F848(var))) { @@ -1492,22 +1553,22 @@ bool8 sub_809B648(void) case 3: { s32 var = sub_802F90C(); SetScriptVarValue(0, 0x12, sub_80A26B8(var)); - gUnknown_3001B64->unk430 = var; + sTextbox->unk430 = var; sub_802F974(); return 0; } case 2: - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; sub_802F974(); return 0; } } return 1; case 0xd: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); + if (sTextbox->unk420 == 1) { + ResetTextbox(); if (!sub_80302E8(3,0,10)) { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } PlayMenuSoundEffect(4); @@ -1515,11 +1576,11 @@ bool8 sub_809B648(void) else { switch(sub_80303AC(1)) { case 3: - gUnknown_3001B64->unk430 = sub_8030418(); + sTextbox->unk430 = sub_8030418(); sub_8030480(); return 0; case 2: - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; sub_8030480(); return 0; } @@ -1527,9 +1588,9 @@ bool8 sub_809B648(void) return 1; case 0xe: case 0xf: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - if (gUnknown_3001B64->unk414 == 0xe) { + if (sTextbox->unk420 == 1) { + ResetTextbox(); + if (sTextbox->unk414 == 0xe) { SetScriptVarValue(0,0x18,1); } sub_8011C28(1); @@ -1544,26 +1605,26 @@ bool8 sub_809B648(void) return 0; case 0x10: { bool8 unkBool = (sub_80023E4(4) != 0); - ResetTextbox_809B294(); + ResetTextbox(); if (CreateKangaskhanStorage(unkBool)) { - gUnknown_3001B64->unk418 = &gUnknown_81161C8; + sTextbox->unk418 = &gUnknown_81161C8; return 1; } - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } case 0x11: - gUnknown_3001B64->unk418 = &gUnknown_81161D8; + sTextbox->unk418 = &gUnknown_81161D8; return 1; case 0x13: { bool8 unkBool = (sub_80023E4(4) != 0); - ResetTextbox_809B294(); + ResetTextbox(); if (CreateFelicityBank(unkBool)) { - gUnknown_3001B64->unk418 = &gUnknown_81161E8; + sTextbox->unk418 = &gUnknown_81161E8; return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } @@ -1571,8 +1632,8 @@ bool8 sub_809B648(void) case 0x18: { u8 var; bool8 unkBool = sub_80023E4(4); - ResetTextbox_809B294(); - if (gUnknown_3001B64->unk414 == 0x17) { + ResetTextbox(); + if (sTextbox->unk414 == 0x17) { var = (unkBool == 0) ? 0 : 1; } else { @@ -1583,29 +1644,29 @@ bool8 sub_809B648(void) } if (CreateKecleonBros(var)) { - gUnknown_3001B64->unk418 = &gUnknown_81161F8; + sTextbox->unk418 = &gUnknown_81161F8; return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } case 0x19: { bool8 unkBool = (sub_80023E4(4) != 0); - ResetTextbox_809B294(); + ResetTextbox(); if (sub_801FB50(unkBool)) { - gUnknown_3001B64->unk418 = &gUnknown_8116208; + sTextbox->unk418 = &gUnknown_8116208; return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } case 0x1a: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); + if (sTextbox->unk420 == 1) { + ResetTextbox(); ClearScriptVarArray(0,0x39); sub_802465C(); return 1; @@ -1619,12 +1680,12 @@ bool8 sub_809B648(void) if (iVar10 == 3) { CleanLuminousCave(); - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; return 0; } else if (iVar10 == 2) { CleanLuminousCave(); - gUnknown_3001B64->unk430 = 0; + sTextbox->unk430 = 0; return 0; } else { @@ -1634,38 +1695,38 @@ bool8 sub_809B648(void) return 0; case 0x1b: { bool8 unk = (sub_80023E4(4) != 0); - ResetTextbox_809B294(); + ResetTextbox(); if (CreateWigglytuffShop(unk)) { - gUnknown_3001B64->unk418 = &gUnknown_8116218; + sTextbox->unk418 = &gUnknown_8116218; return 1; } - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } case 0x1c: - gUnknown_3001B64->unk418 = &gUnknown_8116228; + sTextbox->unk418 = &gUnknown_8116228; return 1; case 0x1d: - gUnknown_3001B64->unk418 = &gUnknown_8116238; + sTextbox->unk418 = &gUnknown_8116238; return 1; case 0x1e: - gUnknown_3001B64->unk418 = &gUnknown_8116248; + sTextbox->unk418 = &gUnknown_8116248; return 1; case 0x1f: - ResetTextbox_809B294(); + ResetTextbox(); if (!CreateHelperPelipperMenu(0x130)) { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } - gUnknown_3001B64->unk418 = &gUnknown_8116258; + sTextbox->unk418 = &gUnknown_8116258; return 1; case 0x20: PlayMenuSoundEffect(4); - gUnknown_3001B64->unk418 = &gUnknown_8116268; + sTextbox->unk418 = &gUnknown_8116268; return 1; case 0x21: PlayMenuSoundEffect(4); - gUnknown_3001B64->unk418 = &gUnknown_8116278; + sTextbox->unk418 = &gUnknown_8116278; return 1; case 0x22: { u8 local_34; @@ -1679,19 +1740,19 @@ bool8 sub_809B648(void) sub_8096AF8(&local_28,local_2c,local_34); if (local_28.unk0) { ScenarioCalc(2,local_30,local_2c); - gUnknown_3001B64->unk430 = (local_28.clientSpecies == 0 ? 0 : 1) + ((local_28.targetSpecies != 0) ? 2 : 0); - if (gUnknown_3001B64->unk430 != 0) { + sTextbox->unk430 = (local_28.clientSpecies == 0 ? 0 : 1) + ((local_28.targetSpecies != 0) ? 2 : 0); + if (sTextbox->unk430 != 0) { return 0; } else { - gUnknown_3001B64->unk430 = 3; + sTextbox->unk430 = 3; return 0; } } local_2c++; } } - gUnknown_3001B64->unk430 = 0; + sTextbox->unk430 = 0; sub_8096BD0(); ScenarioCalc(2,0,0); return 0; @@ -1720,20 +1781,20 @@ bool8 sub_809B648(void) } SetScriptVarValue(0,0x39,1); ScenarioCalc(2,local_20,local_1c + 1); - gUnknown_3001B64->unk418 = &gUnknown_8116288; + sTextbox->unk418 = &gUnknown_8116288; return 1; } } case 0x24: - if (gUnknown_3001B64->unk420 == 1) { + if (sTextbox->unk420 == 1) { u32 uVar19 = sub_80023E4(4) == 0 ? 0 : 4; - ResetTextbox_809B294(); + ResetTextbox(); if (MakuhitaDojo_New(uVar19)) { return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } @@ -1744,11 +1805,11 @@ bool8 sub_809B648(void) default: return 1; case 3: - gUnknown_3001B64->unk430 = sub_802FED0(); + sTextbox->unk430 = sub_802FED0(); MakuhitaDojo_Delete(); return 0; case 2: - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; MakuhitaDojo_Delete(); return 0; @@ -1760,13 +1821,13 @@ bool8 sub_809B648(void) if (sub_80023E4(4)) { var = 5; } - ResetTextbox_809B294(); + ResetTextbox(); if (MakuhitaDojo_New(var)) { - gUnknown_3001B64->unk418 = &gUnknown_8116298; + sTextbox->unk418 = &gUnknown_8116298; return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } @@ -1775,13 +1836,13 @@ bool8 sub_809B648(void) if (sub_80023E4(4)) { var = 6; } - ResetTextbox_809B294(); + ResetTextbox(); if (MakuhitaDojo_New(var)) { - gUnknown_3001B64->unk418 = &gUnknown_81162A8; + sTextbox->unk418 = &gUnknown_81162A8; return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } @@ -1790,71 +1851,71 @@ bool8 sub_809B648(void) if (sub_80023E4(4)) { var = 7; } - ResetTextbox_809B294(); + ResetTextbox(); if (MakuhitaDojo_New(var)) { - gUnknown_3001B64->unk418 = &gUnknown_81162B8; + sTextbox->unk418 = &gUnknown_81162B8; return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } case 0x28: - gUnknown_3001B64->unk418 = &gUnknown_81162C8; + sTextbox->unk418 = &gUnknown_81162C8; return 1; case 0x29: - gUnknown_3001B64->unk418 = &gUnknown_81162D8; + sTextbox->unk418 = &gUnknown_81162D8; return 1; case 0x2a: - ResetTextbox_809B294(); + ResetTextbox(); if (sub_803B050()) { - sub_803B100(gUnknown_3001B64->unk5A4); - gUnknown_3001B64->unk418 = &gUnknown_81162E8; + sub_803B100(sTextbox->unk5A4); + sTextbox->unk418 = &gUnknown_81162E8; return 1; } - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; case 0x12: - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; break; case 0x14: case 0x15: - ResetTextbox_809B294(); + ResetTextbox(); return 0; case 0x16: if (CreateFriendListMenu(2)) { - gUnknown_3001B64->unk418 = &gUnknown_81162F8; + sTextbox->unk418 = &gUnknown_81162F8; return 1; } - gUnknown_3001B64->unk430 = -2; + sTextbox->unk430 = -2; return 0; case 0x2b: - gUnknown_3001B64->unk430 = TryGiveScriptItem(gUnknown_3001B64->unk424,gUnknown_3001B64->unk428); - gUnknown_3001B64->unk418 = &gUnknown_8116308; + sTextbox->unk430 = TryGiveScriptItem(sTextbox->unk424,sTextbox->unk428); + sTextbox->unk418 = &gUnknown_8116308; return 1; case 0x2c: { - s32 uVar13 = gUnknown_3001B64->unk428; - u8 uVar1 = gUnknown_3001B64->unk424; - ResetTextbox_809B294(); + s32 uVar13 = sTextbox->unk428; + u8 uVar1 = sTextbox->unk424; + ResetTextbox(); if (sub_801B60C(uVar13,uVar1,1)) { - gUnknown_3001B64->unk418 = &gUnknown_8116318; + sTextbox->unk418 = &gUnknown_8116318; return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } case 0x2d: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); + if (sTextbox->unk420 == 1) { + ResetTextbox(); ShowWindows(NULL, 1, 1); if (sub_801A5D8(0,0,NULL,10)) { return 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } } @@ -1866,16 +1927,16 @@ bool8 sub_809B648(void) if (IsEdibleItem(itemId)) { BufferItemName(gFormatBuffer_Items[0],itemId,0); ShiftItemsDownFrom(itemArrayId); - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; } sub_801A928(); return 0; } case 2: - gUnknown_3001B64->unk430 = -1;sub_801A928();return 0; + sTextbox->unk430 = -1;sub_801A928();return 0; return 0; default: return 1; @@ -1883,19 +1944,19 @@ bool8 sub_809B648(void) } break; case 0x2E: - if (gUnknown_3001B64->unk420 == 1) { - ResetTextbox_809B294(); - if (DrawCredits(gUnknown_3001B64->unk424, gUnknown_3001B64->unk428)) { + if (sTextbox->unk420 == 1) { + ResetTextbox(); + if (DrawCredits(sTextbox->unk424, sTextbox->unk428)) { return 1; } - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; return 0; } else { switch (sub_8035574()) { case 2: case 3: - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; sub_803565C(); return 0; default: @@ -1910,16 +1971,16 @@ bool8 sub_809B648(void) void sub_809C39C(void) { - gUnknown_3001B64->unk430 = sub_801D178(); - if(gUnknown_3001B64->unk430 == 3) + sTextbox->unk430 = sub_801D178(); + if(sTextbox->unk430 == 3) GroundMainGroundRequest(FriendAreaIdToMapId(sub_801D1D4()), 0, -1); sub_801D1E0(); } void sub_809C3D8(void) { - gUnknown_3001B64->unk430 = sub_801D178(); - if(gUnknown_3001B64->unk430 == 3) + sTextbox->unk430 = sub_801D178(); + if(sTextbox->unk430 == 3) GroundMainGroundRequest(FriendAreaIdToMapId(sub_801D1D4()), 0, -1); sub_801D1E0(); } @@ -1932,12 +1993,12 @@ void sub_809C414(void) if(val != 0) { - gUnknown_3001B64->unk430 = val; + sTextbox->unk430 = val; GroundMainGroundRequest(FriendAreaIdToMapId(val), 0, -1); } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; } CleanFriendListMenu(); @@ -1973,17 +2034,17 @@ void sub_809C4B0(void) s16 scriptIndex_s16; s32 scriptIndex = -1; - if (gUnknown_3001B64->unk430 == 0) { + if (sTextbox->unk430 == 0) { scriptIndex = (s16) sub_803B168(); - ASM_MATCH_TRICK(gUnknown_3001B64->unk5A4); + ASM_MATCH_TRICK(sTextbox->unk5A4); scriptIndex_s16 = scriptIndex; - gUnknown_3001B64->unk5A4 = scriptIndex_s16; - gUnknown_3001B64->unk430 = scriptIndex; + sTextbox->unk5A4 = scriptIndex_s16; + sTextbox->unk430 = scriptIndex; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; } sub_803B1BC(); @@ -1999,11 +2060,11 @@ void sub_809C504(void) if(sub_80282DC(&temp) == 1) { sub_809927C(temp); - gUnknown_3001B64->unk430 = 1; + sTextbox->unk430 = 1; } else { - gUnknown_3001B64->unk430 = -1; + sTextbox->unk430 = -1; } sub_80282FC(); } @@ -2032,5 +2093,5 @@ void sub_809C550(void) val = 3; break; } - gUnknown_3001B64->unk430 = val; + sTextbox->unk430 = val; } diff --git a/sym_ewram.txt b/sym_ewram.txt index e7b453f13..05601ff0a 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -80,7 +80,7 @@ .include "src/ground_main.o" .space 4 .include "src/palette_util.o" - .include "src/code_809A560.o" + .include "src/textbox.o" .include "src/script_item.o" .space 4 .include "src/code_809D148.o" diff --git a/sym_iwram_init.txt b/sym_iwram_init.txt index 94ec0d6b8..46da3a2a3 100644 --- a/sym_iwram_init.txt +++ b/sym_iwram_init.txt @@ -3,7 +3,7 @@ .include "src/code_80035F0.o" .include "src/code_8023144.o" .include "src/friend_list.o" -.include "src/code_809A560.o" +.include "src/textbox.o" .include "src/unk_ds_only_feature.o" .include "src/ground_map.o" .include "src/ground_map_2.o"