Add player 2D camera HFR patches.

This commit is contained in:
Skyth 2024-11-05 15:17:31 +03:00
parent 8ff30ab383
commit 88c7b8b8d5
2 changed files with 42 additions and 0 deletions

View file

@ -370,4 +370,9 @@ void CameraTargetSideOffsetLerpFixMidAsmHook(PPCVRegister& v13, PPCVRegister& v6
}
}
void Camera2DLerpFixMidAsmHook(PPCRegister& t, PPCRegister& deltaTime)
{
t.f64 = ComputeLerpFactor(std::min<double>(1.0, t.f64 * 2.0), deltaTime.f64 / 60.0);
}
#pragma endregion

View file

@ -287,6 +287,43 @@ name = "CameraTargetSideOffsetLerpFixMidAsmHook"
address = 0x8247F12C # Target side offset
registers = ["v13", "v62", "f21"]
# 2D camera HFR fixes
[[midasm_hook]]
name = "Camera2DLerpFixMidAsmHook"
address = 0x824761AC # Player velocity
registers = ["f0", "f28"]
jump_address = 0x824761B0
[[midasm_hook]]
name = "Camera2DLerpFixMidAsmHook"
address = 0x824762AC # Player position
registers = ["f0", "f28"]
jump_address = 0x824762B0
[[midasm_hook]]
name = "Camera2DLerpFixMidAsmHook"
address = 0x8247645C # Spherical position
registers = ["f0", "f28"]
jump_address = 0x82476460
[[midasm_hook]]
name = "Camera2DLerpFixMidAsmHook"
address = 0x82476514 # Target up offset
registers = ["f0", "f28"]
jump_address = 0x82476518
[[midasm_hook]]
name = "Camera2DLerpFixMidAsmHook"
address = 0x824768A0 # Spherical position
registers = ["f0", "f28"]
jump_address = 0x824768A4
[[midasm_hook]]
name = "Camera2DLerpFixMidAsmHook"
address = 0x824768C8 # Spherical position
registers = ["f0", "f28"]
jump_address = 0x824768CC
[[midasm_hook]]
name = "GetStageIDMidAsmHook"
address = 0x82528198