Skip to content

Commit

Permalink
Fix copy paste error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyall committed Sep 19, 2024
1 parent bd3557d commit 55d6aa0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,42 +635,42 @@ void FOV()
void Framerate()
{
if (!bUncapFPS && fFPSCap != 30.00f) {
// Cutscene 30fps cap
uint8_t* FramerateCapScanResult = Memory::PatternScan(baseModule, "C7 44 ?? ?? 01 00 00 00 C7 44 ?? ?? ?? ?? 00 00 89 ?? ?? ?? C7 44 ?? ?? ?? ?? 00 00");
if (FramerateCapScanResult) {
spdlog::info("Framerate Cap: Address is {:s}+{:x}", sExeName.c_str(), (uintptr_t)FramerateCapScanResult - (uintptr_t)baseModule);
// Adjust cutscene 30fps cap
uint8_t* CutsceneFramerateCapScanResult = Memory::PatternScan(baseModule, "C7 44 ?? ?? 01 00 00 00 C7 44 ?? ?? ?? ?? 00 00 89 ?? ?? ?? C7 44 ?? ?? ?? ?? 00 00");
if (CutsceneFramerateCapScanResult) {
spdlog::info("FPS: Cutscene Framerate Cap: Address is {:s}+{:x}", sExeName.c_str(), (uintptr_t)CutsceneFramerateCapScanResult - (uintptr_t)baseModule);
int iFPSCap = static_cast<int>(fFPSCap * 100.00f);
Memory::Write((uintptr_t)FramerateCapScanResult + 0xC, (int)iFPSCap);
spdlog::info("Framerate Cap: Patched instruction and set framerate cap to {:d}.", iFPSCap);
Memory::Write((uintptr_t)CutsceneFramerateCapScanResult + 0xC, (int)iFPSCap);
spdlog::info("FPS: Cutscene Framerate Cap: Patched instruction and set framerate cap to {:d}.", iFPSCap);
}
else if (!FramerateCapScanResult) {
spdlog::error("Framerate Cap: Pattern scan failed.");
else if (!CutsceneFramerateCapScanResult) {
spdlog::error("FPS: Cutscene Framerate Cap: Pattern scan failed.");
}
}

if (bUncapFPS) {
// Remove 30fps framerate cap
uint8_t* FramerateCapScanResult = Memory::PatternScan(baseModule, "75 ?? 85 ?? 74 ?? 40 ?? 01 41 ?? ?? ?? ?? ?? ?? ??");
if (FramerateCapScanResult) {
spdlog::info("Framerate Cap: Address is {:s}+{:x}", sExeName.c_str(), (uintptr_t)FramerateCapScanResult - (uintptr_t)baseModule);
spdlog::info("FPS: Disable Cutscene Framerate Cap: Address is {:s}+{:x}", sExeName.c_str(), (uintptr_t)FramerateCapScanResult - (uintptr_t)baseModule);
Memory::PatchBytes((uintptr_t)FramerateCapScanResult + 0x8, "\x00", 1);
spdlog::info("Framerate Cap: Patched instruction.");
spdlog::info("FPS: Disable Cutscene Framerate Cap: Patched instruction.");
}
else if (!FramerateCapScanResult) {
spdlog::error("Framerate Cap: Pattern scan failed.");
spdlog::error("FPS: Disable Cutscene Framerate Cap: Pattern scan failed.");
}
}

if (bCutsceneFramegen) {
// Enable frame generation during real-time cutscenes
uint8_t* CutsceneFramegenScanResult = Memory::PatternScan(baseModule, "41 ?? ?? 74 ?? 33 ?? 48 ?? ?? E8 ?? ?? ?? ?? 8B ?? ?? ?? ?? ?? D1 ??");
if (CutsceneFramegenScanResult) {
spdlog::info("Cutscene Frame Generation: Address is {:s}+{:x}", sExeName.c_str(), (uintptr_t)CutsceneFramegenScanResult - (uintptr_t)baseModule);
spdlog::info("FPS: Cutscene Frame Generation: Address is {:s}+{:x}", sExeName.c_str(), (uintptr_t)CutsceneFramegenScanResult - (uintptr_t)baseModule);
Memory::PatchBytes((uintptr_t)CutsceneFramegenScanResult + 0x3, "\xEB", 1);
spdlog::info("Cutscene Frame Generation: Patched instruction.");
spdlog::info("FPS: Cutscene Frame Generation: Patched instruction.");
}
else if (!CutsceneFramegenScanResult) {
spdlog::error("Cutscene Frame Generation: Pattern scan failed.");
spdlog::error("FPS: Cutscene Frame Generation: Pattern scan failed.");
}
}
}
Expand Down

0 comments on commit 55d6aa0

Please sign in to comment.