From 486b0b532cf334838a94e0ab27840398a14dc526 Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Wed, 9 Nov 2022 14:35:17 -0600 Subject: [PATCH] core1/memory.c heap_init() done --- README.md | 2 +- progress/progress_core1.svg | 6 +++--- progress/progress_total.svg | 4 ++-- src/core1/memory.c | 14 +++++--------- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c33f5651..4c4c60df 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (93.9723%) +# banjo (93.9924%) diff --git a/progress/progress_core1.svg b/progress/progress_core1.svg index 1cda6277..63d4f030 100644 --- a/progress/progress_core1.svg +++ b/progress/progress_core1.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core1 - 88.3978% - 88.3978% + 88.5362% + 88.5362% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 76e1ce87..ca5fa56b 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 93.9723% - 93.9723% + 93.9924% + 93.9924% \ No newline at end of file diff --git a/src/core1/memory.c b/src/core1/memory.c index e1b89062..278d7368 100644 --- a/src/core1/memory.c +++ b/src/core1/memory.c @@ -183,9 +183,6 @@ void func_802546FC(void){ D_80283228 = NULL; } -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core1/memory/heap_init.s") -#else void heap_init(void){ bzero(D_8002D500, HEAP_SIZE); func_802546FC(); @@ -197,29 +194,28 @@ void heap_init(void){ D_802765A8 = 0; D_802765AC = 0; D_802765B0.unk0 = FALSE; - D_8002D500[0].hdr.unkC_7 = 2; D_8002D500[0].hdr.prev = NULL; D_8002D500[0].hdr.next = &D_8002D500[1]; + D_8002D500[0].hdr.unkC_7 = 2; D_8002D500[0].hdr.unusedBytes_C_31 = 0; D_8002D500[0].prev_free = NULL; D_8002D500[0].next_free = &D_8002D500[1]; - D_8002D500[1].hdr.unkC_7 = 0; D_8002D500[1].hdr.prev = &D_8002D500[0]; D_8002D500[1].hdr.next = &D_8002D500[LAST_HEAP_BLOCK]; + D_8002D500[1].hdr.unkC_7 = 0; D_8002D500[1].hdr.unusedBytes_C_31 = 0; D_8002D500[1].prev_free = &D_8002D500[0]; D_8002D500[1].next_free = &D_8002D500[LAST_HEAP_BLOCK]; - D_8002D500[LAST_HEAP_BLOCK].hdr.unkC_7 = 2; - D_8002D500[LAST_HEAP_BLOCK].hdr.prev = &D_8002D500[0]; + D_8002D500[LAST_HEAP_BLOCK].hdr.prev = &D_8002D500[1]; D_8002D500[LAST_HEAP_BLOCK].hdr.next = &D_8002D500[LAST_HEAP_BLOCK + 1]; + D_8002D500[LAST_HEAP_BLOCK].hdr.unkC_7 = 2; D_8002D500[LAST_HEAP_BLOCK].hdr.unusedBytes_C_31 = 0; - D_8002D500[LAST_HEAP_BLOCK].prev_free = &D_8002D500[0]; + D_8002D500[LAST_HEAP_BLOCK].prev_free = &D_8002D500[1]; D_8002D500[LAST_HEAP_BLOCK].next_free = NULL; sns_init_base_payloads(); } -#endif void *func_8025484C(s32 size){ D_802765B4 = malloc(ALIGN((u32)&D_8002D500[1] + 0x100, 0x100) - (u32)&D_8002D500[1] - sizeof(EmptyHeapBlock));