diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-10-30 04:28:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-30 04:28:18 +0100 |
| commit | 2764a3dc4498e295f5cf14adb89998ebc09fea62 (patch) | |
| tree | c46d5800d909aa1cbd8a911d4ab83b531fcd5f29 /Source/Core | |
| parent | bab34ca06062e6408cd6bb06e78d4b38963562be (diff) | |
| parent | fd95607700d22116f6d93271f6ac72ad23ee1946 (diff) | |
Merge pull request #13136 from Tilka/startup_patch
Core: apply Dolphin OnFrame patches right after boot
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/ConfigManager.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/PatchEngine.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/Core/PatchEngine.h | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 7eefe9b945..21d722290e 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -211,7 +211,7 @@ void SConfig::OnNewTitleLoad(const Core::CPUThreadGuard& guard) } CBoot::LoadMapFromFilename(guard, ppc_symbol_db); HLE::Reload(system); - PatchEngine::Reload(); + PatchEngine::Reload(system); HiresTexture::Update(); WC24PatchEngine::Reload(); } diff --git a/Source/Core/Core/PatchEngine.cpp b/Source/Core/Core/PatchEngine.cpp index 16be2960ba..9880977710 100644 --- a/Source/Core/Core/PatchEngine.cpp +++ b/Source/Core/Core/PatchEngine.cpp @@ -295,6 +295,13 @@ void RemoveMemoryPatch(std::size_t index) std::erase(s_on_frame_memory, index); } +static void ApplyStartupPatches(Core::System& system) +{ + ASSERT(Core::IsCPUThread()); + Core::CPUThreadGuard guard(system); + ApplyPatches(guard, s_on_frame); +} + bool ApplyFramePatches(Core::System& system) { const auto& ppc_state = system.GetPPCState(); @@ -332,10 +339,11 @@ void Shutdown() Gecko::Shutdown(); } -void Reload() +void Reload(Core::System& system) { Shutdown(); LoadPatches(); + ApplyStartupPatches(system); } } // namespace PatchEngine diff --git a/Source/Core/Core/PatchEngine.h b/Source/Core/Core/PatchEngine.h index 69ec0c9bb7..32e4ec93db 100644 --- a/Source/Core/Core/PatchEngine.h +++ b/Source/Core/Core/PatchEngine.h @@ -61,7 +61,7 @@ void RemoveMemoryPatch(std::size_t index); bool ApplyFramePatches(Core::System& system); void Shutdown(); -void Reload(); +void Reload(Core::System& system); inline int GetPatchTypeCharLength(PatchType type) { |
