summaryrefslogtreecommitdiff
path: root/src/unk_menu_203B364.c
diff options
context:
space:
mode:
authorSeth Barberee <seth.barberee@gmail.com>2021-04-03 20:44:48 -0500
committerGitHub <noreply@github.com>2021-04-03 20:44:48 -0500
commit22fec43f1812cb863ad699b357bd593222ae140c (patch)
tree4efa162869946a9bfdbde1be498857fac3db3b39 /src/unk_menu_203B364.c
parenta2d206665c6fffbd962375f262b7fbb05c7b7478 (diff)
More menu work (#33)
* split adventure log menu out and decompile * add most adventure log matchings w/ 2 nonmatchings and move some relevant data * more work on other menus * fully decomp debug stuff around 203B3F0 * more debug menu work * fix CreatePartnerSelectionMenu nonmatch * move more data and clean some data up
Diffstat (limited to 'src/unk_menu_203B364.c')
-rw-r--r--src/unk_menu_203B364.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/unk_menu_203B364.c b/src/unk_menu_203B364.c
new file mode 100644
index 0000000..f6f6766
--- /dev/null
+++ b/src/unk_menu_203B364.c
@@ -0,0 +1,85 @@
+#include "global.h"
+#include "input.h"
+
+struct unkData
+{
+ u8 unk0[14];
+ u16 unkD;
+ u16 unk10;
+ u16 unk12;
+ u8 *unk14;
+};
+
+struct unkStruct_203B360
+{
+ // size: 0x1b4
+ u32 currMenu;
+ u32 unk4;
+ u32 unk8;
+ u8 fill8[0x148 - 0xC];
+ struct unkData unk148[4];
+ u16 unk1A8;
+ u16 unk1AA;
+ u16 unk1AC;
+ u16 unk1AE;
+ u32 unk1B0; // Sprite count?
+};
+
+extern struct unkStruct_203B360 *gUnknown_203B364;
+extern struct unkData gUnknown_80E6F20;
+extern u32 gUnknown_80E6F38;
+extern u32 gUnknown_80E7090;
+extern u32 gUnknown_80E6F50;
+
+extern void *MemoryAlloc(u32, u32);
+extern void MemoryFill8(u8 *, u8, u32);
+extern void MemoryFree(void *);
+extern void sub_8038440();
+extern void sub_8035CF4(u32 *, u32, u32);
+extern void sub_800641C(void *, u32, u32);
+extern void SetMenuItems(void *, void *, u32, u32 *, u32 *, u32, u32, u32);
+extern u8 sub_80130A8(u32 *);
+extern void sub_8013114(u32 *, u32 *);
+extern void sub_80384D0();
+extern void sub_8038830();
+
+void sub_803850C(s32 param_1)
+{
+ s32 iVar4;
+
+ if (gUnknown_203B364 == NULL) {
+ gUnknown_203B364 = MemoryAlloc(sizeof(struct unkStruct_203B360),8);
+ MemoryFill8((u8 *)gUnknown_203B364,0,sizeof(struct unkStruct_203B360));
+ }
+ for(iVar4 = 0; iVar4 < 4; iVar4++){
+ gUnknown_203B364->unk148[iVar4] = gUnknown_80E6F20;
+ }
+ ResetUnusedInputStruct();
+ sub_800641C(gUnknown_203B364->unk148,1,1);
+
+ if (param_1 == 0x2e) {
+ // Beware, Deleting your Adventure
+ SetMenuItems(&gUnknown_203B364->unk8,gUnknown_203B364->unk148,0,&gUnknown_80E6F38,&gUnknown_80E7090,
+ 0,6,0);
+ }
+ else {
+ // Saving your Adventure
+ SetMenuItems(&gUnknown_203B364->unk8,gUnknown_203B364->unk148,0,&gUnknown_80E6F38,&gUnknown_80E6F50,
+ 0,6,0);
+ }
+ sub_8035CF4(&gUnknown_203B364->unk8,0,1);
+ gUnknown_203B364->unk4 = 0;
+ gUnknown_203B364->currMenu = param_1;
+ sub_8038830();
+}
+
+void sub_8038604(void)
+{
+ ResetUnusedInputStruct();
+ sub_800641C(0,1,1);
+ if (gUnknown_203B364 != 0) {
+ MemoryFree(gUnknown_203B364);
+ gUnknown_203B364 = 0;
+ }
+}
+