diff --git a/readme.md b/readme.md index dbf0c4e9..01b5b0e8 100644 --- a/readme.md +++ b/readme.md @@ -24,7 +24,6 @@ The original repository has no support for GFWL (it does have support for outdat - Change the default option of `SkipMenu` to 0 to be able to load into DLC's first. - Change the default option of `RecoilFix` to 0 to avoid being as disadvantage to other players in the multiplayer. - Enable Windowed by default, which also enables Borderless and No Block on Focus Loss. -- Fixed loading text glow and broken cop blips (by removing a fix? huh?) Keep in mind that you still want additional mods to be used for a pleasant GFWL multiplayer experience, including disabling the mod check to even allow this fork to work. diff --git a/source/frameratevigilante.ixx b/source/frameratevigilante.ixx index d17dd1e2..2dfdc20d 100644 --- a/source/frameratevigilante.ixx +++ b/source/frameratevigilante.ixx @@ -51,6 +51,20 @@ public: }; injector::MakeInline(pattern.get_first(0), pattern.get_first(6)); } + pattern = hook::pattern("F3 0F 10 05 ? ? ? ? F3 0F 58 C1 F3 0F 11 05 ? ? ? ? EB 36"); + if (!pattern.empty()) + { + static auto f1032790 = *pattern.get_first(4); + struct LoadingTextSpeed + { + void operator()(injector::reg_pack& regs) + { + regs.xmm0.f32[0] = *f1032790 * *CTimer::fTimeStep; + regs.xmm0.f32[0] += regs.xmm1.f32[0]; + } + }; injector::MakeInline(pattern.get_first(0), pattern.get_first(12)); + } + pattern = hook::pattern("F3 0F 58 0D ? ? ? ? 0F 5B C0 F3 0F 11 0D"); if (!pattern.empty()) { @@ -75,7 +89,7 @@ public: } // CD/busy spinner - pattern = find_pattern("F3 0F 58 05 ? ? ? ? 33 C0 A3 ? ? ? ? F3 0F 11 05"); + pattern = hook::pattern("F3 0F 58 05 ? ? ? ? 33 C0 A3 ? ? ? ? F3 0F 11 05"); if (!pattern.empty()) { struct CDSpinnerHook @@ -86,6 +100,26 @@ public: } }; injector::MakeInline(pattern.get_first(0), pattern.get_first(8)); } + + // Cop blips + pattern = hook::pattern("F3 0F 10 4C 24 ? 0F 28 C1 F3 0F 59 C2"); + if (!pattern.empty()) + { + static int CustomFrameCounter = 0; + + static auto CounterHook = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) + { + static float accumulator = 0.0f; + accumulator += (*CTimer::fTimeStep / (1.0f / 30.0f)); + int increment = static_cast(accumulator); + CustomFrameCounter += increment; + accumulator -= increment; + }); + + pattern = hook::pattern("A1 ? ? ? ? 6B C0 15"); + if (!pattern.empty()) + injector::WriteMemory(pattern.get_first(1), &CustomFrameCounter, true); + } }; } } FramerateVigilante;