Skip to content

Commit 57be766

Browse files
committed
disabled fps limiter during loading
1 parent 56ad019 commit 57be766

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

source/dllmain.cpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,24 @@ class FrameLimiter
283283
}
284284
};
285285

286+
bool bLoadingShown = false;
287+
bool __cdecl sub_411F50(uint32_t* a1, uint32_t* a2)
288+
{
289+
bLoadingShown = false;
290+
if (!a1[2] && !a2[2]) {
291+
bLoadingShown = *a1 == *a2;
292+
return *a1 == *a2;
293+
}
294+
if (a1[2] != a2[2])
295+
return false;
296+
if (a1[0] != a2[0])
297+
return false;
298+
if (a1[1] != a2[1])
299+
return false;
300+
bLoadingShown = true;
301+
return true;
302+
}
303+
286304
FrameLimiter FpsLimiter;
287305
FrameLimiter CutsceneFpsLimiter;
288306
FrameLimiter ScriptCutsceneFpsLimiter;
@@ -293,7 +311,7 @@ void __cdecl sub_855640()
293311
{
294312
static auto preset = FusionFixSettings.GetRef("PREF_FPS_LIMIT_PRESET");
295313

296-
if (bLoadscreenShown && !*bLoadscreenShown)
314+
if (bLoadscreenShown && !*bLoadscreenShown && !bLoadingShown)
297315
{
298316
if (preset && *preset >= 2) {
299317
if (fFpsLimit > 0.0f || (*preset > 2 && *preset < fpsCaps.size()))
@@ -930,6 +948,9 @@ void Init()
930948

931949
pattern = hook::pattern("80 3D ? ? ? ? ? 53 56 8A FA");
932950
bLoadscreenShown = *pattern.get_first<uint8_t*>(2);
951+
952+
pattern = hook::pattern("8B 4C 24 04 8B 54 24 08 8B 41 08");
953+
injector::MakeJMP(pattern.get_first(0), sub_411F50, true);
933954
}
934955

935956
if (fScriptCutsceneFovLimit)

0 commit comments

Comments
 (0)