From d352856927a9547f95439e9697a1944b51da262a Mon Sep 17 00:00:00 2001 From: massimilianodelliubaldini <8584296+massimilianodelliubaldini@users.noreply.github.com> Date: Thu, 19 Jun 2025 23:33:15 -0400 Subject: [PATCH] [jak2] Fix Fortress Crash by Patching Mips2C Function (#3963) Fixes #3151 by applying the same fix as #2686 to another Mips2C function. Tested by mashing Jak's body into the bad collision walls for 30 minutes without a single crash. --- game/mips2c/jak2_functions/collide_hash.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/game/mips2c/jak2_functions/collide_hash.cpp b/game/mips2c/jak2_functions/collide_hash.cpp index 1f262d7707..e644104d01 100644 --- a/game/mips2c/jak2_functions/collide_hash.cpp +++ b/game/mips2c/jak2_functions/collide_hash.cpp @@ -1066,9 +1066,11 @@ u64 execute(void* ctxt) { c->ppach(a3, r0, a3); // ppach a3, r0, a3 c->lqc2(vf11, 272, a2); // lqc2 vf11, 272(a2) c->dsll(a3, a3, 16); // dsll a3, a3, 16 - c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + + // patch vftoi0 calls because there's more bogus collide fragments + c->vftoi0_sat(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 bc = c->sgpr64(a3) != 0; // bne a3, r0, L63 - c->vftoi0(DEST::xyzw, vf4, vf4); // vftoi0.xyzw vf4, vf4 + c->vftoi0_sat(DEST::xyzw, vf4, vf4); // vftoi0.xyzw vf4, vf4 if (bc) {goto block_22;} // branch non-likely // nop // sll r0, r0, 0