diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index d682293..315b511 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -1795,129 +1795,6 @@ DarkVehiclesFix4_MakeItDark: } // 1.0 ONLY ENDS HERE -static void* const FPSLimit_ReturnTrue = AddressByVersion(0x748D98, 0x74969D, 0x782D22); -static void* const FPSLimit_ReturnFalse = AddressByVersion(0x748DA3, 0x7496A8, 0x782D2D); -static int& FPSLimitVal = **AddressByVersion(0x619622, 0x619E42, 0x63B112); -void __declspec(naked) YesFPSLimit() -{ - static const double f1000 = 1000.0; - _asm - { - mov eax, [FPSLimitVal] - fild [eax] - fdivr [f1000] - fcomp [esp+94h-80h] - fnstsw ax - test ah, 5 - jp YesFPSLimit_Skip - - jmp FPSLimit_ReturnTrue - -YesFPSLimit_Skip: - jmp FPSLimit_ReturnFalse - } -} - -void __declspec(naked) NoFPSLimit() -{ - _asm - { - test al, al - jnz YesFPSLimit - - fld1 - fcomp [esp+94h-80h] - fnstsw ax - test ah, 5 - jp NoFPSLimit_Skip - - jmp FPSLimit_ReturnTrue - -NoFPSLimit_Skip: - jmp FPSLimit_ReturnFalse - } -} - -void __declspec(naked) YesFPSLimit_11() -{ - static const double f1000 = 1000.0; - _asm - { - mov eax, [FPSLimitVal] - fild [eax] - fdivr [f1000] - fcomp [esp+1Ch] - fnstsw ax - test ah, 5 - jp YesFPSLimit_Skip - - jmp FPSLimit_ReturnTrue - -YesFPSLimit_Skip: - jmp FPSLimit_ReturnFalse - } -} - -void __declspec(naked) NoFPSLimit_11() -{ - _asm - { - test al, al - jnz YesFPSLimit_11 - - fld1 - fcomp [esp+1Ch] - fnstsw ax - test ah, 5 - jp NoFPSLimit_Skip - - jmp FPSLimit_ReturnTrue - -NoFPSLimit_Skip: - jmp FPSLimit_ReturnFalse - } -} - -void __declspec(naked) YesFPSLimit_Steam() -{ - static const double f1000 = 1000.0; - _asm - { - mov eax, [FPSLimitVal] - fild [eax] - fdivr [f1000] - fcomp [esp+90h-78h] - fnstsw ax - test ah, 5 - jp YesFPSLimit_Skip - - jmp FPSLimit_ReturnTrue - -YesFPSLimit_Skip: - jmp FPSLimit_ReturnFalse - } -} - -void __declspec(naked) NoFPSLimit_Steam() -{ - _asm - { - test al, al - jnz YesFPSLimit_Steam - - fld1 - fcomp [esp+90h-78h] - fnstsw ax - test ah, 5 - jp NoFPSLimit_Skip - - jmp FPSLimit_ReturnTrue - -NoFPSLimit_Skip: - jmp FPSLimit_ReturnFalse - } -} - void __declspec(naked) GetMaxExtraDirectionals() { _asm @@ -2942,12 +2819,6 @@ void Patch_SA_10() Patch(0x746368, desktop.bottom); Patch(0x7463C8, aNoDesktopMode); - // 1000 FPS cap - Patch(AddressByRegion_10(0x748D69), 0x18); - Patch(AddressByRegion_10(0x748D72), 0x0F); - InjectHook(AddressByRegion_10(0x748D7D), NoFPSLimit, PATCH_JUMP); - InjectHook(AddressByRegion_10(0x748D82), YesFPSLimit, PATCH_JUMP); - // Corrected Map screen 1px issue Patch(0x575DE7, -0.5f); Patch(0x575DA7, -0.5f); @@ -3348,12 +3219,6 @@ void Patch_SA_11() Patch(0x746BE8, desktop.bottom); Patch(0x746C48, aNoDesktopMode); - // 1000 FPS cap - Patch(AddressByRegion_11(0x74966E), 0x18); - Patch(AddressByRegion_11(0x749677), 0x0F); - InjectHook(AddressByRegion_11(0x749682), NoFPSLimit_11, PATCH_JUMP); - InjectHook(AddressByRegion_11(0x749687), YesFPSLimit_11, PATCH_JUMP); - // Corrected Map screen 1px issue Patch(0x576357, -0.5f); Patch(0x576317, -0.5f); @@ -3655,12 +3520,6 @@ void Patch_SA_Steam() Patch(0x78021E, desktop.bottom); Patch(0x78027E, aNoDesktopMode); - // 1000 FPS cap - Patch(0x782CF1, 0x18); - Patch(0x782CFA, 0x0F); - InjectHook(0x782D05, NoFPSLimit_Steam, PATCH_JUMP); - InjectHook(0x782D0A, YesFPSLimit_Steam, PATCH_JUMP); - // Corrected Map screen 1px issue /*Patch(0x575DE7, -5.0f); Patch(0x575DA7, -5.0f);