diff --git a/Source/Core/Core/GeckoCode.cpp b/Source/Core/Core/GeckoCode.cpp index 8e1744e121..36b57fa3d8 100644 --- a/Source/Core/Core/GeckoCode.cpp +++ b/Source/Core/Core/GeckoCode.cpp @@ -153,10 +153,9 @@ bool IsGeckoCodeHandlerSUPER() static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard) { std::string data; - if (!File::ReadFileToString(File::GetSysDirectory() + GECKO_CODE_HANDLER, data)) + if (!File::ReadFileToString(File::GetSysDirectory() + GetGeckoCodeHandlerPath(), data)) { - ERROR_LOG_FMT(ACTIONREPLAY, - "Could not enable cheats because " GECKO_CODE_HANDLER " was missing."); + ERROR_LOG_FMT(ACTIONREPLAY, "Could not enable cheats because the selected codehandler was missing."); return Installation::Failed; } @@ -188,27 +187,36 @@ static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard) } } - const bool is_mpn_handler_and_game_id_gp7e01 = - IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP7E01"); + const bool is_mpn_handler_and_game_id_rm8e01 = + IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "RM8E01"); + //const bool is_mpn_handler_and_game_id_gp7e01 = + // IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP7E01"); const bool is_mpn_handler_and_game_id_gp6e01 = IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP6E01"); const bool is_mpn_handler_and_game_id_gp5e01 = IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP5E01"); + const bool is_mpn_handler_and_game_id_gmpe01 = + IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GMPE01"); u32 codelist_base_address = - is_mpn_handler_and_game_id_gp7e01 ? INSTALLER_BASE_ADDRESS_MP7 : + is_mpn_handler_and_game_id_rm8e01 ? INSTALLER_BASE_ADDRESS_MP8 : + //is_mpn_handler_and_game_id_gp7e01 ? INSTALLER_BASE_ADDRESS_MP7 : is_mpn_handler_and_game_id_gp6e01 ? INSTALLER_BASE_ADDRESS_MP6 : is_mpn_handler_and_game_id_gp5e01 ? INSTALLER_BASE_ADDRESS_MP5 : + is_mpn_handler_and_game_id_gmpe01 ? INSTALLER_BASE_ADDRESS_MP4 : INSTALLER_BASE_ADDRESS + static_cast(data.size()) - CODE_SIZE; - u32 codelist_end_address = is_mpn_handler_and_game_id_gp7e01 ? INSTALLER_END_ADDRESS_MP7 : + u32 codelist_end_address = is_mpn_handler_and_game_id_rm8e01 ? INSTALLER_END_ADDRESS_MP8 : + // is_mpn_handler_and_game_id_gp7e01 ? INSTALLER_END_ADDRESS_MP7 : is_mpn_handler_and_game_id_gp6e01 ? INSTALLER_END_ADDRESS_MP6 : is_mpn_handler_and_game_id_gp5e01 ? INSTALLER_END_ADDRESS_MP5 : + is_mpn_handler_and_game_id_gmpe01 ? INSTALLER_END_ADDRESS_MP4 : INSTALLER_END_ADDRESS; - if (is_mpn_handler_and_game_id_gp7e01 || is_mpn_handler_and_game_id_gp6e01 || - is_mpn_handler_and_game_id_gp5e01) + if (is_mpn_handler_and_game_id_rm8e01 || // is_mpn_handler_and_game_id_gp7e01 || + is_mpn_handler_and_game_id_gp6e01 || is_mpn_handler_and_game_id_gp5e01 || + is_mpn_handler_and_game_id_gmpe01) { // Move Gecko code handler to the free mem region for (u32 addr = codelist_base_address; addr < codelist_end_address; addr += 4) diff --git a/Source/Core/Core/GeckoCode.h b/Source/Core/Core/GeckoCode.h index 482d1e8c83..9c79f3970b 100644 --- a/Source/Core/Core/GeckoCode.h +++ b/Source/Core/Core/GeckoCode.h @@ -50,21 +50,20 @@ bool operator!=(const GeckoCode::Code& lhs, const GeckoCode::Code& rhs); constexpr u32 INSTALLER_BASE_ADDRESS = 0x80001800; constexpr u32 INSTALLER_END_ADDRESS = 0x80003000; -// Override kerjump to 0x8023CF6C location for CodeHandler -constexpr u32 INSTALLER_BASE_ADDRESS_MP7 = 0x8023CF6C; -constexpr u32 INSTALLER_END_ADDRESS_MP7 = 0x8023F9D0; +constexpr u32 INSTALLER_BASE_ADDRESS_MP8 = 0x801D2A90; +constexpr u32 INSTALLER_END_ADDRESS_MP8 = 0x801D9FA8; -// Override kerjump to 0x80213974 location for CodeHandler -constexpr u32 INSTALLER_BASE_ADDRESS_MP6 = 0x817611C0; -constexpr u32 INSTALLER_END_ADDRESS_MP6 = 0x817611C0; +constexpr u32 INSTALLER_BASE_ADDRESS_MP7 = 0x8025E2A4; +constexpr u32 INSTALLER_END_ADDRESS_MP7 = 0x80264438; -// Override kerjump to 0x801A811C location for CodeHandler -constexpr u32 INSTALLER_BASE_ADDRESS_MP5 = 0x81788000; -constexpr u32 INSTALLER_END_ADDRESS_MP5 = 0x817F0000; +constexpr u32 INSTALLER_BASE_ADDRESS_MP6 = 0x80232C10; +constexpr u32 INSTALLER_END_ADDRESS_MP6 = 0x8023A128; -// Override kerjump to 0x8011CCC4 location for CodeHandler -constexpr u32 INSTALLER_BASE_ADDRESS_MP4 = 0x81792D00; -constexpr u32 INSTALLER_END_ADDRESS_MP4 = 0x817F0000; +constexpr u32 INSTALLER_BASE_ADDRESS_MP5 = 0x801C1A10; +constexpr u32 INSTALLER_END_ADDRESS_MP5 = 0x801C8F28; + +constexpr u32 INSTALLER_BASE_ADDRESS_MP4 = 0x80132208; +constexpr u32 INSTALLER_END_ADDRESS_MP4 = 0x80139720; constexpr u32 ENTRY_POINT = INSTALLER_BASE_ADDRESS + 0xA8; constexpr u32 ENTRY_POINT_MP7 = INSTALLER_BASE_ADDRESS_MP7 + 0xA8;