Implement fix for Sparkle locus particle vertex corruption. (#317)

This commit is contained in:
Skyth (Asilkan) 2025-02-08 20:45:14 +03:00 committed by GitHub
parent 2fdd32e889
commit fff96a8528
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -159,3 +159,11 @@ PPC_FUNC(sub_82B00D00)
*pElapsedTime = std::max(*pElapsedTime, 0.0f); *pElapsedTime = std::max(*pElapsedTime, 0.0f);
} }
bool SparkleLocusMidAsmHook()
{
// There is an epsilon check in sparkle locus particle code that seems to never pass at high frame rates, which causes vertex corruption.
// Checking for equality doesn't fix it either, so we can fix it by forcing it to always execute instead.
// This has the side effect of the locus particle eventually snapping to the rest position during pause, but it's better than vertices exploding.
return App::s_deltaTime < (1.0 / 60.0);
}

View file

@ -957,3 +957,8 @@ registers = ["r3"]
name = "EvilHudGuideUpdateMidAsmHook" name = "EvilHudGuideUpdateMidAsmHook"
address = 0x82449800 address = 0x82449800
registers = ["r30", "f30"] registers = ["r30", "f30"]
[[midasm_hook]]
name = "SparkleLocusMidAsmHook"
address = 0x82E96804
jump_address_on_true = 0x82E96808