From bef2275f319d07c36a93c65f2c76d20315f6f59e Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 28 Jun 2024 17:57:40 +0200 Subject: [PATCH] Core/PatchEngine: Remove remnants of Speedhack system All usages of this have been removed many years ago in cbe9c3e040a466bba410f025e026ed84f3f8b1c0 --- Source/Core/Core/PatchEngine.cpp | 37 ----------------------- Source/Core/Core/PatchEngine.h | 2 -- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 3 -- Source/Core/Core/PowerPC/JitArm64/Jit.cpp | 3 -- 4 files changed, 45 deletions(-) diff --git a/Source/Core/Core/PatchEngine.cpp b/Source/Core/Core/PatchEngine.cpp index 8aac8f1397..f020c754eb 100644 --- a/Source/Core/Core/PatchEngine.cpp +++ b/Source/Core/Core/PatchEngine.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -48,7 +47,6 @@ constexpr std::array s_patch_type_strings{{ static std::vector s_on_frame; static std::vector s_on_frame_memory; static std::mutex s_on_frame_memory_mutex; -static std::map s_speed_hacks; const char* PatchTypeAsString(PatchType type) { @@ -175,38 +173,6 @@ void SavePatchSection(Common::IniFile* local_ini, const std::vector& patc local_ini->SetLines("OnFrame", lines); } -static void LoadSpeedhacks(const std::string& section, Common::IniFile& ini) -{ - std::vector keys; - ini.GetKeys(section, &keys); - for (const std::string& key : keys) - { - std::string value; - ini.GetOrCreateSection(section)->Get(key, &value, "BOGUS"); - if (value != "BOGUS") - { - u32 address; - u32 cycles; - bool success = true; - success &= TryParse(key, &address); - success &= TryParse(value, &cycles); - if (success) - { - s_speed_hacks[address] = cycles; - } - } - } -} - -u32 GetSpeedhackCycles(const u32 addr) -{ - const auto iter = s_speed_hacks.find(addr); - if (iter == s_speed_hacks.end()) - return 0; - - return iter->second; -} - void LoadPatches() { const auto& sconfig = SConfig::GetInstance(); @@ -227,8 +193,6 @@ void LoadPatches() Gecko::SetActiveCodes(Gecko::LoadCodes(globalIni, localIni)); ActionReplay::LoadAndApplyCodes(globalIni, localIni); } - - LoadSpeedhacks("Speedhacks", merged); } static void ApplyPatches(const Core::CPUThreadGuard& guard, const std::vector& patches) @@ -360,7 +324,6 @@ bool ApplyFramePatches(Core::System& system) void Shutdown() { s_on_frame.clear(); - s_speed_hacks.clear(); ActionReplay::ApplyCodes({}); Gecko::Shutdown(); } diff --git a/Source/Core/Core/PatchEngine.h b/Source/Core/Core/PatchEngine.h index 128eda26c9..69ec0c9bb7 100644 --- a/Source/Core/Core/PatchEngine.h +++ b/Source/Core/Core/PatchEngine.h @@ -49,8 +49,6 @@ struct Patch const char* PatchTypeAsString(PatchType type); -u32 GetSpeedhackCycles(const u32 addr); - std::optional DeserializeLine(std::string line); std::string SerializeLine(const PatchEntry& entry); void LoadPatchSection(const std::string& section, std::vector* patches, diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index ce63b2e3c4..3c27e16fad 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -958,9 +958,6 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC) js.fastmemLoadStore = nullptr; js.fixupExceptionHandler = false; - if (!m_enable_debugging) - js.downcountAmount += PatchEngine::GetSpeedhackCycles(js.compilerPC); - if (i == (code_block.m_num_instructions - 1)) { js.isLastInstruction = true; diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 6db978402f..e5e6f76dda 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -1145,9 +1145,6 @@ bool JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC) js.downcountAmount += opinfo->num_cycles; js.isLastInstruction = i == (code_block.m_num_instructions - 1); - if (!m_enable_debugging) - js.downcountAmount += PatchEngine::GetSpeedhackCycles(js.compilerPC); - // Skip calling UpdateLastUsed for lmw/stmw - it usually hurts more than it helps if (op.inst.OPCD != 46 && op.inst.OPCD != 47) gpr.UpdateLastUsed(op.regsIn | op.regsOut);