From 5a1ebe232ed1c7a8d8de147c4ea95f3e04fdbdaa Mon Sep 17 00:00:00 2001 From: Sepalani Date: Thu, 6 Apr 2017 15:42:08 +0100 Subject: [PATCH] HLE: Add Reload() function --- Source/Core/Core/ConfigManager.cpp | 3 +-- Source/Core/Core/HLE/HLE.cpp | 7 +++++++ Source/Core/Core/HLE/HLE.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 2a1cc18604..ba10d0aeb8 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -785,8 +785,7 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, u64 title_id, u // TODO: have a callback mechanism for title changes? g_symbolDB.Clear(); CBoot::LoadMapFromFilename(); - HLE::Clear(); - HLE::PatchFunctions(); + HLE::Reload(); PatchEngine::Reload(); HiresTexture::Update(); } diff --git a/Source/Core/Core/HLE/HLE.cpp b/Source/Core/Core/HLE/HLE.cpp index 52cf570977..e2e2a20919 100644 --- a/Source/Core/Core/HLE/HLE.cpp +++ b/Source/Core/Core/HLE/HLE.cpp @@ -160,6 +160,13 @@ void Clear() s_original_instructions.clear(); } +void Reload() +{ + Clear(); + PatchFixedFunctions(); + PatchFunctions(); +} + void Execute(u32 _CurrentPC, u32 _Instruction) { unsigned int FunctionIndex = _Instruction & 0xFFFFF; diff --git a/Source/Core/Core/HLE/HLE.h b/Source/Core/Core/HLE/HLE.h index dcd9c0d2b3..8cc513124f 100644 --- a/Source/Core/Core/HLE/HLE.h +++ b/Source/Core/Core/HLE/HLE.h @@ -27,6 +27,7 @@ enum HookFlag void PatchFixedFunctions(); void PatchFunctions(); void Clear(); +void Reload(); void Patch(u32 pc, const char* func_name); u32 UnPatch(const std::string& patchName);