From 938f8cf177514fa96d1484b9c72dd352e090d76f Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 5 Aug 2023 15:34:20 -0400 Subject: [PATCH] text1/text2 rename --- include/text.h | 15 +-------------- include/text1.h | 14 ++++++++++++++ include/text2.h | 12 ++++++++++++ ld_script.txt | 4 ++-- src/friend_list_menu.c | 2 +- src/gulpin_shop_1.c | 2 +- src/{text.c => text1.c} | 24 +++++++++++++++++------- src/{text_1.c => text2.c} | 7 ++++--- src/unk_menu_203B360.c | 2 +- src/wonder_mail_2_mid.c | 2 +- src/wonder_mail_3.c | 2 +- src/wonder_mail_6.c | 3 ++- 12 files changed, 57 insertions(+), 32 deletions(-) create mode 100644 include/text1.h create mode 100644 include/text2.h rename src/{text.c => text1.c} (92%) rename src/{text_1.c => text2.c} (96%) diff --git a/include/text.h b/include/text.h index 5f92a7d91..8aeab3bab 100644 --- a/include/text.h +++ b/include/text.h @@ -32,7 +32,7 @@ struct UnkTextStruct2_sub // I haven't found a func that reads these separately yet, but simply making an arr[2] will cause assignments to break. // Some funcs only match with this union for some reason even though they don't access the variables separately... // The first func to break is currently sub_801A5D8 in kecleon_bros.c - // The first func I matched that uses the array is sub_8006554 in text_1.c (using the separated fields doesn't match or get even close) + // The first func I matched that uses the array is sub_8006554 in text2.c (using the separated fields doesn't match or get even close) union { struct { s16 unk0; @@ -56,17 +56,4 @@ struct UnkTextStruct2 const u8 *unk14; }; -void LoadCharmaps(void); -void SelectCharmap(u32); -u32 xxx_update_some_bg_tiles(u32 a0); -void sub_800641C(struct UnkTextStruct2 *a0, u8 a1, u8 a2); -void sub_8006438(const struct UnkTextStruct2 *, u8, u8, struct UnkTextStruct2_sub *); -void sub_8006518(struct UnkTextStruct2 *); -void sub_8006554(struct UnkTextStruct1 *, void *, u8 *, u16 *, u32, const struct UnkTextStruct2 *, u8, u32, struct UnkTextStruct2_sub *, u8); -void sub_800898C(void); -void sub_80089AC(const struct UnkTextStruct2 *, struct UnkTextStruct2_sub *); -void sub_8009388(void); - -extern void xxx_call_draw_string(s32 x, u32 y, const u8 *str, u32 , u32); - #endif \ No newline at end of file diff --git a/include/text1.h b/include/text1.h new file mode 100644 index 000000000..0538ef9a4 --- /dev/null +++ b/include/text1.h @@ -0,0 +1,14 @@ +#ifndef GUARD_TEXT1_H +#define GUARD_TEXT1_H + +#include "text.h" + +extern EWRAM_DATA struct UnkTextStruct2 gUnknown_202AFC0[4]; + +void LoadCharmaps(void); +void SelectCharmap(u32); +u32 xxx_update_some_bg_tiles(u32 a0); + +void sub_800641C(struct UnkTextStruct2 *a0, u8 a1, u8 a2); + +#endif // GUARD_TEXT1_H \ No newline at end of file diff --git a/include/text2.h b/include/text2.h new file mode 100644 index 000000000..5a2393da0 --- /dev/null +++ b/include/text2.h @@ -0,0 +1,12 @@ +#ifndef GUARD_TEXT2_H +#define GUARD_TEXT2_H + +#include "text.h" + +void sub_8006518(struct UnkTextStruct2 *); +void sub_8006554(struct UnkTextStruct1 *, void *, u8 *, u16 *, u32, const struct UnkTextStruct2 *, u8, u32, struct UnkTextStruct2_sub *, u8); + +// text.s +extern void xxx_call_draw_string(s32 x, u32 y, const u8 *str, u32 , u32); + +#endif // GUARD_TEXT2_H \ No newline at end of file diff --git a/ld_script.txt b/ld_script.txt index 410f02de2..73ef9eb0f 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -67,8 +67,8 @@ SECTIONS { asm/code_8005838.o(.text); src/code_800558C.o(.text); src/random.o(.text); - src/text.o(.text); - src/text_1.o(.text); + src/text1.o(.text); + src/text2.o(.text); asm/text.o(.text); src/code_8009804.o(.text); asm/code_8009804.o(.text); diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index 07134ece5..912c3de26 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -1,7 +1,7 @@ #include "global.h" #include "constants/dungeon.h" #include "memory.h" -#include "text.h" +#include "text2.h" #include "input.h" #include "menu.h" #include "item.h" diff --git a/src/gulpin_shop_1.c b/src/gulpin_shop_1.c index 33104cf5f..37a1e99f7 100644 --- a/src/gulpin_shop_1.c +++ b/src/gulpin_shop_1.c @@ -5,7 +5,7 @@ #include "pokemon_3.h" #include "file_system.h" #include "input.h" -#include "text.h" +#include "text1.h" #include "team_inventory.h" #include "menu_input.h" #include "gulpin_shop.h" diff --git a/src/text.c b/src/text1.c similarity index 92% rename from src/text.c rename to src/text1.c index a3b858d5a..58b05354b 100644 --- a/src/text.c +++ b/src/text1.c @@ -2,9 +2,7 @@ #include "file_system.h" #include "code_800558C.h" #include "code_800B540.h" -#include "text.h" - -extern char gUnknown_3000E94[]; +#include "text1.h" EWRAM_DATA struct UnkTextStruct1 gUnknown_2027370[4]; EWRAM_DATA u8 *gCharmaps[2]; @@ -22,14 +20,26 @@ EWRAM_DATA u32 gUnknown_202B030; EWRAM_DATA u8 gUnknown_202B034; EWRAM_DATA u16 gUnknown_202B038[2][32][32]; +// ? +extern char gUnknown_3000E94[]; + +// data.s extern const struct UnkTextStruct2 gUnknown_80B857C[4]; -extern const char gKanjiA_file_string[]; -extern const char gKanjiB_file_string[]; -extern const struct FileArchive gSystemFileArchive; extern const u32 gUnknown_80B87C4[8]; extern const u32 gUnknown_80B87E4[8]; extern const u32 gUnknown_80B8804[4]; -extern u32 gUnknown_80B8814[]; +extern const u32 gUnknown_80B8814[]; +extern const char gKanjiA_file_string[]; +extern const char gKanjiB_file_string[]; +// system_sbin.s +extern const struct FileArchive gSystemFileArchive; + +// text.s +extern void sub_800898C(void); +extern void sub_80089AC(const struct UnkTextStruct2 *, struct UnkTextStruct2_sub *); +extern void sub_8009388(void); + +void sub_8006438(const struct UnkTextStruct2 *, u8, u8, struct UnkTextStruct2_sub *); void LoadCharmaps(void) { diff --git a/src/text_1.c b/src/text2.c similarity index 96% rename from src/text_1.c rename to src/text2.c index 657a80ba0..974445765 100644 --- a/src/text_1.c +++ b/src/text2.c @@ -1,9 +1,10 @@ #include "global.h" -#include "text.h" +#include "text2.h" -extern struct UnkTextStruct2 gUnknown_202AFC0[4]; -extern u32 gUnknown_80B8814[]; +// data.s +extern const u32 gUnknown_80B8814[]; +// text.s extern void sub_800677C(struct UnkTextStruct1 *, s32, u16 *, u8); extern void sub_80069CC(struct UnkTextStruct1 *, s32, s32, s32, u16 *); extern void sub_8006AC4(struct UnkTextStruct1 *, s32, s32, u32, u16 *); diff --git a/src/unk_menu_203B360.c b/src/unk_menu_203B360.c index deb645bbe..894a2e9a7 100644 --- a/src/unk_menu_203B360.c +++ b/src/unk_menu_203B360.c @@ -3,7 +3,7 @@ #include "main_menu.h" #include "memory.h" #include "menu.h" -#include "text.h" +#include "text1.h" #include "menu_input.h" struct unkSprite diff --git a/src/wonder_mail_2_mid.c b/src/wonder_mail_2_mid.c index 967c33630..350fb1cb7 100644 --- a/src/wonder_mail_2_mid.c +++ b/src/wonder_mail_2_mid.c @@ -4,7 +4,7 @@ #include "code_800D090.h" #include "input.h" #include "memory.h" -#include "text.h" +#include "text2.h" #include "pokemon_mail.h" #include "wonder_mail.h" #include "code_802C39C.h" diff --git a/src/wonder_mail_3.c b/src/wonder_mail_3.c index 809e3541b..4179436a1 100644 --- a/src/wonder_mail_3.c +++ b/src/wonder_mail_3.c @@ -4,7 +4,7 @@ #include "constants/input.h" #include "memory.h" -#include "text.h" +#include "text1.h" #include "input.h" #include "mailbox.h" #include "menu.h" diff --git a/src/wonder_mail_6.c b/src/wonder_mail_6.c index 6fe9f70be..254ba107d 100644 --- a/src/wonder_mail_6.c +++ b/src/wonder_mail_6.c @@ -2,7 +2,8 @@ #include "memory.h" #include "input.h" #include "file_system.h" -#include "text.h" +#include "text1.h" +#include "text2.h" #include "pokemon.h" #include "menu.h" #include "code_8094F88.h"