From e62bc44f15edfc21819994cd8908698f678d6b30 Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 13 Sep 2013 16:26:39 -0400 Subject: [PATCH] Use d01f1bad for the gameid check in RunCodeHandler rather than the actual ID. This avoids conflict with the icache hack. codehandleronly.s does not actually use the gameid, so it shouldn't matter. --- Source/Core/Core/Src/GeckoCode.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/Src/GeckoCode.cpp b/Source/Core/Core/Src/GeckoCode.cpp index 252e758746..f8359e1bc5 100644 --- a/Source/Core/Core/Src/GeckoCode.cpp +++ b/Source/Core/Core/Src/GeckoCode.cpp @@ -154,8 +154,9 @@ bool InstallCodeHandler() // Turn off Pause on start Memory::Write_U32(0, 0x80002774); - // Write the Game ID into the location expected by WiiRD - Memory::WriteBigEData(Memory::GetPointer(0x80000000), 0x80001800, 6); + // Write a magic value to 'gameid' (codehandleronly does not actually read this). + // For the purpose of this, see HLEGeckoCodehandler. + Memory::Write_U32(0xd01f1bad, 0x80001800); // Create GCT in memory Memory::Write_U32(0x00d0c0de, codelist_location); @@ -279,10 +280,7 @@ void RunCodeHandler() { if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats && active_codes.size() > 0) { - u8 *gameId = Memory::GetPointer(0x80000000); - u8 *wiirdId = Memory::GetPointer(0x80001800); - - if (!code_handler_installed || memcmp(gameId, wiirdId, 6)) + if (!code_handler_installed || Memory::Read_U32(0x80001800) - 0xd01f1bad > 5) code_handler_installed = InstallCodeHandler(); if (code_handler_installed)