From 0a9f2e5071ce96169c74758e38d83a98ca1fa255 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 22 Oct 2020 21:27:26 -0400 Subject: add LC_BASE macro to OSCache.h, and condense func_801DB81C --- include/SDK/OS/OSCache.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/SDK/OS/OSCache.h b/include/SDK/OS/OSCache.h index 489ed0b..a6fb490 100644 --- a/include/SDK/OS/OSCache.h +++ b/include/SDK/OS/OSCache.h @@ -6,6 +6,9 @@ extern "C" { #endif void LCEnable(void); +#define LC_BASE (0xE000 << 16) +#define LCGetBase() ((void*)LC_BASE) + #ifdef __cplusplus } -- cgit v1.2.3 From b889dc5418ad7a072e6b2b47d7a866ba08c05a15 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 23 Oct 2020 01:30:30 -0400 Subject: match func_801DBC58 --- include/code_801DBB3C.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/code_801DBB3C.h b/include/code_801DBB3C.h index 394bd32..34ffe6a 100644 --- a/include/code_801DBB3C.h +++ b/include/code_801DBB3C.h @@ -7,9 +7,22 @@ extern "C" { #include "code_801DB040.h" +// free store block? +struct gUnkClass3 +{ + gUnkClass3* unk0; + gUnkClass1 unk4; +}; + +// linked list node free store? struct gUnkClass2 { - u8 pad[0x24]; + u32 unk0; + u32 unk4; + u8 pad[0x4]; + size_t unkC; + u8 pad2[0x8]; + gUnkClass3* unk18; }; gUnkClass1* func_801DBC58(gUnkClass2* p1); -- cgit v1.2.3 From 047d52bd174f2b8553b9f2958a98639d6dc3e4ec Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 23 Oct 2020 01:52:33 -0400 Subject: match func_801DBD00 --- include/code_801DBB3C.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/code_801DBB3C.h b/include/code_801DBB3C.h index 34ffe6a..bbf2c39 100644 --- a/include/code_801DBB3C.h +++ b/include/code_801DBB3C.h @@ -17,12 +17,12 @@ struct gUnkClass3 // linked list node free store? struct gUnkClass2 { - u32 unk0; + u32 unk0; // counter? u32 unk4; u8 pad[0x4]; - size_t unkC; + size_t unkC; // block size u8 pad2[0x8]; - gUnkClass3* unk18; + gUnkClass3* unk18; // next block? }; gUnkClass1* func_801DBC58(gUnkClass2* p1); -- cgit v1.2.3 From 1a76bb3162479a8897272ca4928ef2e0be849e21 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 23 Oct 2020 12:13:48 -0400 Subject: match func_801DBD74 --- include/code_801DBB3C.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/code_801DBB3C.h b/include/code_801DBB3C.h index bbf2c39..1c387cf 100644 --- a/include/code_801DBB3C.h +++ b/include/code_801DBB3C.h @@ -10,19 +10,19 @@ extern "C" { // free store block? struct gUnkClass3 { - gUnkClass3* unk0; + gUnkClass3* unk0; // pointer to the next free block gUnkClass1 unk4; }; // linked list node free store? struct gUnkClass2 { - u32 unk0; // counter? - u32 unk4; - u8 pad[0x4]; + u32 unk0; // counter for blocks currently allocated? + u32 unk4; // maximum number of blocks allocated so far? + u32 unk8; // checked heavily in func_801DBD74 size_t unkC; // block size - u8 pad2[0x8]; - gUnkClass3* unk18; // next block? + u8 unk10[0x8]; + gUnkClass3* unk18; // head of the linked list of free nodes }; gUnkClass1* func_801DBC58(gUnkClass2* p1); -- cgit v1.2.3 From d93b0c1aac1148a9b609baec3914c2f33f546519 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 23 Oct 2020 15:43:52 -0400 Subject: bring func_801DBB48 closer to matching --- include/code_801DBB3C.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/code_801DBB3C.h b/include/code_801DBB3C.h index 1c387cf..dc96371 100644 --- a/include/code_801DBB3C.h +++ b/include/code_801DBB3C.h @@ -11,7 +11,7 @@ extern "C" { struct gUnkClass3 { gUnkClass3* unk0; // pointer to the next free block - gUnkClass1 unk4; + gUnkClass1 unk4; // flexible array member to make this generic? }; // linked list node free store? @@ -19,9 +19,10 @@ struct gUnkClass2 { u32 unk0; // counter for blocks currently allocated? u32 unk4; // maximum number of blocks allocated so far? - u32 unk8; // checked heavily in func_801DBD74 + u32 unk8; // number of linked list nodes initially requested size_t unkC; // block size - u8 unk10[0x8]; + u8* unk10; // TODO: change to gUnkClass3* for unk10 and unk14? + u8* unk14; // pointer to "end" block? gUnkClass3* unk18; // head of the linked list of free nodes }; -- cgit v1.2.3 From 813f6a67a079e00b4003952e612bd7177f707fc6 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 23 Oct 2020 23:22:36 -0400 Subject: cleanup --- include/code_801DBB3C.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/code_801DBB3C.h b/include/code_801DBB3C.h index dc96371..fbc1996 100644 --- a/include/code_801DBB3C.h +++ b/include/code_801DBB3C.h @@ -7,23 +7,21 @@ extern "C" { #include "code_801DB040.h" -// free store block? struct gUnkClass3 { - gUnkClass3* unk0; // pointer to the next free block - gUnkClass1 unk4; // flexible array member to make this generic? + gUnkClass3* unk0; + gUnkClass1 unk4; }; -// linked list node free store? struct gUnkClass2 { - u32 unk0; // counter for blocks currently allocated? - u32 unk4; // maximum number of blocks allocated so far? - u32 unk8; // number of linked list nodes initially requested - size_t unkC; // block size - u8* unk10; // TODO: change to gUnkClass3* for unk10 and unk14? - u8* unk14; // pointer to "end" block? - gUnkClass3* unk18; // head of the linked list of free nodes + u32 unk0; + u32 unk4; + u32 unk8; + size_t unkC; + u8* unk10; + u8* unk14; + gUnkClass3* unk18; }; gUnkClass1* func_801DBC58(gUnkClass2* p1); -- cgit v1.2.3