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.
This commit is contained in:
comex 2013-09-13 16:26:39 -04:00
parent e6cd3b3283
commit e62bc44f15
1 changed files with 4 additions and 6 deletions

View File

@ -154,8 +154,9 @@ bool InstallCodeHandler()
// Turn off Pause on start // Turn off Pause on start
Memory::Write_U32(0, 0x80002774); Memory::Write_U32(0, 0x80002774);
// Write the Game ID into the location expected by WiiRD // Write a magic value to 'gameid' (codehandleronly does not actually read this).
Memory::WriteBigEData(Memory::GetPointer(0x80000000), 0x80001800, 6); // For the purpose of this, see HLEGeckoCodehandler.
Memory::Write_U32(0xd01f1bad, 0x80001800);
// Create GCT in memory // Create GCT in memory
Memory::Write_U32(0x00d0c0de, codelist_location); Memory::Write_U32(0x00d0c0de, codelist_location);
@ -279,10 +280,7 @@ void RunCodeHandler()
{ {
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats && active_codes.size() > 0) if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats && active_codes.size() > 0)
{ {
u8 *gameId = Memory::GetPointer(0x80000000); if (!code_handler_installed || Memory::Read_U32(0x80001800) - 0xd01f1bad > 5)
u8 *wiirdId = Memory::GetPointer(0x80001800);
if (!code_handler_installed || memcmp(gameId, wiirdId, 6))
code_handler_installed = InstallCodeHandler(); code_handler_installed = InstallCodeHandler();
if (code_handler_installed) if (code_handler_installed)