From f5bd176a12d88d26eb6b97d23c5dcb67373ed42d Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sun, 17 Mar 2024 14:15:20 -0700 Subject: [PATCH] continue moving data --- data/data_80D47B8.s | 93 +---------------------------------------- ld_script.txt | 1 + src/code_80140DC.c | 7 ++-- src/data/code_80140DC.h | 25 +++++++++++ src/menu_input.c | 51 ++++++++++++++++++++-- 5 files changed, 78 insertions(+), 99 deletions(-) create mode 100644 src/data/code_80140DC.h diff --git a/data/data_80D47B8.s b/data/data_80D47B8.s index 81388dc98..62c1e1cef 100644 --- a/data/data_80D47B8.s +++ b/data/data_80D47B8.s @@ -1,98 +1,7 @@ .section .rodata -@ START menu_input - .align 2, 0 - - .global UnkData_80D47C4 - UnkData_80D47C4: - .byte 0x01, 0x00, 0x10, 0x00 - - .global gUnknown_80D47C8 -gUnknown_80D47C8: @ 80D47C8 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x06, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x02, 0x00 - .byte 0x1a, 0x00, 0x0c, 0x00 - .byte 0x0c, 0x00, 0x00, 0x00 - .4byte UnkData_80D47C4 - - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .global gUnknown_80D4828 -gUnknown_80D4828: @ 80D4828 - .string "{COLOR_1}%c%s\0" - .align 2,0 - - .global gUnknown_80D4830 -gUnknown_80D4830: @ 80D4830 - .4byte 1 - .4byte 10 - .4byte 100 - .4byte 1000 - .4byte 10000 - .4byte 100000 - .4byte 1000000 - .4byte 10000000 - .4byte 100000000 - -@ END menu_input - @ START code_80130A8 -.asciz "pksdir0" - .global gUnknown_80D485C -gUnknown_80D485C: @ 80D485C - .4byte Yes_80D4878 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte No_80D4874 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .4byte -1 - - .global No_80D4874 - No_80D4874: - .string "No\0" - .align 2,0 - .global Yes_80D4878 - Yes_80D4878: - .string "*Yes\0" - .align 2,0 - - .global gUnknown_80D4880 -gUnknown_80D4880: @ 80D4880 - .4byte Yes_80D489C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte No_80D4898 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 @ End of table - .4byte -1 - - .global No_80D4898 - No_80D4898: - .string "*No\0" - .global Yes_80D489C - Yes_80D489C: - .string "Yes\0" - .align 2,0 .global gUnknown_80D48A0 gUnknown_80D48A0: @ 80D48A0 @@ -155,4 +64,4 @@ gUnknown_80D4908: @ 80D4908 gUnknown_80D4910: @ 80D4910 .string "$\0" -@ END code_80130A8 \ No newline at end of file +@ END code_80130A8 diff --git a/ld_script.txt b/ld_script.txt index fc8177c5c..f055e1286 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -436,6 +436,7 @@ SECTIONS { src/quick_save_read.o(.rodata); src/quick_save_write.o(.rodata); src/menu_input.o(.rodata); + src/code_80140DC.o(.rodata); data/data_80D47B8.o(.rodata); src/common_strings.o(.rodata); data/data_80DAF70.o(.rodata); diff --git a/src/code_80140DC.c b/src/code_80140DC.c index 04dec23d4..2b2e65c5c 100644 --- a/src/code_80140DC.c +++ b/src/code_80140DC.c @@ -1,18 +1,19 @@ #include "constants/input.h" #include "global.h" +#include "globaldata.h" #include "menu_input.h" #include "sprite.h" #include "code_80118A4.h" #include "code_80130A8.h" -extern s32 gUnknown_202E744; extern s32 gUnknown_202E738; extern s32 gUnknown_202E73C; extern s32 gUnknown_202E740; +extern s32 gUnknown_202E744; -extern MenuItem gUnknown_80D485C[]; -extern MenuItem gUnknown_80D4880[]; +#include "data/code_80140DC.h" +// TODO: move to menu_input extern UnkTextStruct2 gUnknown_80D47C8[4]; void sub_80140B4(UnkTextStruct2 *a0) diff --git a/src/data/code_80140DC.h b/src/data/code_80140DC.h new file mode 100644 index 000000000..7d06ba8b1 --- /dev/null +++ b/src/data/code_80140DC.h @@ -0,0 +1,25 @@ +const u8 Yes_80D4878[]; +const u8 No_80D4874[]; + +const MenuItem gUnknown_80D485C[] = +{ + {Yes_80D4878, 1}, + {No_80D4874, 0}, + {NULL, -1} +}; + +ALIGNED(4) const u8 No_80D4874[] = "No"; +ALIGNED(4) const u8 Yes_80D4878[] = "*Yes"; + +const u8 Yes_80D489C[]; +const u8 No_80D4898[]; + +const MenuItem gUnknown_80D4880[] = +{ + {Yes_80D489C, 1}, + {No_80D4898, 0}, + {NULL, -1} +}; + +ALIGNED(4) const u8 No_80D4898[] = "*No"; +ALIGNED(4) const u8 Yes_80D489C[] = "Yes"; diff --git a/src/menu_input.c b/src/menu_input.c index 4990e8347..f00307b4e 100644 --- a/src/menu_input.c +++ b/src/menu_input.c @@ -14,9 +14,53 @@ #include "text2.h" #include "util.h" -// data_80D47B8.s -extern const u8 gUnknown_80D4828[]; -extern const s32 gUnknown_80D4830[9]; +const u32 gDefaultMenuTextColors[3] = { COLOR_WHITE_2, COLOR_RED, COLOR_RED }; + +const u8 UnkData_80D47C4[] = {0x01, 0x00, 0x10, 0x00}; + +const UnkTextStruct2 gUnknown_80D47C8[4] = { + 0x00, 0x00, 0x00, 0x00, + 0x06, + 0x02, 0x02, + 0x1a, 0x0c, + 0x0c, 0x00, + UnkData_80D47C4, + + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL, + + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL, + + 0x00, 0x00, 0x00, 0x00, + 0x03, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + NULL, +}; + +ALIGNED(4) const u8 gUnknown_80D4828[] = _("{COLOR_1}%c%s"); + +const s32 gUnknown_80D4830[9] = { + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000 +}; // text.s extern s16 sub_8009614(u32, u32); @@ -26,7 +70,6 @@ static void sub_801332C(s16 *); static void sub_8013470(MenuInputStruct *); static bool8 sub_8013DD0(unkStructFor8013AA0 *); -const u32 gDefaultMenuTextColors[3] = { COLOR_WHITE_2, COLOR_RED, COLOR_RED }; u32 sub_8012A64(MenuInputStructSub *r0, s32 r1) {