From ebdd7836a55ee34c8f14ceebbd0acff2f2f53c4f Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Thu, 10 Nov 2022 13:19:23 -0600 Subject: [PATCH] core2/code_7AF80.c func_80305D94.c done --- README.md | 2 +- progress/progress_core2.svg | 6 ++--- progress/progress_total.svg | 4 +-- src/core1/memory.c | 1 + src/core2/code_7AF80.c | 50 ++++++++++++++++++------------------- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index b303719b..8d07c22d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (94.2550%) +# banjo (94.2875%) diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index de5e1694..44c5b667 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core2 - 92.9382% - 92.9382% + 92.9949% + 92.9949% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 052d1659..8fda2838 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 94.2550% - 94.2550% + 94.2875% + 94.2875% \ No newline at end of file diff --git a/src/core1/memory.c b/src/core1/memory.c index 9ca222f5..d2521519 100644 --- a/src/core1/memory.c +++ b/src/core1/memory.c @@ -321,6 +321,7 @@ void *func_80254BD0(s32 *size, u32 arg1) { while(arg1 != 0){ var_v1 = var_v1->prev_free; if (var_v1 == &D_8002D500[0]) { + //less than n blocks return NULL; } arg1--; diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index 70ce8ebf..03521626 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -1236,21 +1236,20 @@ Actor * func_803055E0(enum actor_e arg0, s32 arg1[3], s32 arg2, s32 arg3, s32 ar return actor; } - -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803056FC.s") -#else -Actor *func_803056FC(enum actor_e arg0, s32 arg1[3], s32 arg2) { - s32 i; - - arg0 = !func_80320248() ? ACTOR_4_BIGBUTT : arg0; - for(i=0; i < sSpawnableActorSize; i++){ - if(arg0 == sSpawnableActorList[i].infoPtr->actorId) - return sSpawnableActorList[i].spawnFunc(arg1, arg2, sSpawnableActorList[i].infoPtr, sSpawnableActorList[i].unk8); +Actor *func_803056FC(enum actor_e arg0, s32 arg1[3], s32 arg2) +{ + s32 i; + arg0 = (!func_80320248()) ? (ACTOR_4_BIGBUTT) : (arg0); + for (i = 0; i < sSpawnableActorSize; i++) + { + if (arg0 == sSpawnableActorList[i].infoPtr->actorId) + { + return sSpawnableActorList[i].spawnFunc(arg1, arg2, ((0, sSpawnableActorList[i])).infoPtr, sSpawnableActorList[i].unk8); } - return NULL; + } + + return NULL; } -#endif void func_8030578C(void){ int i; @@ -1375,14 +1374,14 @@ void func_80305D38(void){ D_8036A9D0 = 0; } -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305D94.s") -#else void func_80305D94(void){ - s32 j; + Struct_core2_7AF80_1 *iPtr; + Struct_core2_7AF80_1 *end_ptr; + unsigned int j; if(D_8036A9BC != NULL){ - for(j = 0; j < D_8036A9B8; j++){ - free(D_8036A9BC[j].unk8); + end_ptr = &D_8036A9BC[D_8036A9B8]; + for(iPtr = D_8036A9BC; iPtr < end_ptr; iPtr++){ + free(iPtr->unk8); } free(D_8036A9BC); D_8036A9BC = NULL; @@ -1390,8 +1389,9 @@ void func_80305D94(void){ } if(D_8036A9C8 != NULL){ - for(j = 0; j < D_8036A9C4; j++){ - free(D_8036A9C8[j].unk8); + end_ptr = &D_8036A9C8[D_8036A9C4]; + for(iPtr = D_8036A9C8; iPtr < end_ptr; iPtr++){ + free(iPtr->unk8); } free(D_8036A9C8); D_8036A9C8 = NULL; @@ -1399,15 +1399,15 @@ void func_80305D94(void){ } if(D_8036A9D4 != NULL){ - for(j = 0; j < D_8036A9D0; j++){ - free(D_8036A9D4[j].unk8); + end_ptr = &D_8036A9D4[D_8036A9D0]; + for(iPtr = D_8036A9D4; iPtr < end_ptr; iPtr++){ + free(iPtr->unk8); } free(D_8036A9D4); - D_8036A9D0 = 0; D_8036A9D4 = NULL; + D_8036A9D0 = 0; } } -#endif void func_80305F04(s32 *arg0, Struct_core2_7AF80_1 **arg1) { bool continue_loop;