From d3966a0f679b41932d857feb0341df04e4fd6744 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 18 Oct 2020 16:39:39 -0400 Subject: match code_801DAAE0.cpp --- asm/sbss_2.s | 6 ++++++ include/code_801DAAE0.h | 2 -- include/unkStruct.h | 2 -- src/code_801DAAE0.cpp | 30 ++++++++++++++++++------------ 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/asm/sbss_2.s b/asm/sbss_2.s index 1a94e0d..5e6e650 100644 --- a/asm/sbss_2.s +++ b/asm/sbss_2.s @@ -1,5 +1,11 @@ .section .sbss, "wa" # 0x80474F00 - 0x80643050 +.global lbl_8063F2D8 +lbl_8063F2D8: + .skip 0x4 +.global lbl_8063F2DC +lbl_8063F2DC: + .skip 0x4 .global lbl_8063F2E0 lbl_8063F2E0: .skip 0x8 diff --git a/include/code_801DAAE0.h b/include/code_801DAAE0.h index 93d9fef..0382a63 100644 --- a/include/code_801DAAE0.h +++ b/include/code_801DAAE0.h @@ -5,7 +5,6 @@ extern "C" { #endif -// TODO: move, determine actual type definition typedef void *MEMHeapHandle; @@ -23,7 +22,6 @@ struct unkClass2 u32 unk8; }; - unkClass* func_801DAAE0(void); BOOL func_801DAB28(void); void func_801DAB30(void); diff --git a/include/unkStruct.h b/include/unkStruct.h index 34b40f1..d1c304f 100644 --- a/include/unkStruct.h +++ b/include/unkStruct.h @@ -10,8 +10,6 @@ struct unkStruct u16 unk2; u8 unk4; u8 unk5; - u8 unk6; - u8 unk7; unkStruct(u8 p1, u16 p2, u8 p3) : unk0(p1), unk2(p2), unk4(p3) { } }; diff --git a/src/code_801DAAE0.cpp b/src/code_801DAAE0.cpp index 795607d..4527388 100644 --- a/src/code_801DAAE0.cpp +++ b/src/code_801DAAE0.cpp @@ -6,15 +6,12 @@ extern "C" { -unkStruct gUnk8063F2D0(1, 4, 0); -MEMHeapHandle lbl_8063F2D8; -u16 lbl_8063F2DC; - -// TODO: move to headers -extern MEMHeapHandle lbl_8063E8E8; -extern MEMHeapHandle lbl_8063E8EC; +// TODO: define, don't reference +extern MEMHeapHandle lbl_8063F2D8; +extern u16 lbl_8063F2DC; +// TODO: move, determine actual type definition typedef void (*MEMHeapVisitor)(void *memBlock, MEMHeapHandle heap, u32 userParam); void *memset(void *s, int c, size_t n); @@ -30,11 +27,20 @@ u16 MEMGetGroupIDForMBlockExpHeap(const void *memBlock); void MEMVisitAllocatedForExpHeap(MEMHeapHandle heap, MEMHeapVisitor visitor, u32 userParam); -unkClass gUnk804912B0[16]; +#define ARR_SIZE 16 +static unkClass gUnk804912B0[ARR_SIZE]; + +static unkStruct gUnk8063F2D0(1, 4, 0); +static u8 gUnk8063F2D6; +static u8 gUnk8063F2D7; +// TODO: move to headers +extern MEMHeapHandle lbl_8063E8E8; +extern MEMHeapHandle lbl_8063E8EC; + unkClass* func_801DAAE0(void) { - for (u32 i = 0; i < 16; i++) + for (u32 i = 0; i < ARR_SIZE; i++) if (gUnk804912B0[i].unk0 == 0) return &gUnk804912B0[i]; return NULL; @@ -42,7 +48,7 @@ unkClass* func_801DAAE0(void) BOOL func_801DAB28(void) { - return gUnk8063F2D0.unk6; + return gUnk8063F2D6; } void func_801DAB30(void) @@ -50,8 +56,8 @@ void func_801DAB30(void) memset(gUnk804912B0, 0, sizeof(gUnk804912B0)); lbl_8063F2D8 = 0; lbl_8063F2DC = 0; - gUnk8063F2D0.unk6 = 1; - gUnk8063F2D0.unk7 = 0; + gUnk8063F2D6 = 1; + gUnk8063F2D7 = 0; } MEMHeapHandle func_801DAB78(void* p1, u32 p2, u16 p3) -- cgit v1.2.3