From 64959177d90f158e2e39ca3a6b728f915bf084b5 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Thu, 1 Jun 2023 06:27:30 +1000 Subject: [PATCH] match func_808DDE9C (#1262) --- spec | 4 -- .../ovl_Object_Kankyo/z_object_kankyo.c | 56 ++++++++----------- 2 files changed, 24 insertions(+), 36 deletions(-) diff --git a/spec b/spec index 69d9bb5c81..14aff1cd74 100644 --- a/spec +++ b/spec @@ -1119,11 +1119,7 @@ beginseg name "ovl_Object_Kankyo" compress include "build/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_Object_Kankyo/ovl_Object_Kankyo_reloc.o" -#else - include "build/data/ovl_Object_Kankyo/ovl_Object_Kankyo.reloc.o" -#endif endseg beginseg diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index b8a7b3b16b..1c05a0981b 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -647,8 +647,6 @@ f32 func_808DDE74(void) { return Rand_ZeroOne() - 0.5f; } -#ifdef NON_MATCHING -// s2/s3 swapped void func_808DDE9C(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjectKankyo* this = THIS; @@ -674,25 +672,23 @@ void func_808DDE9C(Actor* thisx, PlayState* play2) { temp_f22 = this->unk_14C[0].unk_04 + ((Rand_ZeroOne() - 0.7f) * this->unk_144); temp_f2 = this->unk_14C[0].unk_08 + ((Rand_ZeroOne() - 0.7f) * this->unk_144); - if ((temp_f20 < -252.0f) && (temp_f20 > -500.0f) && (temp_f2 > 3820.0f) && (temp_f2 < 4150.0f)) { - continue; + if (!((temp_f20 < -252.0f) && (temp_f20 > -500.0f) && (temp_f2 > 3820.0f) && (temp_f2 < 4150.0f))) { + Matrix_Translate(temp_f20, temp_f22, temp_f2, MTXMODE_NEW); + + gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + + Matrix_RotateYS((s16)this->unk_14C[2].unk_04 + (s16)(i << 5), MTXMODE_APPLY); + Matrix_RotateXS((s16)this->unk_14C[2].unk_00 + (s16)(i << 5), MTXMODE_APPLY); + + if (this->unk_114C == 0) { + Matrix_Scale(0.5f, 1.0f, 0.5f, MTXMODE_APPLY); + } else { + Matrix_Scale(2.0f, 4.0f, 2.0f, MTXMODE_APPLY); + } + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_0706E0); } - - Matrix_Translate(temp_f20, temp_f22, temp_f2, MTXMODE_NEW); - - gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - - Matrix_RotateYS((s16)this->unk_14C[2].unk_04 + (s16)(i << 5), MTXMODE_APPLY); - Matrix_RotateXS((s16)this->unk_14C[2].unk_00 + (s16)(i << 5), MTXMODE_APPLY); - - if (this->unk_114C == 0) { - Matrix_Scale(0.5f, 1.0f, 0.5f, MTXMODE_APPLY); - } else { - Matrix_Scale(2.0f, 4.0f, 2.0f, MTXMODE_APPLY); - } - - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_0706E0); } phi_s5 = false; @@ -710,21 +706,17 @@ void func_808DDE9C(Actor* thisx, PlayState* play2) { temp_f22 = player->actor.floorHeight + 2.0f; temp_f2 = this->unk_14C[1].unk_08 + (func_808DDE74() * 220.0f); - if ((temp_f20 < -252.0f) && (temp_f20 > -500.0f) && (temp_f2 > 3820.0f) && (temp_f2 < 4150.0f)) { - continue; + if (!((temp_f20 < -252.0f) && (temp_f20 > -500.0f) && (temp_f2 > 3820.0f) && (temp_f2 < 4150.0f))) { + Matrix_Translate(temp_f20, temp_f22, temp_f2, MTXMODE_NEW); + temp_f12 = (Rand_ZeroOne() * 0.05f) + 0.05f; + Matrix_Scale(temp_f12, temp_f12, temp_f12, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); } - - Matrix_Translate(temp_f20, temp_f22, temp_f2, MTXMODE_NEW); - temp_f12 = (Rand_ZeroOne() * 0.05f) + 0.05f; - Matrix_Scale(temp_f12, temp_f12, temp_f12, MTXMODE_APPLY); - - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); } } CLOSE_DISPS(play->state.gfxCtx); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Object_Kankyo/func_808DDE9C.s") -#endif