From 54dee725cf47e8df4bbde7fb93430de767f40d04 Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Fri, 30 Sep 2022 11:02:01 -0500 Subject: [PATCH] 89% --- README.md | 2 +- progress/progress_core2.svg | 6 +++--- progress/progress_total.svg | 4 ++-- src/core2/code_AC520.c | 22 +++++++++------------- src/core2/code_B5E00.c | 19 +++++++++++-------- tools/n64splat | 2 +- 6 files changed, 27 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index e46c468a..b9c7b9d3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (88.9659%) +# banjo (89.0203%) diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index 50885ec2..e3622874 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core2 - 87.7809% - 87.7809% + 87.8758% + 87.8758% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 71d05da0..3c0a2c49 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 88.9659% - 88.9659% + 89.0203% + 89.0203% \ No newline at end of file diff --git a/src/core2/code_AC520.c b/src/core2/code_AC520.c index f441b2d3..7716d1f8 100644 --- a/src/core2/code_AC520.c +++ b/src/core2/code_AC520.c @@ -4,6 +4,8 @@ extern void func_80252CC4(f32[3], f32[3], f32, f32[3]); +extern f32 func_802EC920(BKVertexList *arg0); +extern void func_803334B0(f32 position[3], f32 rotation[3], f32 scale, f32[3], f32); void func_80333918(void); void func_8033393C(void); @@ -222,12 +224,6 @@ s32 func_80333C78(s32 arg0){ return func_8034AF98(arg0, 0); } -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AC520/func_80333D48.s") -#else -extern void func_803334B0(f32 position[3], f32 rotation[3], f32 scale, f32[3], f32); -extern f32 func_802EC920(BKVertexList *arg0); - void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, BKVertexList *arg5) { Vtx *i_ptr; Vtx *end_ptr; @@ -248,8 +244,8 @@ void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 sca for(i_ptr = i_ptr; i_ptr < end_ptr; i_ptr++, ref_ptr++){ sp68[0] = sp68[1] = sp68[2] = 0.0f; - sp74[0] = ref_ptr->v.ob[0];\ - sp74[1] = ref_ptr->v.ob[1];\ + sp74[0] = ref_ptr->v.ob[0]; + sp74[1] = ref_ptr->v.ob[1]; sp74[2] = ref_ptr->v.ob[2]; for(struct_ptr_ptr = &D_80383570.unk4[0]; struct_ptr_ptr < D_80383570.unk44;struct_ptr_ptr++){ @@ -269,9 +265,9 @@ void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 sca } } - i_ptr->v.cn[0] = (s8)((ref_ptr->v.cn[0]*sp68[0])/256.0); - i_ptr->v.cn[1] = (s8)((ref_ptr->v.cn[1]*sp68[1])/256.0); - i_ptr->v.cn[2] = (s8)((ref_ptr->v.cn[2]*sp68[2])/256.0); + //each of these lines needs to consume an extra t reg + i_ptr->v.cn[0] = (s8)((ref_ptr->v.cn[0]*sp68[0])/256.0) & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF; + i_ptr->v.cn[1] = (s8)((ref_ptr->v.cn[1]*sp68[1])/256.0) & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF; + i_ptr->v.cn[2] = (s8)((ref_ptr->v.cn[2]*sp68[2])/256.0) & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF & 0xFF; } -} -#endif +} diff --git a/src/core2/code_B5E00.c b/src/core2/code_B5E00.c index 107bdf53..3188c4d0 100644 --- a/src/core2/code_B5E00.c +++ b/src/core2/code_B5E00.c @@ -35,12 +35,14 @@ void func_8033CE14(s32 gamenum){ #pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B5E00/func_8033CE40.s") #else void func_8033CE40(void) { - s32 sp48[4]; - s32 var_s0; - s32 var_s0_2; s32 i; + s32 var_s0; + s32 sp48[4]; + - for(i = 0; i < 4; i++){ + D_80383F04 = -1; + sp48[3] = 0; + for(i = 0; i < 3; i++){ D_80383F00[i] = -1; sp48[i] = 0; } @@ -55,11 +57,12 @@ void func_8033CE40(void) { D_80383F04 = var_s0; } } + sp48[D_80383F04] = 1; for(i = 0; i < 3; i++){ - for(var_s0_2 = 0; (var_s0_2 < 4) && (D_80383F00[i] == -1); var_s0_2++){ - if (sp48[var_s0_2] == 0) { - sp48[var_s0_2] = 1; - D_80383F00[i] = var_s0_2; + for(var_s0 = 0; (var_s0 < 4) && (D_80383F00[i] == -1); var_s0++){ + if (sp48[var_s0] == 0) { + sp48[var_s0] = 1; + D_80383F00[i] = var_s0; } } } diff --git a/tools/n64splat b/tools/n64splat index a26134e3..ec7bd486 160000 --- a/tools/n64splat +++ b/tools/n64splat @@ -1 +1 @@ -Subproject commit a26134e36f68fb122eeac6a70f8613776daaa121 +Subproject commit ec7bd4868e6880a36bfd7ea3fb77573e3298e910