From bb1364f93b2c888a3efbf1a7980b61f509d5a300 Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Mon, 26 Sep 2022 14:00:32 -0500 Subject: [PATCH] 88%, FP/code_5CC0.c done --- README.md | 2 +- progress/progress_FP.svg | 6 ++-- progress/progress_total.svg | 4 +-- src/FP/code_5CC0.c | 59 ++++++++++++++++--------------------- src/core2/code_D89E0.c | 26 +++++++++++----- subyaml/FP.us.v10.yaml | 2 +- 6 files changed, 51 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 7b8c2bdc..fd8b9686 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (87.9186%) +# banjo (88.0030%) diff --git a/progress/progress_FP.svg b/progress/progress_FP.svg index fc5e4b13..ff57caf7 100644 --- a/progress/progress_FP.svg +++ b/progress/progress_FP.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ FP - 94.3166% - 94.3166% + 97.1669% + 97.1669% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 75dc9af8..31f0bdb5 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 87.9186% - 87.9186% + 88.0030% + 88.0030% \ No newline at end of file diff --git a/src/FP/code_5CC0.c b/src/FP/code_5CC0.c index 3b8c7e71..e7321608 100644 --- a/src/FP/code_5CC0.c +++ b/src/FP/code_5CC0.c @@ -265,9 +265,6 @@ void func_8038C94C(ActorMarker *caller, enum asset_e text_id, s32 arg2){ } } -#ifndef NONAMTCHING -#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_5CC0/func_8038C9A0.s") -#else void func_8038C9A0(Actor *this){ Actor *other; //sp34 void * sp30; @@ -302,16 +299,15 @@ void func_8038C9A0(Actor *this){ FUNC_8030E8B4(SFX_7B_ICE_BREAKING_1, 1.0f, 32000, this->position, 0x6d6, 0xdac);\ marker_despawn(this->marker); return; - }//L8038CB04 + } switch(this->state){ case 1:// 8038CB2C - if(func_8038C718(this, 0)) - break; - - func_80328B8C(this, 2, 0.001f, 1); - func_8038C428(this, D_80392088, randf2(20.0f, 24.0f)); - this->unk60 = this->yaw; + if(!func_8038C718(this, 0)){ + func_80328B8C(this, 2, 0.001f, 1); + func_8038C428(this, D_80392088, randf2(20.0f, 24.0f)); + this->unk60 = this->yaw; + } break; case 2:// 8038CB8C @@ -331,27 +327,25 @@ void func_8038C9A0(Actor *this){ this->unk38_31 = FALSE; } - if(func_8038C718(this, 0.0f)) - return; - - if(func_8038C844(this->position, D_80392088)){ - func_80328B8C(this, 3, 0.001f, 1); - func_8038C428(this, D_80392094, 0.0f); - } - else{ - func_8038C428(this, D_80392088, randf2(20.0f, 24.0f)); + if(!func_8038C718(this, 0.0f)){ + if(func_8038C844(this->position, D_80392088)){ + func_80328B8C(this, 3, 0.001f, 1); + func_8038C428(this, D_80392094, 0.0f); + } + else{ + func_8038C428(this, D_80392088, randf2(20.0f, 24.0f)); + } } break; case 3:// 8038CCFC - if(func_8038C718(this, 0.0f)) - break; - - if(other->unk38_31 != 0){ - other->unk38_31--; + if(!func_8038C718(this, 0.0f)){ + if(other->unk38_31 != 0){ + other->unk38_31--; + } + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + marker_despawn(this->marker); } - func_8025A6EC(COMUSIC_2B_DING_B, 28000); - marker_despawn(this->marker); break; case 4:// 8038CD58 @@ -373,20 +367,19 @@ void func_8038C9A0(Actor *this){ case 5:// 8038CE14 this->yaw_moving = (f32)func_80329784(this); func_80328FB0(this, 8.0f); - if(func_8038C718(this, this->unk1C[1])) - break; - - this->velocity[1] = randf2(14.0f, 20.0f); + if(!func_8038C718(this, this->unk1C[1])){ + this->velocity[1] = randf2(14.0f, 20.0f); + } break; case 6:// 8038CE64 this->position_y -= 5.0f; if(this->position_y < this->unk1C[2] - 50.0f){ - this->velocity_x = 0.0f; + other->velocity_x = 0.0f; marker_despawn(this->marker); - return; } break; + default: + break; }//L8038CEB0 } -#endif diff --git a/src/core2/code_D89E0.c b/src/core2/code_D89E0.c index facb5311..3284cd17 100644 --- a/src/core2/code_D89E0.c +++ b/src/core2/code_D89E0.c @@ -268,10 +268,11 @@ 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 sp20[3]; f32 num; f32 den; f32 phi_f2; + f32 sp2C[3]; + f32 sp20[3]; switch (arg2) { case 1: @@ -284,15 +285,24 @@ f32 func_803603AC(Actor *this, s32 arg1, u8 arg2){ sp20[2] = this->unk1C[2]; break; } - - den = (this->position[0] - sp20[0])*(this->position[0] - sp20[0]) + (this->position[2] - sp20[2])*(this->position[2] - sp20[2]); - num = (this->position[1] - sp20[1]) - (f32)arg1; + + 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) return 0.0f; - phi_f2 = -num/den; - return (phi_f2 >= 4.0f) ? 4.0f - : (phi_f2 <= -4.0f) ? -4.0f - : phi_f2; + + phi_f2 = -(this->unk28*num)/den; + if (phi_f2 >= 4.0f) { + return 4.0f; + } + if(-4.0f >= phi_f2) + phi_f2 = -4.0f; + return phi_f2; } #endif diff --git a/subyaml/FP.us.v10.yaml b/subyaml/FP.us.v10.yaml index d7a37cb7..965b5fb5 100644 --- a/subyaml/FP.us.v10.yaml +++ b/subyaml/FP.us.v10.yaml @@ -40,7 +40,7 @@ segments: - [0x4400, c, code_4400] #DONE - [0x45D0, c, code_45D0] #DONE - [0x4770, c, code_4770] #DONE - - [0x5CC0, c, code_5CC0] + - [0x5CC0, c, code_5CC0] #DONE - [0x6AE0, c, code_6AE0] #DONE - [0x7980, c, code_7980] #DONE - [0x8330, c, code_8330] #DONE