GeckoCodes: Super Extended

This commit is contained in:
Nayla Hanegan 2024-09-03 21:10:35 -04:00
commit 280e8798d7
2 changed files with 28 additions and 21 deletions

View file

@ -153,10 +153,9 @@ bool IsGeckoCodeHandlerSUPER()
static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard) static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard)
{ {
std::string data; std::string data;
if (!File::ReadFileToString(File::GetSysDirectory() + GECKO_CODE_HANDLER, data)) if (!File::ReadFileToString(File::GetSysDirectory() + GetGeckoCodeHandlerPath(), data))
{ {
ERROR_LOG_FMT(ACTIONREPLAY, ERROR_LOG_FMT(ACTIONREPLAY, "Could not enable cheats because the selected codehandler was missing.");
"Could not enable cheats because " GECKO_CODE_HANDLER " was missing.");
return Installation::Failed; return Installation::Failed;
} }
@ -188,27 +187,36 @@ static Installation InstallCodeHandlerLocked(const Core::CPUThreadGuard& guard)
} }
} }
const bool is_mpn_handler_and_game_id_gp7e01 = const bool is_mpn_handler_and_game_id_rm8e01 =
IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP7E01"); 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 = const bool is_mpn_handler_and_game_id_gp6e01 =
IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP6E01"); IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP6E01");
const bool is_mpn_handler_and_game_id_gp5e01 = const bool is_mpn_handler_and_game_id_gp5e01 =
IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP5E01"); IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GP5E01");
const bool is_mpn_handler_and_game_id_gmpe01 =
IsGeckoCodeHandlerSUPER() && (SConfig::GetInstance().GetGameID() == "GMPE01");
u32 codelist_base_address = 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_gp6e01 ? INSTALLER_BASE_ADDRESS_MP6 :
is_mpn_handler_and_game_id_gp5e01 ? INSTALLER_BASE_ADDRESS_MP5 : 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<u32>(data.size()) - INSTALLER_BASE_ADDRESS + static_cast<u32>(data.size()) -
CODE_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_gp6e01 ? INSTALLER_END_ADDRESS_MP6 :
is_mpn_handler_and_game_id_gp5e01 ? INSTALLER_END_ADDRESS_MP5 : 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; INSTALLER_END_ADDRESS;
if (is_mpn_handler_and_game_id_gp7e01 || is_mpn_handler_and_game_id_gp6e01 || if (is_mpn_handler_and_game_id_rm8e01 || // is_mpn_handler_and_game_id_gp7e01 ||
is_mpn_handler_and_game_id_gp5e01) 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 // Move Gecko code handler to the free mem region
for (u32 addr = codelist_base_address; addr < codelist_end_address; addr += 4) for (u32 addr = codelist_base_address; addr < codelist_end_address; addr += 4)

View file

@ -50,21 +50,20 @@ bool operator!=(const GeckoCode::Code& lhs, const GeckoCode::Code& rhs);
constexpr u32 INSTALLER_BASE_ADDRESS = 0x80001800; constexpr u32 INSTALLER_BASE_ADDRESS = 0x80001800;
constexpr u32 INSTALLER_END_ADDRESS = 0x80003000; constexpr u32 INSTALLER_END_ADDRESS = 0x80003000;
// Override kerjump to 0x8023CF6C location for CodeHandler constexpr u32 INSTALLER_BASE_ADDRESS_MP8 = 0x801D2A90;
constexpr u32 INSTALLER_BASE_ADDRESS_MP7 = 0x8023CF6C; constexpr u32 INSTALLER_END_ADDRESS_MP8 = 0x801D9FA8;
constexpr u32 INSTALLER_END_ADDRESS_MP7 = 0x8023F9D0;
// Override kerjump to 0x80213974 location for CodeHandler constexpr u32 INSTALLER_BASE_ADDRESS_MP7 = 0x8025E2A4;
constexpr u32 INSTALLER_BASE_ADDRESS_MP6 = 0x817611C0; constexpr u32 INSTALLER_END_ADDRESS_MP7 = 0x80264438;
constexpr u32 INSTALLER_END_ADDRESS_MP6 = 0x817611C0;
// Override kerjump to 0x801A811C location for CodeHandler constexpr u32 INSTALLER_BASE_ADDRESS_MP6 = 0x80232C10;
constexpr u32 INSTALLER_BASE_ADDRESS_MP5 = 0x81788000; constexpr u32 INSTALLER_END_ADDRESS_MP6 = 0x8023A128;
constexpr u32 INSTALLER_END_ADDRESS_MP5 = 0x817F0000;
// Override kerjump to 0x8011CCC4 location for CodeHandler constexpr u32 INSTALLER_BASE_ADDRESS_MP5 = 0x801C1A10;
constexpr u32 INSTALLER_BASE_ADDRESS_MP4 = 0x81792D00; constexpr u32 INSTALLER_END_ADDRESS_MP5 = 0x801C8F28;
constexpr u32 INSTALLER_END_ADDRESS_MP4 = 0x817F0000;
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 = INSTALLER_BASE_ADDRESS + 0xA8;
constexpr u32 ENTRY_POINT_MP7 = INSTALLER_BASE_ADDRESS_MP7 + 0xA8; constexpr u32 ENTRY_POINT_MP7 = INSTALLER_BASE_ADDRESS_MP7 + 0xA8;