Added code to force the alternate game title (#1249)

This commit is contained in:
Hyper 2025-03-24 18:57:35 +00:00 committed by GitHub
parent 7f9ce5037e
commit 8ca5f1bf53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 1 deletions

View file

@ -53,6 +53,16 @@ void WerehogBattleMusicMidAsmHook(PPCRegister& r11)
r11.u8 = 3;
}
bool UseAlternateTitleMidAsmHook()
{
auto isSWA = Config::Language == ELanguage::Japanese;
if (Config::UseAlternateTitle)
isSWA = !isSWA;
return isSWA;
}
/* Hook function that gets the game region
and force result to zero for Japanese
to display the correct logos. */

View file

@ -282,7 +282,12 @@ const char* GameWindow::GetTitle()
{
if (Config::UseOfficialTitleOnTitleBar)
{
return Config::Language == ELanguage::Japanese
auto isSWA = Config::Language == ELanguage::Japanese;
if (Config::UseAlternateTitle)
isSWA = !isSWA;
return isSWA
? "SONIC WORLD ADVENTURE"
: "SONIC UNLEASHED";
}

View file

@ -92,6 +92,7 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, HomingAttackOnJump, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, HUDToggleKey, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, SaveScoreAtCheckpoints, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, SkipIntroLogos, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, UseAlternateTitle, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, UseArrowsForTimeOfDayTransition, false);
CONFIG_DEFINE_HIDDEN("Codes", bool, UseOfficialTitleOnTitleBar, false);

View file

@ -1105,3 +1105,9 @@ registers = ["r3"]
name = "DisableBoostFilterMidAsmHook"
address = 0x82B48C9C
registers = ["r11"]
[[midasm_hook]]
name = "UseAlternateTitleMidAsmHook"
address = 0x82580F44
jump_address_on_true = 0x82580F48
jump_address_on_false = 0x82580FA0