From e6cd3b328376bb3ec71e4f4571991e5d4dec1397 Mon Sep 17 00:00:00 2001 From: comex Date: Thu, 12 Sep 2013 00:03:37 -0400 Subject: [PATCH] Fix placement of HLE::Patch to not get overwritten by HLE::PatchFunctions. (This applies to the existing HBReload hook, which would be erased in various circumstances depending on the type of file loaded.) --- Source/Core/Core/Src/Boot/Boot.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Source/Core/Core/Src/Boot/Boot.cpp b/Source/Core/Core/Src/Boot/Boot.cpp index 9f48b87a32..f35c24c594 100644 --- a/Source/Core/Core/Src/Boot/Boot.cpp +++ b/Source/Core/Core/Src/Boot/Boot.cpp @@ -184,18 +184,6 @@ bool CBoot::BootUp() NOTICE_LOG(BOOT, "Booting %s", _StartupPara.m_strFilename.c_str()); - // HLE jump to loader (homebrew). Disabled when Gecko is active as it interferes with the code handler - if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats) - { - HLE::Patch(0x80001800, "HBReload"); - const u8 stubstr[] = { 'S', 'T', 'U', 'B', 'H', 'A', 'X', 'X' }; - Memory::WriteBigEData(stubstr, 0x80001804, 8); - } - - // Not part of the binary itself, but either we or Gecko OS might insert - // this, and it doesn't clear the icache properly. - HLE::Patch(0x800018a8, "GeckoCodehandler"); - g_symbolDB.Clear(); VideoInterface::Preset(_StartupPara.bNTSC); switch (_StartupPara.m_BootType) @@ -419,6 +407,19 @@ bool CBoot::BootUp() return false; } } + + // HLE jump to loader (homebrew). Disabled when Gecko is active as it interferes with the code handler + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats) + { + HLE::Patch(0x80001800, "HBReload"); + const u8 stubstr[] = { 'S', 'T', 'U', 'B', 'H', 'A', 'X', 'X' }; + Memory::WriteBigEData(stubstr, 0x80001804, 8); + } + + // Not part of the binary itself, but either we or Gecko OS might insert + // this, and it doesn't clear the icache properly. + HLE::Patch(0x800018a8, "GeckoCodehandler"); + Host_UpdateLogDisplay(); return true; }