From ae1bd9d38443e6d15502e14e50257c6d78c1cefa Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 30 Nov 2024 15:15:04 +0100 Subject: [PATCH] remove text1.h text2.h --- asm/code_800F990.s | 4 +- asm/code_8010F28.s | 4 +- include/text.h | 53 ++++++++++++++++++ include/text1.h | 18 ------ include/text2.h | 83 --------------------------- src/adventure_log.c | 5 +- src/adventure_log_menu.c | 4 +- src/code_2.c | 6 +- src/code_8009804.c | 2 +- src/code_8012A18_1.c | 2 +- src/code_8015080.c | 4 +- src/code_801602C.c | 2 +- src/code_801B3C0.c | 4 +- src/code_801B60C.c | 4 +- src/code_801C8C4.c | 4 +- src/code_801D014.c | 4 +- src/code_801D9E4.c | 4 +- src/code_801EE10.c | 4 +- src/code_801F428.c | 4 +- src/code_801F808.c | 4 +- src/code_80227B8.c | 4 +- src/code_8023144.c | 4 +- src/code_8024458.c | 4 +- src/code_802DB28.c | 5 +- src/code_802DE84.c | 5 +- src/code_8031D70.c | 3 +- src/code_803E724.c | 2 +- src/code_8042B34.c | 3 +- src/code_805D8C8_1.c | 2 - src/code_8072F3C.c | 3 +- src/code_809447C.c | 2 +- src/code_809A560.c | 4 +- src/code_8272724.c | 2 +- src/credits1.c | 5 +- src/debug_menu1.c | 2 +- src/debug_menu2.c | 3 +- src/debug_menu3.c | 5 +- src/debug_menu4.c | 3 +- src/ds_menus.c | 2 +- src/dungeon_map_access.c | 2 +- src/dungeon_message.c | 2 - src/felicity_bank.c | 5 +- src/friend_area_action_menu.c | 3 +- src/friend_list_menu.c | 3 +- src/friend_rescue.c | 3 +- src/gulpin_shop.c | 3 +- src/gulpin_shop_801FB50.c | 5 +- src/hints_menu1.c | 3 +- src/hints_menu2.c | 3 +- src/iq_skill_info_menu.c | 3 +- src/iq_skill_list_menu.c | 3 +- src/iq_skill_menu.c | 3 +- src/items.c | 2 +- src/kangaskhan_storage1.c | 5 +- src/kangaskhan_storage2.c | 3 +- src/kecleon_bros1.c | 5 +- src/kecleon_bros2.c | 3 +- src/kecleon_bros3.c | 3 +- src/kecleon_bros4.c | 3 +- src/load_screen.c | 3 +- src/luminous_cave.c | 3 +- src/mailbox.c | 3 +- src/main.c | 10 ++-- src/main_menu1.c | 3 +- src/main_menu2.c | 2 +- src/makuhita_dojo1.c | 5 +- src/makuhita_dojo2.c | 3 +- src/menu_input.c | 2 - src/mission_reward.c | 3 +- src/moves.c | 2 +- src/options_menu1.c | 5 +- src/options_menu2.c | 5 +- src/other_menus1.c | 4 +- src/party_list_menu.c | 3 +- src/pelipper_board.c | 7 +-- src/personality_test1.c | 3 +- src/personality_test2.c | 3 +- src/pokemon_mail.c | 92 +++++++++++++++--------------- src/pokemon_news1.c | 3 +- src/pokemon_news2.c | 3 +- src/pokemon_news3.c | 10 ++-- src/post_office_guide1.c | 2 +- src/post_office_guide2.c | 14 ++--- src/rescue_password_menu.c | 3 +- src/save_menu.c | 2 +- src/string_format.c | 3 +- src/text.c | 102 +++++++++++++++------------------- src/thank_you_wonder_mail.c | 3 +- src/trade_items_menu.c | 3 +- src/unk_menu_203B360.c | 2 +- src/wigglytuff_shop1.c | 3 +- src/wigglytuff_shop2.c | 9 ++- src/wigglytuff_shop3.c | 6 +- src/wonder_mail.c | 3 +- src/wonder_mail_2.c | 2 +- src/wonder_mail_3_mid.c | 3 +- src/wonder_mail_4.c | 3 +- src/wonder_mail_5.c | 3 +- src/wonder_mail_6.c | 3 +- src/wonder_mail_802C10C.c | 3 +- src/wonder_mail_802C4C8.c | 3 +- src/wonder_mail_802C860.c | 3 +- src/wonder_mail_802CDD4.c | 3 +- src/wonder_mail_802D098.c | 5 +- src/wonder_mail_main_menu.c | 3 +- sym_ewram.txt | 28 ---------- 106 files changed, 280 insertions(+), 461 deletions(-) delete mode 100644 include/text1.h delete mode 100644 include/text2.h diff --git a/asm/code_800F990.s b/asm/code_800F990.s index 711c1a5d2..7288a737f 100644 --- a/asm/code_800F990.s +++ b/asm/code_800F990.s @@ -1942,9 +1942,9 @@ _0801089A: _080108FC: .4byte gUnknown_203B0E8 _08010900: .4byte 0x000052da _08010904: .4byte 0x000052d8 -_08010908: .4byte gFontTiles_202C038 +_08010908: .4byte gUnknown_202B038 + 0x1000 _0801090C: .4byte 0x00003114 -_08010910: .4byte gFontTilesExtra_202C838 +_08010910: .4byte gUnknown_202B038 + 0x1800 _08010914: .4byte 0x00001114 thumb_func_end sub_8010858 diff --git a/asm/code_8010F28.s b/asm/code_8010F28.s index cd3e4984e..77e7b5004 100644 --- a/asm/code_8010F28.s +++ b/asm/code_8010F28.s @@ -278,9 +278,9 @@ _080110F2: _08011150: .4byte gUnknown_203B0E4 _08011154: .4byte 0x00004dd6 _08011158: .4byte 0x00004dd4 -_0801115C: .4byte gFontTiles_202C038 +_0801115C: .4byte gUnknown_202B038 + 0x1000 _08011160: .4byte 0x00002014 -_08011164: .4byte gFontTilesExtra_202C838 +_08011164: .4byte gUnknown_202B038 + 0x1800 thumb_func_end sub_80110B0 thumb_func_start sub_8011168 diff --git a/include/text.h b/include/text.h index 2ddc3935d..ed0a2c19d 100644 --- a/include/text.h +++ b/include/text.h @@ -3,11 +3,64 @@ #include "structs/str_text.h" +// size: 0x10 +struct unkShiftData +{ + u32 bytesA; + u32 bytesB; + u32 shift_left; + u32 shift_right; +}; + +// size: 0xC +struct unkChar +{ + u16 *unk0; + u16 unk4; + s16 unk6; + u8 fill8; + u8 fill9; + u8 unkA; +}; + +struct unkStruct_80B8824 +{ + u32 arr[9]; +}; +struct unkStruct_80B8848 +{ + u32 arr[8]; +}; + struct UnkDrawStringStruct; +struct UnkDrawStringStruct +{ + s16 unk0; + s16 unk2; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; + s32 unkC; + u32 unk10; + u32 unk14; + u32 unk18; + u32 unk1C; + u8 unk20; + u8 unk21; + u8 fill22; + u8 fill23; + const u8* (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct*); + s32 unk28; + s32 unk2C; + s32 unk30; +}; + extern UnkTextStruct1 gUnknown_2027370[4]; extern u8 gUnknown_202749A[11]; extern bool8 gUnknown_20274A5; +extern u16 gUnknown_202B038[4][32][32]; // Usage points to these dimensions void LoadCharmaps(void); u32 UpdateFadeInTile(u32 a0); diff --git a/include/text1.h b/include/text1.h deleted file mode 100644 index 12e1835a1..000000000 --- a/include/text1.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef GUARD_TEXT1_H -#define GUARD_TEXT1_H - -#include "structs/str_text.h" - - -extern UnkTextStruct2 gUnknown_202AFC0[4]; -extern u32 gTextShadowMask; -extern u16 gUnknown_202B038[4][32][32]; // dimensions unknown... but usage points to these dimensions - -void LoadCharmaps(void); -void SelectCharmap(u32); -u32 UpdateFadeInTile(u32 a0); - -u32 sub_80063B0(void); -void xxx_call_save_unk_text_struct_800641C(const UnkTextStruct2 *a0, bool8 a1, bool8 a2); - -#endif // GUARD_TEXT1_H diff --git a/include/text2.h b/include/text2.h deleted file mode 100644 index 2f709116f..000000000 --- a/include/text2.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef GUARD_TEXT2_H -#define GUARD_TEXT2_H - -#include "structs/str_text.h" - -// size: 0x10 -struct unkShiftData -{ - u32 bytesA; - u32 bytesB; - u32 shift_left; - u32 shift_right; -}; - -// size: 0xC -struct unkChar -{ - u16 *unk0; - u16 unk4; - s16 unk6; - u8 fill8; - u8 fill9; - u8 unkA; -}; - -struct unkStruct_80B8824 -{ - u32 arr[9]; -}; -struct unkStruct_80B8848 -{ - u32 arr[8]; -}; - -u32 xxx_call_draw_char(s32, s32, u32, u32, u32); - -struct UnkDrawStringStruct; - -struct UnkDrawStringStruct -{ - s16 unk0; - s16 unk2; - s16 unk4; - s16 unk6; - s16 unk8; - s16 unkA; - s32 unkC; - u32 unk10; - u32 unk14; - u32 unk18; - u32 unk1C; - u8 unk20; - u8 unk21; - u8 fill22; - u8 fill23; - const u8* (*unk24)(const u8 *, const u8 *, struct UnkDrawStringStruct*); - s32 unk28; - s32 unk2C; - s32 unk30; -}; - - -void RestoreUnkTextStruct_8006518(UnkTextStruct2 *); -void sub_80073B8(s32); -void sub_80073E0(s32); -void sub_80078A4(u32, s32, s32, s32, u32); -void sub_800792C(u32, s32, s32, s32, u32); -void sub_8007A78(u32, s32, s32, s32, u32); -void sub_8007B7C(u32, s32, s32, s32, u32); -void sub_8007E20(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4, u32 *a5, u32 a6); -const u8 *xxx_get_next_char_from_string(const u8 *a1, u32 *a0); -const u8 *xxx_handle_format_global(const u8 *str, struct UnkDrawStringStruct *unkStrPtr); - -// text.s -extern const struct unkChar *GetCharacter(s32); -extern void InitGraphics(void); -void DisplayMonPortraitSpriteFlipped(s32 a0, const u8 *compressedData, s32 a1); -extern void CallPrepareTextbox_8008C54(u32); -extern s32 sub_8008ED0(const u8 *); -void PrintStringOnWindow2(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr, s32 lineSpacing); -void PrintStringOnWindow(s32 x, s32 y, const u8 *str, u32 windowId, u32 terminatingChr); - -#endif // GUARD_TEXT2_H diff --git a/src/adventure_log.c b/src/adventure_log.c index 427af9730..1b8f3fd21 100644 --- a/src/adventure_log.c +++ b/src/adventure_log.c @@ -8,8 +8,7 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/struct_sub80095e4.h" static EWRAM_DATA_2 struct_Sub80095E4_2 *sAdventureLog = {0}; @@ -151,4 +150,4 @@ static void DisplayAdventureLog(void) } sub_80073E0(sAdventureLog->s0.unk34); -} \ No newline at end of file +} diff --git a/src/adventure_log_menu.c b/src/adventure_log_menu.c index d05661ddc..b992c52c1 100644 --- a/src/adventure_log_menu.c +++ b/src/adventure_log_menu.c @@ -3,7 +3,7 @@ #include "adventure_log_menu.h" #include "constants/main_menu.h" #include "input.h" -#include "text1.h" +#include "text.h" void CreateAdventureLogMenu(void) { @@ -33,4 +33,4 @@ u32 UpdateAdventureLogMenu(void) break; } return nextMenu; -} \ No newline at end of file +} diff --git a/src/code_2.c b/src/code_2.c index 15f81e89a..504c999bb 100644 --- a/src/code_2.c +++ b/src/code_2.c @@ -28,20 +28,16 @@ #include "save_read.h" #include "save.h" #include "sprite.h" -#include "text1.h" -#include "text2.h" +#include "text.h" extern void NDS_LoadOverlay_GroundMain(void); extern void sub_8014144(void); extern void sub_800DAAC(void); extern void xxx_script_related_8001334(u32); extern void LoadTitleScreen(void); -extern void sub_80095CC(u32, u32); extern void nullsub_33(void); extern u32 sub_80009D0(u32); -extern void xxx_call_update_bg_vram(void); - extern u32 gUnknown_203B03C; extern u16 gUnknown_2026E4E; extern s32 gTitleBrightness; diff --git a/src/code_8009804.c b/src/code_8009804.c index 1e8bfbf95..344989031 100644 --- a/src/code_8009804.c +++ b/src/code_8009804.c @@ -3,7 +3,7 @@ #include "code_8009804.h" #include "cpu.h" #include "file_system.h" -#include "text1.h" +#include "text.h" extern const u8 gUnknown_80B88CC[]; extern const struct FileArchive gSystemFileArchive; // 8300500 diff --git a/src/code_8012A18_1.c b/src/code_8012A18_1.c index cc7070598..237597029 100644 --- a/src/code_8012A18_1.c +++ b/src/code_8012A18_1.c @@ -2,7 +2,7 @@ #include "code_8012A18_1.h" #include "sprite_oam.h" #include "text_util.h" -#include "text2.h" +#include "text.h" struct unkStruct_203B1FC { diff --git a/src/code_8015080.c b/src/code_8015080.c index 1fa82dec3..09b72b3fd 100644 --- a/src/code_8015080.c +++ b/src/code_8015080.c @@ -4,8 +4,8 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" struct unkStruct_203B1F8 { diff --git a/src/code_801602C.c b/src/code_801602C.c index 8bfef832a..e32492bda 100644 --- a/src/code_801602C.c +++ b/src/code_801602C.c @@ -7,7 +7,7 @@ #include "input.h" #include "memory.h" #include "text_util.h" -#include "text1.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B200 *sUnknown_203B200 = {0}; diff --git a/src/code_801B3C0.c b/src/code_801B3C0.c index 6d559d2dd..f3acc6a75 100644 --- a/src/code_801B3C0.c +++ b/src/code_801B3C0.c @@ -8,8 +8,8 @@ #include "memory.h" #include "menu_input.h" #include "sprite.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B230 *sUnknown_203B230 = {0}; diff --git a/src/code_801B60C.c b/src/code_801B60C.c index 985e814e8..25852dc09 100644 --- a/src/code_801B60C.c +++ b/src/code_801B60C.c @@ -14,8 +14,8 @@ #include "memory.h" #include "menu_input.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B234 *sUnknown_203B234 = {0}; diff --git a/src/code_801C8C4.c b/src/code_801C8C4.c index 0d18fccef..f3fbb6adf 100644 --- a/src/code_801C8C4.c +++ b/src/code_801C8C4.c @@ -6,8 +6,8 @@ #include "items.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B244 *sUnknown_203B244 = {0}; static EWRAM_DATA_2 u32 sUnknown_203B248 = {0}; diff --git a/src/code_801D014.c b/src/code_801D014.c index 3a524e986..a09e5f25c 100644 --- a/src/code_801D014.c +++ b/src/code_801D014.c @@ -24,8 +24,8 @@ #include "options_menu1.h" #include "party_list_menu.h" #include "rescue_team_info.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" #include "wigglytuff_shop2.h" #include "wonder_mail_802C4C8.h" #include "wonder_mail_802C860.h" diff --git a/src/code_801D9E4.c b/src/code_801D9E4.c index 7637cb31f..d8e545ad7 100644 --- a/src/code_801D9E4.c +++ b/src/code_801D9E4.c @@ -7,8 +7,8 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" #include "structs/struct_sub80095e4.h" static EWRAM_DATA_2 struct struct_Sub80095E4_2 *sUnknown_203B258 = {0}; diff --git a/src/code_801EE10.c b/src/code_801EE10.c index af0bff97f..a38a184f6 100644 --- a/src/code_801EE10.c +++ b/src/code_801EE10.c @@ -4,8 +4,8 @@ #include "input.h" #include "items.h" #include "text.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" #include "memory.h" #include "moves.h" #include "code_801EE10.h" diff --git a/src/code_801F428.c b/src/code_801F428.c index 3a6a84cf9..866af7e2f 100644 --- a/src/code_801F428.c +++ b/src/code_801F428.c @@ -7,8 +7,8 @@ #include "menu_input.h" #include "moves.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" #include "structs/struct_sub80095e4.h" struct unkStruct_203B274 diff --git a/src/code_801F808.c b/src/code_801F808.c index d102a4e8c..848646e73 100644 --- a/src/code_801F808.c +++ b/src/code_801F808.c @@ -9,8 +9,8 @@ #include "sprite.h" #include "structs/menu.h" #include "structs/str_text.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" // TODO: UNIFY WITH struct_Sub80095E4 struct unkStruct_203B278 diff --git a/src/code_80227B8.c b/src/code_80227B8.c index 0c87ef4f1..ae22ae27a 100644 --- a/src/code_80227B8.c +++ b/src/code_80227B8.c @@ -14,8 +14,8 @@ #include "memory.h" #include "menu_input.h" #include "pokemon_3.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B294 *sUnknown_203B294 = {0}; diff --git a/src/code_8023144.c b/src/code_8023144.c index 8a697e16e..9a31c0f3e 100644 --- a/src/code_8023144.c +++ b/src/code_8023144.c @@ -11,8 +11,8 @@ #include "memory.h" #include "menu_input.h" #include "pokemon_3.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" static EWRAM_DATA_2 u32 gUnknown_203B298 = {0}; static EWRAM_DATA_2 u16 gUnknown_203B29C = {0}; diff --git a/src/code_8024458.c b/src/code_8024458.c index 7a20fbf8a..af261d93b 100644 --- a/src/code_8024458.c +++ b/src/code_8024458.c @@ -9,8 +9,8 @@ #include "menu_input.h" #include "pokemon.h" #include "pokemon_3.h" -#include "text1.h" -#include "text2.h" +#include "text.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B2AC *sUnknown_203B2AC = {0}; diff --git a/src/code_802DB28.c b/src/code_802DB28.c index d50cf01ed..ac45cfda9 100644 --- a/src/code_802DB28.c +++ b/src/code_802DB28.c @@ -10,10 +10,7 @@ #include "items.h" #include "memory.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" - -extern u8 gSpeakerNameBuffer[]; +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B2FC *sUnknown_203B2FC = {0}; diff --git a/src/code_802DE84.c b/src/code_802DE84.c index 4b6481677..5b502fe63 100644 --- a/src/code_802DE84.c +++ b/src/code_802DE84.c @@ -6,8 +6,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon_mail.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B300 *sUnknown_203B300 = {0}; @@ -72,4 +71,4 @@ static void sub_802DF88(void) sub_80073B8(sUnknown_203B300->unk10); CreateRescueDescription(sUnknown_203B300->mail); sub_80073E0(sUnknown_203B300->unk10); -} \ No newline at end of file +} diff --git a/src/code_8031D70.c b/src/code_8031D70.c index 3eac74889..3903193d4 100644 --- a/src/code_8031D70.c +++ b/src/code_8031D70.c @@ -5,8 +5,7 @@ #include "code_803D0D8.h" #include "input.h" #include "memory.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/str_dungeon.h" #include "pokemon.h" #include "code_8094F88.h" diff --git a/src/code_803E724.c b/src/code_803E724.c index b6a9ca081..0941d6d0a 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -3,7 +3,7 @@ #include "bg_palette_buffer.h" #include "code_8004AA0.h" #include "input.h" -#include "text1.h" +#include "text.h" #include "code_801602C.h" #include "menu_input.h" #include "code_8009804.h" diff --git a/src/code_8042B34.c b/src/code_8042B34.c index c7836fcce..018884f7d 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -21,7 +21,7 @@ #include "dungeon_random.h" #include "code_8009804.h" #include "tile_types.h" -#include "text1.h" +#include "text.h" #include "code_805D8C8.h" #include "code_803E668.h" #include "dungeon_engine.h" @@ -330,7 +330,6 @@ extern void nullsub_16(void); extern void sub_80521D0(void); extern void sub_803F27C(u8); extern void sub_807E7FC(u8); -extern void sub_80095CC(u32, u32); extern bool8 IsLevelResetTo1(u8 dungeon); extern void sub_8068A84(PokemonStruct1 *pokemon); extern void sub_807EAA0(u32, u32); diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 0e3a64e79..78d6643ac 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -36,8 +36,6 @@ #include "items.h" #include "play_time.h" #include "pokemon_3.h" -#include "text2.h" -#include "text1.h" #include "text.h" #include "code_806CD90.h" #include "code_8044CC8.h" diff --git a/src/code_8072F3C.c b/src/code_8072F3C.c index 919548020..48473590d 100644 --- a/src/code_8072F3C.c +++ b/src/code_8072F3C.c @@ -7,8 +7,7 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/struct_sub80095e4.h" diff --git a/src/code_809447C.c b/src/code_809447C.c index f9836398c..ef470d52c 100644 --- a/src/code_809447C.c +++ b/src/code_809447C.c @@ -7,7 +7,7 @@ #include "items.h" #include "moves.h" #include "text_util.h" -#include "text2.h" +#include "text.h" struct unkStruct_8113080 { diff --git a/src/code_809A560.c b/src/code_809A560.c index e627f8dbc..b365cb808 100644 --- a/src/code_809A560.c +++ b/src/code_809A560.c @@ -1,5 +1,5 @@ #include "global.h" -#include "text1.h" +#include "text.h" #include "memory.h" #include "string_format.h" #include "structs/str_3001B64.h" @@ -13,8 +13,6 @@ extern u8 gInvalidityText[]; extern u8 ScriptPrintText_809B2B8(u32 *, u32, u32, u32); extern u32 IsTextboxOpen_809B40C(u32 *); extern void sub_801416C(s32, s32); -extern void sub_80095CC(u32, u32); -extern void sub_8009408(u32, u32); extern void ResetTextbox_809B294(void); extern void sub_8014144(void); diff --git a/src/code_8272724.c b/src/code_8272724.c index 18f632da8..6f08e8c5a 100644 --- a/src/code_8272724.c +++ b/src/code_8272724.c @@ -1,5 +1,5 @@ #include "global.h" -#include "text1.h" +#include "text.h" #include "text.h" extern void sub_8272774(UnkTextStruct1 *r0, u32 r1); diff --git a/src/credits1.c b/src/credits1.c index 006c847e4..8e66b3580 100644 --- a/src/credits1.c +++ b/src/credits1.c @@ -4,8 +4,7 @@ #include "event_flag.h" #include "input.h" #include "memory.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 Credits1Work *sCredits1Work = {0}; @@ -138,4 +137,4 @@ void sub_803565C(void) MemoryFree(sCredits1Work); sCredits1Work = NULL; } -} \ No newline at end of file +} diff --git a/src/debug_menu1.c b/src/debug_menu1.c index 0bc5193a2..8a6037dcf 100644 --- a/src/debug_menu1.c +++ b/src/debug_menu1.c @@ -13,7 +13,7 @@ #include "pokemon.h" #include "save.h" #include "text_util.h" -#include "text1.h" +#include "text.h" enum DebugMenuOptions { diff --git a/src/debug_menu2.c b/src/debug_menu2.c index 82e2acdc4..17da741d4 100644 --- a/src/debug_menu2.c +++ b/src/debug_menu2.c @@ -8,8 +8,7 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B3F0 *sUnknown_203B3F0 = {0}; diff --git a/src/debug_menu3.c b/src/debug_menu3.c index 503463c72..2d5ac1a5d 100644 --- a/src/debug_menu3.c +++ b/src/debug_menu3.c @@ -8,8 +8,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wigglytuff_shop1.h" #include "wigglytuff_shop2.h" @@ -217,7 +216,7 @@ static bool8 sub_803ABC8(void) PokemonStruct1 *mon; s32 i; s32 mask; - + for (i = 0, mask = 1; i < NUM_MONSTERS; i++) { // Some check was optimized out. Needed for matching. Thanks kaz if (i) { diff --git a/src/debug_menu4.c b/src/debug_menu4.c index 3810d2339..acdb448ce 100644 --- a/src/debug_menu4.c +++ b/src/debug_menu4.c @@ -7,8 +7,7 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B3F8 *sUnknown_203B3F8 = {0}; diff --git a/src/ds_menus.c b/src/ds_menus.c index d1d73243d..d5a75f547 100644 --- a/src/ds_menus.c +++ b/src/ds_menus.c @@ -1,6 +1,6 @@ #include "global.h" #include "input.h" -#include "text1.h" +#include "text.h" u32 CreateDualSlotMenu(void) { diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 7977d334d..15bbe2fb7 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -7,7 +7,7 @@ #include "structs/str_dungeon.h" #include "tile_types.h" #include "random.h" -#include "text1.h" +#include "text.h" #include "dungeon_engine.h" #include "dungeon_movement.h" #include "dungeon_leader.h" diff --git a/src/dungeon_message.c b/src/dungeon_message.c index a1c2ce43c..544a447b2 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -10,7 +10,6 @@ #include "code_803E668.h" #include "bg_palette_buffer.h" #include "input.h" -#include "text2.h" #include "pokemon.h" #include "file_system.h" #include "dungeon_util_1.h" @@ -19,7 +18,6 @@ #include "code_8045A00.h" #include "exclusive_pokemon.h" #include "dungeon_leader.h" -#include "text1.h" #include "text.h" void sub_80526D0(s32 r0); diff --git a/src/felicity_bank.c b/src/felicity_bank.c index fcfbbe66b..e571720e1 100644 --- a/src/felicity_bank.c +++ b/src/felicity_bank.c @@ -8,13 +8,10 @@ #include "memory.h" #include "menu_input.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 FelicityBankWork *sFelicityBankWork = {0}; -extern u8 gSpeakerNameBuffer[]; - #include "data/felicity_bank.h" static void CreateFelicityBankShopMenu(void); diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index b42239df7..399846252 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -21,8 +21,7 @@ #include "moves.h" #include "pokemon.h" #include "sprite.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B2BC *sUnknown_203B2BC = {0}; diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index b0d612096..70796aa72 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -23,8 +23,7 @@ #include "menu_input.h" #include "moves.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" +#include "text.h" EWRAM_DATA_2 unkStruct_203B2B4 *gUnknown_203B2B4 = {0}; diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 7cf839a8b..1a87caf00 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -23,8 +23,7 @@ #include "save_write.h" #include "rescue_password_menu.h" #include "text_util.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wonder_mail_4.h" #include "wonder_mail_5.h" diff --git a/src/gulpin_shop.c b/src/gulpin_shop.c index 8c036ee9d..8be813358 100644 --- a/src/gulpin_shop.c +++ b/src/gulpin_shop.c @@ -11,8 +11,7 @@ #include "memory.h" #include "menu_input.h" #include "moves.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 GulpinShopWork *sGulpinShopWork = {0}; diff --git a/src/gulpin_shop_801FB50.c b/src/gulpin_shop_801FB50.c index 88fa01c0a..7759c94b0 100644 --- a/src/gulpin_shop_801FB50.c +++ b/src/gulpin_shop_801FB50.c @@ -17,13 +17,10 @@ #include "moves.h" #include "pokemon_3.h" #include "pokemon_mid.h" -#include "text1.h" -#include "text2.h" +#include "text.h" EWRAM_DATA_2 unkStruct_203B27C *gUnknown_203B27C = {0}; -extern u8 gSpeakerNameBuffer[]; - #include "data/gulpin_shop_801FB50.h" enum menuActions { diff --git a/src/hints_menu1.c b/src/hints_menu1.c index 45d49ce19..aaa79b90b 100644 --- a/src/hints_menu1.c +++ b/src/hints_menu1.c @@ -6,8 +6,7 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/struct_sub80095e4.h" static EWRAM_DATA_2 struct_Sub80095E4 *sUnknown_203B264 = {0}; diff --git a/src/hints_menu2.c b/src/hints_menu2.c index a67422ae9..7c05d2472 100644 --- a/src/hints_menu2.c +++ b/src/hints_menu2.c @@ -6,8 +6,7 @@ #include "input.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/struct_sub80095e4.h" static EWRAM_DATA_2 struct_Sub80095E4_2 *sUnknown_203B268 = {0}; diff --git a/src/iq_skill_info_menu.c b/src/iq_skill_info_menu.c index 46d3d7c04..66142d3d2 100644 --- a/src/iq_skill_info_menu.c +++ b/src/iq_skill_info_menu.c @@ -9,8 +9,7 @@ #include "menu_input.h" #include "pokemon_3.h" #include "sprite.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct IQSkillInfoMenu *sIQSkillInfoMenu = {0}; diff --git a/src/iq_skill_list_menu.c b/src/iq_skill_list_menu.c index ab44d4e10..fa684fcb6 100644 --- a/src/iq_skill_list_menu.c +++ b/src/iq_skill_list_menu.c @@ -8,8 +8,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon_3.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct IQSkillListMenu *sIQSkillListMenu = {0}; diff --git a/src/iq_skill_menu.c b/src/iq_skill_menu.c index 1857d7a98..0a90295d3 100644 --- a/src/iq_skill_menu.c +++ b/src/iq_skill_menu.c @@ -9,8 +9,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon_3.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct IQSkillMenu *sIQSkillMenu = {0}; diff --git a/src/items.c b/src/items.c index ab06357de..b7b44fa92 100644 --- a/src/items.c +++ b/src/items.c @@ -9,7 +9,7 @@ #include "random.h" #include "code_800D090.h" #include "text_util.h" -#include "text2.h" +#include "text.h" #include "string_format.h" #include diff --git a/src/kangaskhan_storage1.c b/src/kangaskhan_storage1.c index 25cf93b93..bf6a4a08e 100644 --- a/src/kangaskhan_storage1.c +++ b/src/kangaskhan_storage1.c @@ -11,10 +11,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" - -extern u8 gSpeakerNameBuffer[]; +#include "text.h" EWRAM_DATA_2 struct KangaskhanStorageWork *gKangaskhanStorageWork = {0}; diff --git a/src/kangaskhan_storage2.c b/src/kangaskhan_storage2.c index d68bec80f..1989f52ec 100644 --- a/src/kangaskhan_storage2.c +++ b/src/kangaskhan_storage2.c @@ -10,8 +10,7 @@ #include "kecleon_bros4.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B20C *sUnknown_203B20C = {0}; diff --git a/src/kecleon_bros1.c b/src/kecleon_bros1.c index 093f976b0..d4e8eb169 100644 --- a/src/kecleon_bros1.c +++ b/src/kecleon_bros1.c @@ -15,10 +15,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" - -extern u8 gSpeakerNameBuffer[]; +#include "text.h" static EWRAM_DATA_2 KecleonBrosWork1 *sKecleonBrosWork1 = {0}; diff --git a/src/kecleon_bros2.c b/src/kecleon_bros2.c index ec88cba65..1389f1331 100644 --- a/src/kecleon_bros2.c +++ b/src/kecleon_bros2.c @@ -8,8 +8,7 @@ #include "kecleon_bros2.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/struct_sub80095e4.h" static EWRAM_DATA_2 struct_Sub80095E4_2 *gUnknown_203B214 = {0}; diff --git a/src/kecleon_bros3.c b/src/kecleon_bros3.c index 7186db004..a64ca4f7c 100644 --- a/src/kecleon_bros3.c +++ b/src/kecleon_bros3.c @@ -8,8 +8,7 @@ #include "kecleon_bros3.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/struct_sub80095e4.h" static EWRAM_DATA_2 struct_Sub80095E4_2 *gUnknown_203B21C = {0}; diff --git a/src/kecleon_bros4.c b/src/kecleon_bros4.c index 2f2dc1046..7e018a1ba 100644 --- a/src/kecleon_bros4.c +++ b/src/kecleon_bros4.c @@ -10,8 +10,7 @@ #include "kecleon_bros4.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B224 *gUnknown_203B224 = {0}; static EWRAM_DATA_2 u16 gUnknown_203B228 = {0}; diff --git a/src/load_screen.c b/src/load_screen.c index cd2094511..6e5666184 100644 --- a/src/load_screen.c +++ b/src/load_screen.c @@ -20,8 +20,7 @@ #include "pokemon.h" #include "save.h" #include "text_util.h" -#include "text1.h" -#include "text2.h" +#include "text.h" extern const struct FileArchive gTitleMenuFileArchive; diff --git a/src/luminous_cave.c b/src/luminous_cave.c index ba2b86f06..fe4c0ea94 100644 --- a/src/luminous_cave.c +++ b/src/luminous_cave.c @@ -19,8 +19,7 @@ #include "pokemon.h" #include "random.h" #include "text_util.h" -#include "text1.h" -#include "text2.h" +#include "text.h" enum { diff --git a/src/mailbox.c b/src/mailbox.c index 2f73fc6bb..2e1b65946 100644 --- a/src/mailbox.c +++ b/src/mailbox.c @@ -3,8 +3,7 @@ #include "code_802DE84.h" #include "common_strings.h" #include "memory.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/menu.h" #include "input.h" #include "mailbox.h" diff --git a/src/main.c b/src/main.c index 8e1ef8031..b69004a30 100644 --- a/src/main.c +++ b/src/main.c @@ -14,8 +14,7 @@ #include "random.h" #include "reg_control.h" #include "sprite.h" -#include "text1.h" -#include "text2.h" +#include "text.h" EWRAM_DATA u8 IntrMain_Buffer[0x120] = {0}; EWRAM_DATA IntrCallback gIntrTable[6] = {0}; @@ -41,6 +40,7 @@ extern const IntrCallback gInitialIntrTable[6]; // code_2.c extern void GameLoop(void); +extern void InitGraphics(void); // code_800D090.c extern void Hang(void); extern void sub_800D6AC(void); @@ -128,11 +128,11 @@ void sub_800B540(void) REG_IE ^= INTR_FLAG_TIMER3 | INTR_FLAG_VBLANK | INTR_FLAG_VCOUNT; // 0x45 - *(u8*)®_DISPCNT |= DISPCNT_FORCED_BLANK; + *(u8*)®_DISPCNT |= DISPCNT_FORCED_BLANK; InitIntrTable(gInitialIntrTable); // set up intrrupt vector/table - REG_TM3CNT = (TIMER_64CLK | TIMER_INTR_ENABLE | TIMER_ENABLE) << 16; + REG_TM3CNT = (TIMER_64CLK | TIMER_INTR_ENABLE | TIMER_ENABLE) << 16; REG_IE |= INTR_FLAG_GAMEPAK | INTR_FLAG_TIMER3 | INTR_FLAG_VCOUNT | INTR_FLAG_VBLANK; // 0x2045 REG_DISPSTAT = DISPSTAT_VCOUNT_INTR | DISPSTAT_VBLANK_INTR; @@ -216,4 +216,4 @@ IntrCallback SetInterruptCallback(u32 index, IntrCallback new_callback) EnableInterrupts(); return old_callback; -} \ No newline at end of file +} diff --git a/src/main_menu1.c b/src/main_menu1.c index 521af94bb..1f9f55b6b 100644 --- a/src/main_menu1.c +++ b/src/main_menu1.c @@ -17,8 +17,7 @@ #include "other_menus1.h" #include "rescue_password_menu.h" #include "save_menu.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "trade_items_menu.h" #include "unk_menu_203B360.h" #include "wonder_mail_main_menu.h" diff --git a/src/main_menu2.c b/src/main_menu2.c index 19efb509e..5b26740c9 100644 --- a/src/main_menu2.c +++ b/src/main_menu2.c @@ -9,7 +9,7 @@ #include "memory.h" #include "menu_input.h" #include "save.h" -#include "text1.h" +#include "text.h" static EWRAM_DATA_2 MainMenu2Work *sUnknown_203B34C = {0}; static EWRAM_DATA_2 u32 sUnknown_203B350 = {0}; diff --git a/src/makuhita_dojo1.c b/src/makuhita_dojo1.c index 906e80ea7..d6ac388b4 100644 --- a/src/makuhita_dojo1.c +++ b/src/makuhita_dojo1.c @@ -12,10 +12,7 @@ #include "makuhita_dojo2.h" #include "memory.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" - -extern u8 gSpeakerNameBuffer[]; +#include "text.h" static EWRAM_DATA_2 MakuhitaDojoWork1 *sMakuhitaDojoWork1 = {0}; diff --git a/src/makuhita_dojo2.c b/src/makuhita_dojo2.c index 88b0c4dfa..289641f01 100644 --- a/src/makuhita_dojo2.c +++ b/src/makuhita_dojo2.c @@ -11,8 +11,7 @@ #include "makuhita_dojo2.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 MakuhitaDojoWork2 *sMakuhitaDojoWork2 = {0}; diff --git a/src/menu_input.c b/src/menu_input.c index e3a5fb6e0..69c6905d5 100644 --- a/src/menu_input.c +++ b/src/menu_input.c @@ -10,8 +10,6 @@ #include "menu_input.h" #include "sprite.h" #include "text_util.h" -#include "text1.h" -#include "text2.h" #include "text.h" #include "util.h" #include "structs/struct_sub80095e4.h" diff --git a/src/mission_reward.c b/src/mission_reward.c index 381fac5e6..15c0f98f4 100644 --- a/src/mission_reward.c +++ b/src/mission_reward.c @@ -11,8 +11,7 @@ #include "string_format.h" #include "code_80118A4.h" #include "code_801B60C.h" -#include "text1.h" -#include "text2.h" +#include "text.h" struct unkStruct_203B310 { diff --git a/src/moves.c b/src/moves.c index 51575a94a..66ac8ef5e 100644 --- a/src/moves.c +++ b/src/moves.c @@ -8,7 +8,7 @@ #include "memory.h" #include "moves.h" #include "text_util.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA OpenedFile *sWazaParametersFile = {0}; static EWRAM_DATA MoveDataEntry *sMovesData = {0}; diff --git a/src/options_menu1.c b/src/options_menu1.c index 6e8682c06..9044fdf04 100644 --- a/src/options_menu1.c +++ b/src/options_menu1.c @@ -10,8 +10,7 @@ #include "menu_input.h" #include "options_menu1.h" #include "options_menu2.h" -#include "text1.h" -#include "text2.h" +#include "text.h" enum { @@ -309,4 +308,4 @@ static void HandleChangeSettingsMenu(void) SetOptionsMenuState(OPTIONS_MENU_MAIN); break; } -} \ No newline at end of file +} diff --git a/src/options_menu2.c b/src/options_menu2.c index 6037937da..afc930945 100644 --- a/src/options_menu2.c +++ b/src/options_menu2.c @@ -7,8 +7,7 @@ #include "memory.h" #include "menu_input.h" #include "options_menu2.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B260 *sUnknown_203B260 = {0}; @@ -124,4 +123,4 @@ static void CreateOptionsMenu(void) } sub_80073E0(sUnknown_203B260->unk44); -} \ No newline at end of file +} diff --git a/src/other_menus1.c b/src/other_menus1.c index 9d29f3ec5..4ef2b0ad9 100644 --- a/src/other_menus1.c +++ b/src/other_menus1.c @@ -16,7 +16,7 @@ #include "other_menus1.h" #include "other_menus2.h" #include "sprite.h" -#include "text1.h" +#include "text.h" // TODO: MAKE STATIC WHEN other_menus1.s IS DED EWRAM_DATA_2 unkStruct_203B35C *sUnknown_203B35C = {0}; @@ -26,8 +26,6 @@ EWRAM_DATA_2 unkStruct_203B35C *sUnknown_203B35C = {0}; // other_menus1.s extern void sub_8037810(void); extern void sub_8037900(void); -// text.s -extern void xxx_call_update_bg_vram(); // other_menus2.s extern s32 sub_8037B28(u32); diff --git a/src/party_list_menu.c b/src/party_list_menu.c index 26297d0db..c29350bbe 100644 --- a/src/party_list_menu.c +++ b/src/party_list_menu.c @@ -23,8 +23,7 @@ #include "party_list_menu.h" #include "pokemon.h" #include "text_util.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 unkStruct_203B2B8 *sUnknown_203B2B8 = {0}; diff --git a/src/pelipper_board.c b/src/pelipper_board.c index ec7c65f29..8ce19a7e3 100644 --- a/src/pelipper_board.c +++ b/src/pelipper_board.c @@ -5,8 +5,7 @@ #include "pokemon.h" #include "items.h" #include "memory.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/menu.h" #include "input.h" #include "menu_input.h" @@ -230,7 +229,7 @@ void CreatePelipperBoardMenu(void) { gPelipperBoard->unkFC[loopMax] = 1; } - + loopMax += 1; gPelipperBoard->menuItems[loopMax].text = NULL; gPelipperBoard->menuItems[loopMax].menuAction = PELIPPER_BOARD_NULL; @@ -255,7 +254,7 @@ void CreatePelipperBoardMenu(void) void sub_802EC10(void) { s32 index; - s32 loopMax = 0; + s32 loopMax = 0; gPelipperBoard->menuItems[loopMax].text = gCommonAccept[0]; gPelipperBoard->menuItems[loopMax].menuAction = PELIPPER_BOARD_ACCEPT; diff --git a/src/personality_test1.c b/src/personality_test1.c index a1caa9f23..63ebb82f5 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -16,8 +16,7 @@ #include "random.h" #include "save.h" #include "text_util.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "string_format.h" enum diff --git a/src/personality_test2.c b/src/personality_test2.c index b6d030376..cd6284fef 100644 --- a/src/personality_test2.c +++ b/src/personality_test2.c @@ -10,8 +10,7 @@ #include "menu_input.h" #include "personality_test2.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "string_format.h" EWRAM_DATA_2 struct PersonalityStruct_203B404 *gUnknown_203B404 = {0}; diff --git a/src/pokemon_mail.c b/src/pokemon_mail.c index 9eda24164..eb8c6e449 100644 --- a/src/pokemon_mail.c +++ b/src/pokemon_mail.c @@ -15,10 +15,8 @@ #include "pokemon_mail.h" #include "pokemon_mail_pre.h" #include "text_util.h" -#include "text2.h" - -extern u8 gFormatBuffer_Items[]; -extern u8 gFormatBuffer_Monsters[]; // 202DF98 +#include "text.h" +#include "string_format.h" #include "data/pokemon_mail.h" @@ -57,13 +55,13 @@ void CreateRescueTitle(unkStruct_802C39C *param_1) PrintStringOnWindow(21, param_1->y, buf_1, param_1->unk0[0], 0); break; case 12: - BufferItemName(gFormatBuffer_Items, param_1->targetItem, NULL); - sprintfStatic(buf_1, gUnknown_80E8830, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->targetItem, NULL); + sprintfStatic(buf_1, gUnknown_80E8830, gFormatBuffer_Items[0]); PrintStringOnWindow(21, param_1->y, buf_1, param_1->unk0[0], 0); break; case 11: - BufferItemName(gFormatBuffer_Items, param_1->targetItem, NULL); - sprintfStatic(buf_1, gUnknown_80E8848, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->targetItem, NULL); + sprintfStatic(buf_1, gUnknown_80E8848, gFormatBuffer_Items[0]); PrintStringOnWindow(21, param_1->y, buf_1, param_1->unk0[0], 0); break; case 4: @@ -78,24 +76,24 @@ void CreateRescueTitle(unkStruct_802C39C *param_1) case 10: { u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80EAE5C[bVar2 % 4], gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80EAE5C[bVar2 % 4], gFormatBuffer_Monsters[0]); PrintStringOnWindow(21, param_1->y, buf_1, param_1->unk0[0], 0); break; } case 9: { u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80E910C[bVar2 % 10], gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80E910C[bVar2 % 10], gFormatBuffer_Monsters[0]); PrintStringOnWindow(21, param_1->y, buf_1, param_1->unk0[0], 0); break; } default: { u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80E8C98[bVar2 % 15], gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80E8C98[bVar2 % 15], gFormatBuffer_Monsters[0]); PrintStringOnWindow(21, param_1->y, buf_1, param_1->unk0[0], 0); break; } @@ -163,13 +161,13 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) PrintStringOnWindow(10, y, gMedichamMissionDescription, param_1->unk0[0], 0); break; case 4: - BufferItemName(gFormatBuffer_Items, param_1->targetItem, NULL); - sprintfStatic(buf_1, gUnknown_80E8968, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->targetItem, NULL); + sprintfStatic(buf_1, gUnknown_80E8968, gFormatBuffer_Items[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); break; case 5: - BufferItemName(gFormatBuffer_Items, param_1->targetItem, NULL); - sprintfStatic(buf_1, gUnknown_80E89B0, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->targetItem, NULL); + sprintfStatic(buf_1, gUnknown_80E89B0, gFormatBuffer_Items[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); break; case 6: @@ -177,8 +175,8 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) break; case 7: monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80E9F8C[param_1->unk0[1]].text, gFormatBuffer_Monsters, gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80E9F8C[param_1->unk0[1]].text, gFormatBuffer_Monsters[0], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); break; case 9: @@ -194,12 +192,12 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) case 16: { u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; u8 bVar3 = param_1->unk8->seed + param_1->unk8->dungeon.floor; - BufferItemName(gFormatBuffer_Items, param_1->targetItem, NULL); - sprintfStatic(buf_1, gUnknown_80EB3F8[bVar2 % 22], gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->targetItem, NULL); + sprintfStatic(buf_1, gUnknown_80EB3F8[bVar2 % 22], gFormatBuffer_Items[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y += 12; - sprintfStatic(buf_1, gUnknown_80EB72C[bVar3 % 22], gFormatBuffer_Items); + sprintfStatic(buf_1, gUnknown_80EB72C[bVar3 % 22], gFormatBuffer_Items[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y -= 12; break; @@ -208,12 +206,12 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; u8 bVar3 = param_1->unk8->seed + param_1->unk8->dungeon.floor; monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80EAEB8[bVar2 % 20], gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80EAEB8[bVar2 % 20], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y += 12; - sprintfStatic(buf_1, gUnknown_80EB198[bVar3 % 4], gFormatBuffer_Monsters); + sprintfStatic(buf_1, gUnknown_80EB198[bVar3 % 4], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y -= 12; break; @@ -222,12 +220,12 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; u8 bVar3 = param_1->unk8->seed + param_1->unk8->dungeon.floor; monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80EB220[bVar2 % 6], gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80EB220[bVar2 % 6], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y += 12; - sprintfStatic(buf_1, gUnknown_80EB2F0[bVar3 % 6], gFormatBuffer_Monsters); + sprintfStatic(buf_1, gUnknown_80EB2F0[bVar3 % 6], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y -= 12; break; @@ -236,12 +234,12 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; u8 bVar3 = param_1->unk8->seed + param_1->unk8->dungeon.floor; monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80E91D4[bVar2 % 45], gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80E91D4[bVar2 % 45], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y += 12; - sprintfStatic(buf_1, gUnknown_80E9820[bVar3 % 10], gFormatBuffer_Monsters); + sprintfStatic(buf_1, gUnknown_80E9820[bVar3 % 10], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y -= 12; break; @@ -250,12 +248,12 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) u8 bVar2 = param_1->unk8->seed + param_1->unk8->dungeon.id; u8 bVar3 = param_1->unk8->seed + param_1->unk8->dungeon.floor; monName = GetMonSpecies(param_1->clientSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80E8DE4[bVar2 % 13], gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80E8DE4[bVar2 % 13], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y += 12; - sprintfStatic(buf_1, gUnknown_80E8FB0[bVar3 % 13], gFormatBuffer_Monsters); + sprintfStatic(buf_1, gUnknown_80E8FB0[bVar3 % 13], gFormatBuffer_Monsters[0]); PrintStringOnWindow(10, y, buf_1, param_1->unk0[0], 0); y -= 12; break; @@ -282,13 +280,13 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) PrintStringOnWindow(68, y, gUnknown_80E8AEC, param_1->unk0[0], 0); break; case MISSION_TYPE_DELIVER_ITEM: - BufferItemName(gFormatBuffer_Items, param_1->targetItem, NULL); - sprintfStatic(buf_1, gUnknown_80E8AFC, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->targetItem, NULL); + sprintfStatic(buf_1, gUnknown_80E8AFC, gFormatBuffer_Items[0]); PrintStringOnWindow(68, y, buf_1, param_1->unk0[0], 0); break; case MISSION_TYPE_FIND_ITEM: - BufferItemName(gFormatBuffer_Items, param_1->targetItem, NULL); - sprintfStatic(buf_1, gUnknown_80E8B10, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->targetItem, NULL); + sprintfStatic(buf_1, gUnknown_80E8B10, gFormatBuffer_Items[0]); PrintStringOnWindow(68, y, buf_1, param_1->unk0[0], 0); break; case MISSION_TYPE_RESCUE_CLIENT: @@ -296,14 +294,14 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) break; case MISSION_TYPE_ESCORT_CLIENT: monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80E8B2C, gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80E8B2C, gFormatBuffer_Monsters[0]); PrintStringOnWindow(68, y, buf_1, param_1->unk0[0], 0); break; case MISSION_TYPE_RESCUE_TARGET: monName = GetMonSpecies(param_1->targetSpecies); - strcpy(gFormatBuffer_Monsters, monName); - sprintfStatic(buf_1, gUnknown_80E8B40, gFormatBuffer_Monsters); + strcpy(gFormatBuffer_Monsters[0], monName); + sprintfStatic(buf_1, gUnknown_80E8B40, gFormatBuffer_Monsters[0]); PrintStringOnWindow(68, y, buf_1, param_1->unk0[0], 0); break; case MISSION_TYPE_SPECIAL_MISSION: @@ -314,7 +312,7 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) y += 12; PrintStringOnWindow(10, y, gPlaceText, param_1->unk0[0], 0); - + if (param_1->mailMissionType == MISSION_TYPE_FIND_ITEM) { PrintDungeonLocationtoBuffer(buf_5, ¶m_1->unk8->dungeon); sprintfStatic(buf_1, gUnknown_80E8884, buf_5); @@ -347,14 +345,14 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) break; case ITEM: // Item case ITEM_EXTRA: // Item + ? - BufferItemName(gFormatBuffer_Items, param_1->rewardItem, NULL); - sprintfStatic(buf_1, gMissionRewardText[param_1->rewardType], gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], param_1->rewardItem, NULL); + sprintfStatic(buf_1, gMissionRewardText[param_1->rewardType], gFormatBuffer_Items[0]); PrintStringOnWindow(68, y, buf_1, param_1->unk0[0], 0); break; case 4: // Friend Area PrintStringOnWindow(68, y, gMissionRewardText[param_1->rewardType], param_1->unk0[0], 0); break; - default: + default: PrintStringOnWindow(68, y, gMissionRewardText[param_1->rewardType], param_1->unk0[0], 0); break; } diff --git a/src/pokemon_news1.c b/src/pokemon_news1.c index 792a055f9..a56f66db9 100644 --- a/src/pokemon_news1.c +++ b/src/pokemon_news1.c @@ -10,8 +10,7 @@ #include "pokemon_news2.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B2CC *sUnknown_203B2CC = {0}; static EWRAM_DATA_2 u16 sUnknown_203B2D0 = {0}; diff --git a/src/pokemon_news2.c b/src/pokemon_news2.c index 4cb1bf584..12b7abc12 100644 --- a/src/pokemon_news2.c +++ b/src/pokemon_news2.c @@ -9,8 +9,7 @@ #include "pokemon_news2.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B2D4 *sUnknown_203B2D4 = {0}; diff --git a/src/pokemon_news3.c b/src/pokemon_news3.c index 9a1d21e35..432f4d75f 100644 --- a/src/pokemon_news3.c +++ b/src/pokemon_news3.c @@ -14,10 +14,8 @@ #include "pokemon_mid.h" #include "pokemon_news3.h" #include "structs/str_802C39C.h" -#include "text1.h" -#include "text2.h" - -extern u8 gFormatBuffer_Monsters[]; // 202DF98 +#include "text.h" +#include "string_format.h" static EWRAM_DATA_2 struct unkStruct_203B2D8 *sUnknown_203B2D8 = {0}; static EWRAM_DATA_2 u16 sUnknown_203B2DC = {0}; @@ -143,8 +141,8 @@ void CreateMailMenu(void) if (mail->mailType == MAIL_TYPE_UNK1) { y = sub_8013800(&sUnknown_203B2D8->unk4.s0.input, i); sub_803B6B0(10, y, 6, sUnknown_203B2D8->unk4.s0.unk34); - PrintPokeNameToBuffer(gFormatBuffer_Monsters, GetPlayerPokemonStruct()); - sprintfStatic(buffer, GetPokemonMailHeadline(mail->unk4.dungeon.floor), gFormatBuffer_Monsters); + PrintPokeNameToBuffer(gFormatBuffer_Monsters[0], GetPlayerPokemonStruct()); + sprintfStatic(buffer, GetPokemonMailHeadline(mail->unk4.dungeon.floor), gFormatBuffer_Monsters[0]); PrintStringOnWindow(21, y, buffer, sUnknown_203B2D8->unk4.s0.unk34, 0); } else { diff --git a/src/post_office_guide1.c b/src/post_office_guide1.c index e998ed33e..7500d5591 100644 --- a/src/post_office_guide1.c +++ b/src/post_office_guide1.c @@ -6,7 +6,7 @@ #include "structs/menu.h" #include "pokemon.h" #include "post_office_guide1.h" -#include "text1.h" +#include "text.h" enum PostOfficeStates { diff --git a/src/post_office_guide2.c b/src/post_office_guide2.c index c824d4a3a..9af8a43e6 100644 --- a/src/post_office_guide2.c +++ b/src/post_office_guide2.c @@ -15,10 +15,8 @@ #include "menu_input.h" #include "pokemon_mail.h" #include "post_office_guide2.h" -#include "text1.h" -#include "text2.h" - -extern u8 gFormatBuffer_Items[]; +#include "text.h" +#include "string_format.h" static EWRAM_DATA_2 unkStruct_203B330 *sUnknown_203B330 = {0}; @@ -146,13 +144,13 @@ static void DisplayMissionObjectives(void) switch (jobInfo->missionType) { case WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM: - BufferItemName(gFormatBuffer_Items, jobInfo->targetItem, NULL); - sprintfStatic(buffer1, sFmtBring, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], jobInfo->targetItem, NULL); + sprintfStatic(buffer1, sFmtBring, gFormatBuffer_Items[0]); PrintStringOnWindow(40, yCoord, buffer1, sUnknown_203B330->unk10, 0); break; case WONDER_MAIL_MISSION_TYPE_FIND_ITEM: - BufferItemName(gFormatBuffer_Items, jobInfo->targetItem, NULL); - sprintfStatic(buffer1, sFmtFind, gFormatBuffer_Items); + BufferItemName(gFormatBuffer_Items[0], jobInfo->targetItem, NULL); + sprintfStatic(buffer1, sFmtFind, gFormatBuffer_Items[0]); PrintStringOnWindow(40, yCoord, buffer1, sUnknown_203B330->unk10, 0); break; case WONDER_MAIL_MISSION_TYPE_ESCORT_CLIENT: diff --git a/src/rescue_password_menu.c b/src/rescue_password_menu.c index fd353aeb1..311478fc8 100644 --- a/src/rescue_password_menu.c +++ b/src/rescue_password_menu.c @@ -13,8 +13,7 @@ #include "pokemon.h" #include "rescue_password_menu.h" #include "save.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #define RESCUE_PASSWORD_SIZE 0x36 diff --git a/src/save_menu.c b/src/save_menu.c index 72fef8bb1..aa46c8f8a 100644 --- a/src/save_menu.c +++ b/src/save_menu.c @@ -8,7 +8,7 @@ #include "save.h" #include "save_menu.h" #include "sprite.h" -#include "text1.h" +#include "text.h" static EWRAM_DATA_2 SaveMenuWork *sUnknown_203B364 = {0}; diff --git a/src/string_format.c b/src/string_format.c index 522ec0052..e74cded1d 100644 --- a/src/string_format.c +++ b/src/string_format.c @@ -7,8 +7,7 @@ #include "string_format.h" #include "bg_palette_buffer.h" #include "input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "game_options.h" #include "pokemon.h" #include "code_800D090.h" diff --git a/src/text.c b/src/text.c index 539820070..13f4a1d77 100644 --- a/src/text.c +++ b/src/text.c @@ -1,7 +1,5 @@ #include "global.h" #include "text.h" -#include "text1.h" -#include "text2.h" #include "decompress.h" #include "code_8009804.h" #include "code_800558C.h" @@ -17,22 +15,6 @@ struct CharMapStruct struct unkChar *unk4; }; -extern s32 gCharHeight[2]; -extern u8 gDrawTextShadow; -extern s32 gUnknown_202B020; -extern s32 gUnknown_202B024; - -extern vu32 gUnknown_20274B0; -extern u32 gUnknown_20274B4[0xEC0]; -extern OpenedFile *gCharmapFiles[2]; // 202AFB4 -// u32 unused // 202AFBC -extern UnkTextStruct2 gUnknown_202AFC0[4]; -extern u32 gTextShadowMask; // Some text color info is stored; retrieve via "& 0xF" -extern u16 gUnknown_202B038[4][32][32]; - -// ? -extern s16 gUnknown_3000E94[]; - // data.s extern const UnkTextStruct2 gUnknown_80B857C[4]; extern const u8 gKanjiA_file_string[]; // 80B87B4 @@ -42,19 +24,17 @@ extern const u32 gFadeInDungeon[8]; extern const u32 gUnknown_80B8804[4]; extern const u32 gUnknown_80B86B4[][32]; extern const u32 gUnknown_80B8814[]; -// system_sbin.s -extern const struct FileArchive gSystemFileArchive; - -// data.s extern const u32 gUnknown_80B853C[16]; extern const struct unkShiftData gCharMasksOffsets[8]; extern const u32 gUnknown_80B8814[]; extern const struct unkStruct_80B8824 gUnknown_80B8824; extern const struct unkStruct_80B8848 gUnknown_80B8848; +// system_sbin.s +extern const struct FileArchive gSystemFileArchive; // Todo fix gUnknown_3000E94 being accessed as s16/u8 extern s16 gUnknown_3000E94[]; -extern u8 gUnknown_20274A5; + extern const struct unkChar gUnknown_80B86A4; extern const u32 gUnknown_80B8868[]; @@ -65,6 +45,16 @@ EWRAM_DATA u8 gUnknown_202749A[11] = {0}; EWRAM_DATA bool8 gUnknown_20274A5 = FALSE; EWRAM_DATA static u8 sUnknown_20274A6[6] = {0}; EWRAM_DATA static s32 sCurrentCharmap = 0; +EWRAM_DATA static vu32 sUnknown_20274B0 = 0; +EWRAM_DATA static u32 sUnknown_20274B4[0xEC0] = {0}; +EWRAM_DATA static OpenedFile *sCharmapFiles[3] = {NULL}; +EWRAM_DATA static UnkTextStruct2 sUnknown_202AFC0[4] = {0}; +EWRAM_DATA static s32 sUnknown_202B020 = 0; +EWRAM_DATA static s32 sUnknown_202B024 = 0; +EWRAM_DATA static s32 sCharHeight[2] = {0}; +EWRAM_DATA static u32 sTextShadowMask = 0; // Some text color info is stored; retrieve via "& 0xF" +EWRAM_DATA static u8 sDrawTextShadow = 0; +EWRAM_DATA ALIGNED(4) u16 gUnknown_202B038[4][32][32] = {0}; static void SaveUnkTextStructAndXXX_8006438(const UnkTextStruct2 *a0, bool8 a1, bool8 a2, UnkTextStruct2_sub *a3); static void sub_8006554(UnkTextStruct1 *a0, u32 *a1, u32 *a2, u16 *a3, u32 a4, const UnkTextStruct2 *a5, bool8 a6, u32 a7, UnkTextStruct2_sub *a8, u8 a9); @@ -102,12 +92,12 @@ void LoadCharmaps(void) int k; sCurrentCharmap = 0; - gCharmapFiles[0] = OpenFileAndGetFileDataPtr(gKanjiA_file_string, &gSystemFileArchive); - gCharmapFiles[1] = OpenFileAndGetFileDataPtr(gKanjiB_file_string, &gSystemFileArchive); - sCharmaps[0] = (void *) gCharmapFiles[0]->data; - sCharmaps[1] = (void *) gCharmapFiles[1]->data; - gCharHeight[0] = 11; - gCharHeight[1] = 12; + sCharmapFiles[0] = OpenFileAndGetFileDataPtr(gKanjiA_file_string, &gSystemFileArchive); + sCharmapFiles[1] = OpenFileAndGetFileDataPtr(gKanjiB_file_string, &gSystemFileArchive); + sCharmaps[0] = (void *) sCharmapFiles[0]->data; + sCharmaps[1] = (void *) sCharmapFiles[1]->data; + sCharHeight[0] = 11; + sCharHeight[1] = 12; for (k = 0; k < 4; k++) { gUnknown_2027370[k].unk4 = 0; @@ -127,21 +117,21 @@ void LoadCharmaps(void) } } - gDrawTextShadow = 1; - gTextShadowMask = 0x88888888; + sDrawTextShadow = 1; + sTextShadowMask = 0x88888888; gUnknown_203B078 = NULL; gUnknown_20274A5 = FALSE; - gUnknown_202B020 = 1; - gUnknown_202B024 = 20; + sUnknown_202B020 = 1; + sUnknown_202B024 = 20; UpdateFadeInTile(0); } u32 UpdateFadeInTile(u32 a0) { - u32 r5 = gUnknown_20274B0; + u32 r5 = sUnknown_20274B0; u32 *r4 = (u32 *)(VRAM + 0x4F40); const u32 *r2; - gUnknown_20274B0 = a0; + sUnknown_20274B0 = a0; if (a0 == 0 || a0 == 2) { sub_800CDA8(2); @@ -152,7 +142,7 @@ u32 UpdateFadeInTile(u32 a0) r2 = gFadeInDungeon; } - gTextShadowMask = 0x88888888; + sTextShadowMask = 0x88888888; *r4++ = *r2++; *r4++ = *r2++; *r4++ = *r2++; @@ -166,13 +156,13 @@ u32 UpdateFadeInTile(u32 a0) u32 sub_80063B0(void) { - return gUnknown_20274B0; + return sUnknown_20274B0; } UNUSED static u8 UnusedSetTextShadow(u8 a0) { - u8 retval = gDrawTextShadow; - gDrawTextShadow = a0; + u8 retval = sDrawTextShadow; + sDrawTextShadow = a0; return retval; } @@ -185,7 +175,7 @@ void SetCharacterMask(int a0) { u32 retval; if (a0 == 0) { - gUnknown_20274B0; + UNUSED u32 unusedVal = sUnknown_20274B0; retval = 0x88888888; } else { @@ -197,7 +187,7 @@ void SetCharacterMask(int a0) retval |= ((a0 & 0xF) << 24); retval |= ((a0 & 0xF) << 28); } - gTextShadowMask = retval; + sTextShadowMask = retval; } void xxx_call_save_unk_text_struct_800641C(const UnkTextStruct2 *a0, bool8 a1, bool8 a2) @@ -222,10 +212,10 @@ static void SaveUnkTextStructAndXXX_8006438(const UnkTextStruct2 *a0, bool8 a1, sub_800898C(); for (i = 0; i < 4; i++) { - gUnknown_202AFC0[i] = a0[i]; + sUnknown_202AFC0[i] = a0[i]; if (a0[i].unkC) { - sub_8006554(gUnknown_2027370, (u32 *)VRAM, gUnknown_20274B4, &gUnknown_202B038[0][0][0], gUnknown_80B8804[i], a0 + i, a1, r9, a3, 0); + sub_8006554(gUnknown_2027370, (u32 *)VRAM, sUnknown_20274B4, &gUnknown_202B038[0][0][0], gUnknown_80B8804[i], a0 + i, a1, r9, a3, 0); sub_80089AC(a0 + i, a3); r9 += a0[i].unkC * a0[i].unk10; } @@ -248,7 +238,7 @@ void RestoreUnkTextStruct_8006518(UnkTextStruct2 *unkData) { s32 iVar2; for (iVar2 = 0; iVar2 < 4; iVar2++) - unkData[iVar2] = gUnknown_202AFC0[iVar2]; + unkData[iVar2] = sUnknown_202AFC0[iVar2]; } UNUSED static void nullsub_153(void) @@ -1491,7 +1481,7 @@ static u32 xxx_draw_char(struct UnkTextStruct1 *a0, s32 x, s32 y, u32 a3, u32 co local_3c = sp0->unk0; sp8 = sp0->unk0 - 3; - if (gDrawTextShadow != 0) { + if (sDrawTextShadow != 0) { var_2C = (sp0->unkA >> 1) & 1; } else { @@ -1506,7 +1496,7 @@ static u32 xxx_draw_char(struct UnkTextStruct1 *a0, s32 x, s32 y, u32 a3, u32 co yDiv8 = y / 8; if (yDiv8 < r5->unk8) { - for (i = 0; i < gCharHeight[sCurrentCharmap]; i++) { + for (i = 0; i < sCharHeight[sCurrentCharmap]; i++) { r2 = (local_44[1] << 0x10) | (local_44[0]); if (r2 != 0) { if (xDiv8 < r5->unk4) { @@ -1567,7 +1557,7 @@ static u32 xxx_draw_char(struct UnkTextStruct1 *a0, s32 x, s32 y, u32 a3, u32 co yDiv8 = y / 8; if (yDiv8 < r5->unk8) { - for (i = 0; i < gCharHeight[sCurrentCharmap]; i++) { + for (i = 0; i < sCharHeight[sCurrentCharmap]; i++) { r4 = (local_44[1] << 0x10) | (local_44[0]); r2 = (0x11111111 & r4) + (sp18 & r4); @@ -1575,12 +1565,12 @@ static u32 xxx_draw_char(struct UnkTextStruct1 *a0, s32 x, s32 y, u32 a3, u32 co r1 = ((local_3c[1] << 0x10) | local_3c[0]) << 4; r1 |= r4; // This doesn't really do anything since r4 bits are cleared, but it's needed to match. r1 &= ~(r4); - r1 &= gTextShadowMask; + r1 &= sTextShadowMask; r2 |= (r1); if (notFirstIteration) { r1 = (((sp8[1] << 0x10) | sp8[0]) << 4) ^ r4; r1 &= ~(r4); - r2 |= (r1 & gTextShadowMask); + r2 |= (r1 & sTextShadowMask); } } @@ -1607,12 +1597,12 @@ static u32 xxx_draw_char(struct UnkTextStruct1 *a0, s32 x, s32 y, u32 a3, u32 co r1 = (local_3c[2] << 4) | ((local_3c[1] >> 0xC) & 0xF); r1 |= r4; // This doesn't really do anything since r4 bits are cleared, but it's needed to match. r1 &= ~(r4); - r1 &= gTextShadowMask; + r1 &= sTextShadowMask; r2 |= r1; if (notFirstIteration) { r1 = ((sp8[2] << 4) | ((sp8[1] >> 0xC) & 0xF)) ^ r4; r1 &= ~(r4); - r1 &= gTextShadowMask; + r1 &= sTextShadowMask; r2 |= (r1); } } @@ -1656,13 +1646,13 @@ static u32 xxx_draw_char(struct UnkTextStruct1 *a0, s32 x, s32 y, u32 a3, u32 co void sub_80078A4(u32 a0, s32 x, s32 y, s32 a3, u32 color) { sub_800792C(a0, x, y, a3, color); - sub_800792C(a0, x, y + 1, a3, gTextShadowMask & 0xF); + sub_800792C(a0, x, y + 1, a3, sTextShadowMask & 0xF); } UNUSED static void sub_80078E8(u32 a0, s32 x, s32 y, s32 a3, u32 color) { nullsub_129(a0, x, y, a3, color); - nullsub_129(a0, x, y + 1, a3, gTextShadowMask & 0xF); + nullsub_129(a0, x, y + 1, a3, sTextShadowMask & 0xF); } void sub_800792C(u32 a0, s32 x, s32 y, s32 a3, u32 color) @@ -3354,7 +3344,7 @@ static void sub_8009388(void) gUnknown_202B038[0][0][0] = 0xF279; gUnknown_202B038[1][0][0] = 0xF27A; - for (i = gUnknown_202B020; i < gUnknown_202B024; i++) { + for (i = sUnknown_202B020; i < sUnknown_202B024; i++) { gUnknown_202B038[0][i][0] = 0xF279; gUnknown_202B038[1][i][0] = 0xF27A; for (j = 1; j < 32; j++) { @@ -3426,8 +3416,8 @@ UNUSED static void nullsub_173(void) void sub_80095CC(s32 a0, s32 a1) { - gUnknown_202B020 = a0; - gUnknown_202B024 = a1; + sUnknown_202B020 = a0; + sUnknown_202B024 = a1; } UNUSED static void nullsub_174(void) diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index 8d32621aa..221bbd5ba 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -20,8 +20,7 @@ #include "save.h" #include "save_write.h" #include "text_util.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "thank_you_wonder_mail.h" #include "wonder_mail_4.h" #include "wonder_mail_5.h" diff --git a/src/trade_items_menu.c b/src/trade_items_menu.c index 9c9629a4e..0a5fe1dca 100644 --- a/src/trade_items_menu.c +++ b/src/trade_items_menu.c @@ -13,8 +13,7 @@ #include "menu_input.h" #include "other_menus2.h" #include "save_write.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "trade_items_menu.h" static EWRAM_DATA_2 struct TradeItemsMenu *sTradeItemsMenu = {0}; diff --git a/src/unk_menu_203B360.c b/src/unk_menu_203B360.c index 3568787ed..3cde43d55 100644 --- a/src/unk_menu_203B360.c +++ b/src/unk_menu_203B360.c @@ -5,7 +5,7 @@ #include "memory.h" #include "menu_input.h" #include "sprite.h" -#include "text1.h" +#include "text.h" #include "unk_menu_203B360.h" // Size: 0x1B4. Similar to SaveMenuWork diff --git a/src/wigglytuff_shop1.c b/src/wigglytuff_shop1.c index 4cffbc41c..75366c121 100644 --- a/src/wigglytuff_shop1.c +++ b/src/wigglytuff_shop1.c @@ -9,8 +9,7 @@ #include "items.h" #include "memory.h" #include "menu_input.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wigglytuff_shop1.h" static EWRAM_DATA_2 WigglytuffShop1Work *sWigglytuffShop1Work = {0}; diff --git a/src/wigglytuff_shop2.c b/src/wigglytuff_shop2.c index a92946ecc..d4066b24c 100644 --- a/src/wigglytuff_shop2.c +++ b/src/wigglytuff_shop2.c @@ -10,8 +10,7 @@ #include "menu_input.h" #include "pokemon.h" #include "pokemon_3.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wigglytuff_shop2.h" static EWRAM_DATA_2 WigglytuffShop2Work *sWigglytuffShop2Work = {0}; @@ -114,10 +113,10 @@ static void PopulateWigglytuffShopFriendAreaInfoScreen(void) sub_808D930(buffer2, sWigglytuffShop2Work->friendAreaSpecies[i]); switch (sWigglytuffShop2Work->pokemonStatus[i]) { - case POKEMON_UNKNOWN: + case POKEMON_UNKNOWN: PrintStringOnWindow(x, y, gCommonTripleQuestionMark[0], sWigglytuffShop2Work->unk74, 0); break; - case POKEMON_SEEN: + case POKEMON_SEEN: PrintStringOnWindow(x, y, buffer2, sWigglytuffShop2Work->unk74, 0); break; case POKEMON_RECRUITED: @@ -174,7 +173,7 @@ static void sub_8021A60(void) } } -/* Return index of pokemon if in the friend area, else return -1 */ +/* Return index of pokemon if in the friend area, else return -1 */ static s32 CheckSpeciesinWigglytuffFriendArea(s16 species) { s32 baseSpecies; diff --git a/src/wigglytuff_shop3.c b/src/wigglytuff_shop3.c index 81dffd8ad..9523949fc 100644 --- a/src/wigglytuff_shop3.c +++ b/src/wigglytuff_shop3.c @@ -12,15 +12,11 @@ #include "memory.h" #include "menu_input.h" #include "pokemon.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wigglytuff_shop1.h" #include "wigglytuff_shop2.h" #include "wigglytuff_shop3.h" -extern u8 gSpeakerNameBuffer[]; -extern u8 gFormatBuffer_FriendArea[]; - static EWRAM_DATA_2 WigglytuffShop3Work *sWigglytuffShop3Work = {0}; #include "data/wigglytuff_shop3.h" diff --git a/src/wonder_mail.c b/src/wonder_mail.c index 760e60656..516d06772 100644 --- a/src/wonder_mail.c +++ b/src/wonder_mail.c @@ -18,8 +18,7 @@ #include "rescue_password_menu.h" #include "save.h" #include "save_write.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wonder_mail.h" #include "wonder_mail_4.h" #include "wonder_mail_5.h" diff --git a/src/wonder_mail_2.c b/src/wonder_mail_2.c index 1c42ffa9d..ddfcee803 100644 --- a/src/wonder_mail_2.c +++ b/src/wonder_mail_2.c @@ -17,7 +17,7 @@ #include "pokemon_mail.h" #include "save.h" #include "save_write.h" -#include "text1.h" +#include "text.h" struct unkStruct_203B2C8 { diff --git a/src/wonder_mail_3_mid.c b/src/wonder_mail_3_mid.c index 8853f8671..17e5f0a2f 100644 --- a/src/wonder_mail_3_mid.c +++ b/src/wonder_mail_3_mid.c @@ -2,8 +2,7 @@ #include "globaldata.h" #include "code_802DE84.h" #include "memory.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "menu_input.h" #include "structs/str_802C39C.h" #include "common_strings.h" diff --git a/src/wonder_mail_4.c b/src/wonder_mail_4.c index de7641b24..5189d3ded 100644 --- a/src/wonder_mail_4.c +++ b/src/wonder_mail_4.c @@ -11,8 +11,7 @@ #include "pokemon.h" #include "pokemon_mail.h" #include "structs/str_802C39C.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "structs/struct_sub80095e4.h" #include "wonder_mail_4.h" diff --git a/src/wonder_mail_5.c b/src/wonder_mail_5.c index d0317dfea..4f1d8c86e 100644 --- a/src/wonder_mail_5.c +++ b/src/wonder_mail_5.c @@ -12,8 +12,7 @@ #include "pokemon.h" #include "pokemon_mail.h" #include "structs/str_802C39C.h" -#include "text1.h" -#include "text2.h" +#include "text.h" struct unkStruct_203B324 { diff --git a/src/wonder_mail_6.c b/src/wonder_mail_6.c index beaa90e3c..cc7f47dd3 100644 --- a/src/wonder_mail_6.c +++ b/src/wonder_mail_6.c @@ -2,8 +2,7 @@ #include "globaldata.h" #include "input.h" #include "memory.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "pokemon.h" #include "code_8094F88.h" #include "menu_input.h" diff --git a/src/wonder_mail_802C10C.c b/src/wonder_mail_802C10C.c index 7d01f2886..78666ca5b 100644 --- a/src/wonder_mail_802C10C.c +++ b/src/wonder_mail_802C10C.c @@ -8,8 +8,7 @@ #include "memory.h" #include "menu_input.h" #include "pokemon_mail.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wonder_mail_802C10C.h" static EWRAM_DATA_2 struct unkStruct_203B2E0 *gUnknown_203B2E0 = {0}; diff --git a/src/wonder_mail_802C4C8.c b/src/wonder_mail_802C4C8.c index 6164d918a..6f9ba7aad 100644 --- a/src/wonder_mail_802C4C8.c +++ b/src/wonder_mail_802C4C8.c @@ -11,8 +11,7 @@ #include "wonder_mail_802C10C.h" #include "structs/str_802C39C.h" #include "structs/str_wonder_mail.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wonder_mail_802C4C8.h" static EWRAM_DATA_2 struct unkStruct_203B2E0* gUnknown_203B2E8 = {0}; diff --git a/src/wonder_mail_802C860.c b/src/wonder_mail_802C860.c index f8a4a470f..331a4038b 100644 --- a/src/wonder_mail_802C860.c +++ b/src/wonder_mail_802C860.c @@ -11,8 +11,7 @@ #include "menu_input.h" #include "wonder_mail_802C4C8.h" #include "wonder_mail_802C860.h" -#include "text1.h" -#include "text2.h" +#include "text.h" static EWRAM_DATA_2 struct unkStruct_203B2F0 *sUnknown_203B2F0 = {0}; diff --git a/src/wonder_mail_802CDD4.c b/src/wonder_mail_802CDD4.c index c4077caac..98cace658 100644 --- a/src/wonder_mail_802CDD4.c +++ b/src/wonder_mail_802CDD4.c @@ -10,8 +10,7 @@ #include "structs/str_802C39C.h" #include "structs/struct_sub80095e4.h" #include "structs/str_wonder_mail.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wonder_mail_802CDD4.h" static EWRAM_DATA_2 struct_Sub80095E4_2 *sUnknown_203B2F4 = {0}; diff --git a/src/wonder_mail_802D098.c b/src/wonder_mail_802D098.c index a5e341bc8..246346f26 100644 --- a/src/wonder_mail_802D098.c +++ b/src/wonder_mail_802D098.c @@ -13,8 +13,7 @@ #include "memory.h" #include "menu_input.h" #include "save.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wonder_mail_802C4C8.h" #include "wonder_mail_802D098.h" @@ -521,7 +520,7 @@ static void sub_802D9F0(void) case NO_ACTION: sub_802D1A0(DRAW_JOB_LIST_1); break; - + case YES_ACTION: sub_802C688(); ResetJobSlot(sUnknown_203B2F8->jobSlotIndex); diff --git a/src/wonder_mail_main_menu.c b/src/wonder_mail_main_menu.c index a327a8453..8ee4c630d 100644 --- a/src/wonder_mail_main_menu.c +++ b/src/wonder_mail_main_menu.c @@ -15,8 +15,7 @@ #include "other_menus2.h" #include "save.h" #include "save_write.h" -#include "text1.h" -#include "text2.h" +#include "text.h" #include "wonder_mail_802D098.h" #include "wonder_mail_main_menu.h" #include "wonder_mail_4.h" diff --git a/sym_ewram.txt b/sym_ewram.txt index 29c24920d..0d299fb23 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -44,34 +44,6 @@ gUnknown_20270E8: /* 20270E8 (sub_8005838) */ .include "src/text.o" -gUnknown_20274B0: /* 20274B0 (UpdateFadeInTile - SetCharacterMask) */ - .space 0x4 -gUnknown_20274B4: /* 20274B4 (SaveUnkTextStructAndXXX_8006438) */ - .space 0x3B00 -gCharmapFiles: /* 202AFB4 (LoadCharmaps) */ - .space 0xC -gUnknown_202AFC0: /* 202AFC0 (SaveUnkTextStructAndXXX_8006438 - RestoreUnkTextStruct_8006518) */ - .space 0x60 -gUnknown_202B020: /* 202B020 (LoadCharmaps - sub_80095CC) */ - .space 0x4 -gUnknown_202B024: /* 202B024 (LoadCharmaps - sub_80095CC) */ - .space 0x4 -gCharHeight: /* 202B028 (LoadCharmaps - xxx_draw_char) */ - .space 0x8 -gTextShadowMask: /* 202B030 (LoadCharmaps - sub_80078E8) */ - .space 0x4 -gDrawTextShadow: /* 202B034 (LoadCharmaps - xxx_draw_char) */ - .space 0x4 -gUnknown_202B038: /* 202B038 (LoadTitleScreen - sub_80A2B40) */ - .space 0x1000 - -gFontTiles_202C038: /* 202C038 (sub_8010858 - sub_804A728) */ - .space 0x800 -gFontTilesExtra_202C838: /* 202C838 (sub_8010858 - sub_804A49C) */ - .space 0x720 - -gUnknown_202CF58: /* 202CF58 (xxx_format_string) */ - .space 0xE0 gFontPalette: /* 202D038 (sub_80097B0 - sub_8052FB8) */ .space 0x4