diff --git a/README.md b/README.md index b2c32311..9f4f9152 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (99.0163%) +# banjo (99.0364%) diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index c1986b63..d6610507 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -17,7 +17,7 @@ core2 - 98.5031% - 98.5031% + 98.5381% + 98.5381% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index ca4900c6..bb5ab1e6 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 99.0163% - 99.0163% + 99.0364% + 99.0364% \ No newline at end of file diff --git a/src/core2/code_D89E0.c b/src/core2/code_D89E0.c index e5fef42c..f49bf696 100644 --- a/src/core2/code_D89E0.c +++ b/src/core2/code_D89E0.c @@ -6,6 +6,9 @@ extern f32 func_80309724(f32[3]); extern f32 func_80257204(f32, f32, f32, f32); +#define SQ(x) ((x) * (x)) + + typedef struct { f32 unk0; f32 unk4; @@ -274,15 +277,11 @@ bool func_80360198(Actor *this) { return TRUE; } -#ifndef NONMATCHING -f32 func_803603AC(Actor *this, s32 arg1, u8 arg2); -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_D89E0/func_803603AC.s") -#else f32 func_803603AC(Actor *this, s32 arg1, u8 arg2){ - f32 num; - f32 den; f32 phi_f2; - f32 sp2C[3]; + f32 dy; + f32 D1, D2; + f32 unused; f32 sp20[3]; switch (arg2) { @@ -297,25 +296,23 @@ f32 func_803603AC(Actor *this, s32 arg1, u8 arg2){ break; } - sp2C[0] = (this->position[0] - sp20[0]); - sp2C[1] = (this->position[1] - sp20[1]); - sp2C[2] = (this->position[2] - sp20[2]); - - den =(sp2C[0]*sp2C[0] + sp2C[2]*sp2C[2]); - // if(den); - num = (sp2C[1] - arg1); - if(num == 0.0 || den == 0.0) + D1 = SQ(this->position[0] - sp20[0]); + D2 = SQ(this->position[2] - sp20[2]); + + dy = this->position[1] - sp20[1] - arg1; + + if(dy == 0.0 || D1 + D2 == 0.0) return 0.0f; + - phi_f2 = -(this->unk28*num)/den; + phi_f2 = -(this->unk28*(dy))/(D1 + D2); if (phi_f2 >= 4.0f) { - return 4.0f; + phi_f2 = 4.0f; + } else if (phi_f2 <= -4.0f) { + phi_f2 = -4.0f; } - if(-4.0f >= phi_f2) - phi_f2 = -4.0f; return phi_f2; } -#endif int func_803604E8(Actor *this){ f32 tmp_f0;