From 2d3e940f26fd5b37b1823e96cd971834cb1ab0eb Mon Sep 17 00:00:00 2001 From: inspectredc <78732756+inspectredc@users.noreply.github.com> Date: Sun, 7 Apr 2024 18:10:58 +0100 Subject: [PATCH 1/2] Match Area6_8018C54C (#201) * Match Area6_8018C54C * can remove if now rest is matching * just use if 1 --- src/overlays/ovl_i3/fox_a6.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/overlays/ovl_i3/fox_a6.c b/src/overlays/ovl_i3/fox_a6.c index d1976d8b..77f9685f 100644 --- a/src/overlays/ovl_i3/fox_a6.c +++ b/src/overlays/ovl_i3/fox_a6.c @@ -1781,9 +1781,6 @@ void Area6_8018C0D0(f32* arg0, f32 arg1, Vec3f* arg2, f32 arg3, s32 arg4) { Matrix_Pop(&gGfxMatrix); } -#ifdef NON_MATCHING -// weirdness on setting spAC.x to 0.0f and in loading bossA6 near the fakeness -// https://decomp.me/scratch/mwrs8 void Area6_8018C54C(Boss* bossA6) { Vec3f spD0[30]; Vec3f spC4; @@ -1804,10 +1801,12 @@ void Area6_8018C54C(Boss* bossA6) { Animation_GetFrameData(&D_A6_6018994, 0, spD0); if (D_i3_801C22F0.unk_24 != 255.0f) { RCP_SetupDL(&gMasterDisp, 0x47); - spAC.x = 0.0f; gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 255, (s32) D_i3_801C22F0.unk_24); + spAC.x = 0.0f; if ((gSysFrameCount & 1) == 0) { + spAC.x = 1.0f; + if (1) {} spAC.x = 0.0f; } spAC.y = spAC.z = 0.0f; @@ -1855,7 +1854,7 @@ void Area6_8018C54C(Boss* bossA6) { bossA6->swork[A6_SWK_27 + i]--; if (bossA6->swork[A6_SWK_27 + i] <= 0) { bossA6->swork[A6_SWK_18 + i] = 4; - bossA6->swork[A6_SWK_38 + i] = 1; + bossA6->swork[A6_SWK_38] = 1; bossA6->fwork[A6_FWK_10 + i] = bossA6->fwork[A6_FWK_19 + i] = bossA6->fwork[A6_FWK_13 + i] = bossA6->fwork[A6_FWK_22 + i] = 0.0f; bossA6->fwork[A6_FWK_25 + i] = -90.0f; @@ -1973,10 +1972,6 @@ void Area6_8018C54C(Boss* bossA6) { Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 74.0f, 1); } } -#else -void Area6_8018C54C(Boss* bossA6); -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i3/fox_a6/Area6_8018C54C.s") -#endif void Area6_8018D3CC(s32 arg0, f32 xPos, f32 yPos, f32 zPos, f32 xVel, f32 yVel, f32 zVel, f32 xRot, f32 yRot, f32 zRot) { From b4ca33057e05e750d59bc12ab8911e094c14e6fc Mon Sep 17 00:00:00 2001 From: inspectredc <78732756+inspectredc@users.noreply.github.com> Date: Sun, 7 Apr 2024 21:41:16 +0100 Subject: [PATCH 2/2] Match Aquas_801B6FF8 (#202) --- src/overlays/ovl_i3/fox_aq.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index a590f5ce..2d6948c2 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -3961,20 +3961,15 @@ void Aquas_801B6E54(Actor* actor) { } // OBJ_ACTOR_262 action -#ifdef NON_MATCHING -// reloads 0.0f for temp_fs2_2. -// https://decomp.me/scratch/02s9H - void Aquas_801B6FF8(Actor* actor) { s32 i; f32 temp_dx; f32 temp_dy; f32 temp_dz; - f32 temp_fs2_2; + s32 pad; f32 spA8; Vec3f sp9C; Vec3f sp90; - f32 var_fs0; if (actor->health == -100) { actor->itemDrop = DROP_SILVER_RING_50p; @@ -4015,15 +4010,15 @@ void Aquas_801B6FF8(Actor* actor) { temp_dy = actor->fwork[2] - actor->obj.pos.y; temp_dz = actor->fwork[3] - actor->obj.pos.z; spA8 = Math_RadToDeg(Math_Atan2F(temp_dx, temp_dz)); - var_fs0 = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(temp_dx) + SQ(temp_dz)))); - temp_fs2_2 = Math_SmoothStepToAngle(&actor->obj.rot.y, spA8, 0.1f, 1.0f, 0.0f); - Math_SmoothStepToAngle(&actor->obj.rot.x, var_fs0, 0.1f, 1.0f, 0.0f); + temp_dz = Math_RadToDeg(-Math_Atan2F(temp_dy, sqrtf(SQ(temp_dx) + SQ(temp_dz)))); + temp_dy = Math_SmoothStepToAngle(&actor->obj.rot.y, spA8, 0.1f, 1.0f, 0); + Math_SmoothStepToAngle(&actor->obj.rot.x, temp_dz, 0.1f, 1.0f, 0); - var_fs0 = 340.0f; - if (temp_fs2_2 < 0.0f) { - var_fs0 = 20.0f; + temp_dz = 340.0f; + if (temp_dy < 0.0f) { + temp_dz = 20.0f; } - Math_SmoothStepToAngle(&actor->obj.rot.z, var_fs0, 0.1f, 1.0f, 0.f); + Math_SmoothStepToAngle(&actor->obj.rot.z, temp_dz, 0.1f, 1.0f, 0.f); Matrix_RotateY(gCalcMatrix, actor->obj.rot.y * M_DTOR, 0); Matrix_RotateX(gCalcMatrix, actor->obj.rot.x * M_DTOR, 1); sp9C.x = sp9C.y = 0.0f; @@ -4075,9 +4070,6 @@ void Aquas_801B6FF8(Actor* actor) { } } } -#else -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i3/fox_aq/Aquas_801B6FF8.s") -#endif bool Aquas_801B76EC(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* thisx) { gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK);