From 1c5f7dc3d5aa9aedda10e4db742faadbb1d97b1d Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Fri, 15 Jul 2022 19:54:46 -0400 Subject: [PATCH] [sparticle] workaround for 150fps crashes (#1655) --- game/mips2c/functions/sparticle_launcher.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/game/mips2c/functions/sparticle_launcher.cpp b/game/mips2c/functions/sparticle_launcher.cpp index 44721696e7..e78128f90e 100644 --- a/game/mips2c/functions/sparticle_launcher.cpp +++ b/game/mips2c/functions/sparticle_launcher.cpp @@ -367,7 +367,13 @@ u64 execute(void* ctxt) { c->lw(t4, 8, t1); // lw t4, 8(t1) bc = c->sgpr64(v1) == c->sgpr64(a3); // beq v1, a3, L151 c->daddiu(t3, t1, 12); // daddiu t3, t1, 12 - if (bc) {goto block_6;} // branch non-likely + if (bc) { + if (c->sgpr64(t4) != 0) { + goto block_6; + } else { + printf("HACK: ignoring cached adgif to avoid crash on particle with unset texture.\n"); + } + } // branch non-likely bc = c->sgpr64(t2) == 0; // beq t2, r0, L150 c->daddiu(t4, t1, 172); // daddiu t4, t1, 172