diff --git a/UnleashedRecomp/game.cpp b/UnleashedRecomp/game.cpp index 5a3d790..495d15b 100644 --- a/UnleashedRecomp/game.cpp +++ b/UnleashedRecomp/game.cpp @@ -162,4 +162,14 @@ PPC_FUNC(sub_825197C0) __imp__sub_825197C0(ctx, base); } +void HighFrameRateDeltaTimeFixMidAsmHook(PPCRegister& f1) +{ + // 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 (f1.f64 < threshold) + f1.f64 = threshold; +} + #pragma endregion diff --git a/UnleashedRecompLib/config/SWA.toml b/UnleashedRecompLib/config/SWA.toml index 298870f..5aee152 100644 --- a/UnleashedRecompLib/config/SWA.toml +++ b/UnleashedRecompLib/config/SWA.toml @@ -140,4 +140,51 @@ jump_address_on_true = 0x827A2E4C [[midasm_hook]] name = "SetXButtonHomingMidAsmHook" address = 0x8237AC88 -registers = ["r30"] \ No newline at end of file +registers = ["r30"] + +# Down force HFR fix +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x8234AB94 +registers = ["f1"] + +# 2D spline HFR fix +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x82345468 +registers = ["f1"] + +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x8234547C +registers = ["f1"] + +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x823454B0 +registers = ["f1"] + +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x82345534 +registers = ["f1"] + +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x823455EC +registers = ["f1"] + +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x8234564C +registers = ["f1"] + +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x823457A8 +registers = ["f1"] + +[[midasm_hook]] +name = "HighFrameRateDeltaTimeFixMidAsmHook" +address = 0x823458A0 +registers = ["f1"]