diff --git a/README.md b/README.md index 0cc737e6..df08d5b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (99.1612%) +# banjo (99.1816%) diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index d6610507..1c70a52e 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core2 - 98.5381% - 98.5381% + 98.5735% + 98.5735% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index d401656e..99849367 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 99.1612% - 99.1612% + 99.1816% + 99.1816% \ No newline at end of file diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c index 4c1a8c7f..20b9469c 100644 --- a/src/core2/ch/badShad.c +++ b/src/core2/ch/badShad.c @@ -4,15 +4,15 @@ extern void __spawnQueue_add_2(void (*)(s32, s32), s32, s32); -Actor *func_802D6F48(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); -void func_802D6EA0(Actor *this); +Actor *chBadShad_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void chBadShad_update(Actor *this); void func_802D729C(Actor *actor, f32 arg1); /* .data */ -ActorInfo D_80367A50 = { +ActorInfo chBadShad = { 0x9B, 0x108, 0x3BF, 0x1, NULL, - func_802D6EA0, func_80326224, func_802D6F48, + chBadShad_update, func_80326224, chBadShad_draw, 0, 0, 0.0f, 0 }; @@ -21,13 +21,14 @@ f32 D_8037DE10[3]; f32 D_8037DE20[3]; /* .code */ -void func_802D6EA0(Actor *this){ +void chBadShad_update(Actor *this){ s32 iVar1; if(!this->initialized){ this->initialized = 1; this->marker->collidable = 0; } if(!this->despawn_flag && this->unk1C_x < (f32)(func_8023DB5C() - 1) ){ + //unlink if(this->unk104){ marker_getActor(this->unk104)->unk104 = 0; } @@ -35,7 +36,7 @@ void func_802D6EA0(Actor *this){ } } -Actor *func_802D6F48(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ +Actor *chBadShad_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ f32 sp44[3]; f32 sp40; Actor *this = marker_getActorAndRotation(marker, sp44); diff --git a/src/core2/code_3B2C0.c b/src/core2/code_3B2C0.c index 4673124e..dcb3cad2 100644 --- a/src/core2/code_3B2C0.c +++ b/src/core2/code_3B2C0.c @@ -7,63 +7,63 @@ f32 mlDiffDegF(f32, f32); /* .bss */ -f32 D_8037DC20[3]; -f32 D_8037DC30[3]; -f32 D_8037DC3C; -f32 D_8037DC40; -u8 D_8037DC44; +static f32 s_position[3]; +static f32 s_rotation[3]; +static f32 s_time_remaining_s; +static f32 s_duration; +static u8 s_state; /* .code */ void func_802C2250(void){} void func_802C2258(void){ - D_8037DC44 = 0; + s_state = 0; } -void func_802C2264(f32 arg0){ - D_8037DC40 = arg0; - D_8037DC3C = D_8037DC40; - ncDynamicCamera_getPosition(D_8037DC20); - ncDynamicCamera_getRotation(D_8037DC30); - D_8037DC44 = 1; +void func_802C2264(f32 duration){ + s_duration = duration; + s_time_remaining_s = s_duration; + ncDynamicCamera_getPosition(s_position); + ncDynamicCamera_getRotation(s_rotation); + s_state = 1; } void func_802C22B4(void){ - D_8037DC44 = 0; + s_state = 0; } -void func_802C22C0(f32 vp_position[3], f32 vp_rotation[3]){ +void func_802C22C0(f32 target_position[3], f32 target_rotation[3]){ f32 tmpf_1[3]; f32 tmpf_2[3]; f32 tmp; - if(D_8037DC44 == 0) + if(s_state == 0) return; - if(D_8037DC44 == 1){ - ml_vec3f_diff(D_8037DC20, vp_position); - D_8037DC30[0] = mlDiffDegF(D_8037DC30[0], vp_rotation[0]); - D_8037DC30[1] = mlDiffDegF(D_8037DC30[1], vp_rotation[1]); - D_8037DC30[2] = 0.0f; - D_8037DC44 = 2; + if(s_state == 1){ + ml_vec3f_diff(s_position, target_position); + s_rotation[0] = mlDiffDegF(s_rotation[0], target_rotation[0]); + s_rotation[1] = mlDiffDegF(s_rotation[1], target_rotation[1]); + s_rotation[2] = 0.0f; + s_state = 2; } - D_8037DC3C -= time_getDelta(); - if(D_8037DC3C <= 0.0f) - D_8037DC44 = 0; + s_time_remaining_s -= time_getDelta(); + if(s_time_remaining_s <= 0.0f) + s_state = 0; else { - tmp = ml_map_f(D_8037DC3C, 0.0f, D_8037DC40, 0.0f, 1.0f); - ml_vec3f_scale_copy(tmpf_1, D_8037DC20, tmp); - ml_vec3f_scale_copy(tmpf_2, D_8037DC30, tmp); - vp_position[0] += tmpf_1[0]; - vp_position[1] += tmpf_1[1]; - vp_position[2] += tmpf_1[2]; - vp_rotation[0] += tmpf_2[0]; - vp_rotation[1] += tmpf_2[1]; - vp_rotation[2] += tmpf_2[2]; - vp_rotation[0] = mlNormalizeAngle(vp_rotation[0]); - vp_rotation[1] = mlNormalizeAngle(vp_rotation[1]); - vp_rotation[2] = 0.0f; + tmp = ml_map_f(s_time_remaining_s, 0.0f, s_duration, 0.0f, 1.0f); + ml_vec3f_scale_copy(tmpf_1, s_position, tmp); + ml_vec3f_scale_copy(tmpf_2, s_rotation, tmp); + target_position[0] += tmpf_1[0]; + target_position[1] += tmpf_1[1]; + target_position[2] += tmpf_1[2]; + target_rotation[0] += tmpf_2[0]; + target_rotation[1] += tmpf_2[1]; + target_rotation[2] += tmpf_2[2]; + target_rotation[0] = mlNormalizeAngle(target_rotation[0]); + target_rotation[1] = mlNormalizeAngle(target_rotation[1]); + target_rotation[2] = 0.0f; } } diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index 73b822b0..be3b9851 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -127,9 +127,6 @@ s32 D_803820A8[3]; //local static s32 D_803820B4; //local static s32 D_803820B8[0x20]; //ActorProp *, (maybe Prop *) s32 pad_80382138; -s32 D_8038213C; -s32 D_80382140; -s32 D_80382144; @@ -705,6 +702,8 @@ void func_80303D78(ActorMarker *arg0, f32 arg1, UNK_TYPE(s32) arg2) { s32 sp60[3]; s32 sp5C; f32 sp50[3]; + static s32 D_8038213C; + sp5C = 0; sp50[0] = (f32) arg0->propPtr->x; @@ -2193,9 +2192,6 @@ bool func_803082D8(Cube *arg0, s32 *arg1, bool arg2, bool arg3) { return var_a0; } -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803083B0.s") -#else s32 func_803083B0(s32 arg0) { s32 var_v0; Cube *var_s0; @@ -2204,14 +2200,13 @@ s32 func_803083B0(s32 arg0) { if (arg0 == -1) { var_s0 = D_80381FA0.cube_list; - D_80382144 = var_s0; D_80382140 = 0; + D_80382144 = var_s0; return 0; } - - var_s0 = D_80382144; - if (D_80382140 < D_80382144->prop2Cnt) { + var_s0 = *(Cube **)&D_80382144; + if (D_80382140 < var_s0->prop2Cnt) { if (D_80381FA0.cube_list && D_80381FA0.cube_list && D_80381FA0.cube_list ); var_v0 = func_803082D8(var_s0, &D_80382140, arg0 >= 0, arg0 & 1); if (D_80382140 != 0) { @@ -2235,7 +2230,6 @@ s32 func_803083B0(s32 arg0) { D_80382144 = var_s0; return var_v0; } -#endif enum actor_e func_803084F0(s32 arg0){ s32 var_v1; diff --git a/src/core2/spawnqueue.c b/src/core2/spawnqueue.c index 7ec16720..853ef798 100644 --- a/src/core2/spawnqueue.c +++ b/src/core2/spawnqueue.c @@ -81,7 +81,7 @@ extern ActorInfo D_80367934; //witch_switch.cc extern ActorInfo D_80367958; //witch_switch.bgs extern ActorInfo D_8036797C; //witch_switch.gv extern ActorInfo D_80367A20; //wading boots -extern ActorInfo D_80367A50; //chbadshad +extern ActorInfo chBadShad; //chbadshad extern ActorInfo D_80367AB0; extern ActorInfo D_80367AD4; extern ActorInfo D_80367AF8; @@ -248,7 +248,7 @@ void spawnQueue_reset(void){ spawnableActorList_add(&D_80367184, actor_new, 0x0000000); spawnableActorList_add(&chExtraLife, actor_new, 0x0200000); //extralife spawnableActorList_add(&D_80365FB0, actor_new, 0x0000004); //shrapnel - spawnableActorList_add(&D_80367A50, actor_new, 0x0000004); //chbadshad + spawnableActorList_add(&chBadShad, actor_new, 0x0000004); //chbadshad spawnableActorList_add(&D_803685A0, actor_new, 0x0000040); //mumbotoken spawnableActorList_add(&D_80367F30, actor_new, 0x0000400); spawnableActorList_add(&chBubble, actor_new, 0x0000004);