mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-04-28 13:27:58 +03:00
Fix Rooftop Run barrels rolling backwards at HFR (#368)
This commit is contained in:
parent
a07610fb7a
commit
e86922b2b2
2 changed files with 17 additions and 0 deletions
|
@ -28,6 +28,17 @@ void HighFrameRateDeltaTimeFixMidAsmHook(PPCRegister& f1)
|
|||
f1.f64 = threshold;
|
||||
}
|
||||
|
||||
// This hook expects the vector register to store delta time at the first index.
|
||||
void HighFrameRateDeltaTimeFixVectorMidAsmHook(PPCVRegister& v62)
|
||||
{
|
||||
// Having 60 FPS threshold ensures we still retain
|
||||
// the original game behavior when locked to 30/60 FPS.
|
||||
constexpr double threshold = 1.0 / 60.0;
|
||||
|
||||
if (v62.f32[3] < threshold)
|
||||
v62.f32[3] = threshold;
|
||||
}
|
||||
|
||||
void CameraDeltaTimeFixMidAsmHook(PPCRegister& dest, PPCRegister& src)
|
||||
{
|
||||
dest.f64 = src.f64 / 30.0;
|
||||
|
|
|
@ -973,3 +973,9 @@ registers = ["r30", "f30"]
|
|||
name = "SparkleLocusMidAsmHook"
|
||||
address = 0x82E96804
|
||||
jump_address_on_true = 0x82E96808
|
||||
|
||||
# Rooftop Run barrel fix (works at up to ~400 FPS)
|
||||
[[midasm_hook]]
|
||||
name = "HighFrameRateDeltaTimeFixVectorMidAsmHook"
|
||||
address = 0x827673CC
|
||||
registers = ["v62"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue