Skip to content

Commit 8ca5f1b

Browse files
authored
Added code to force the alternate game title (#1249)
1 parent 7f9ce50 commit 8ca5f1b

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

UnleashedRecomp/patches/misc_patches.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ void WerehogBattleMusicMidAsmHook(PPCRegister& r11)
5353
r11.u8 = 3;
5454
}
5555

56+
bool UseAlternateTitleMidAsmHook()
57+
{
58+
auto isSWA = Config::Language == ELanguage::Japanese;
59+
60+
if (Config::UseAlternateTitle)
61+
isSWA = !isSWA;
62+
63+
return isSWA;
64+
}
65+
5666
/* Hook function that gets the game region
5767
and force result to zero for Japanese
5868
to display the correct logos. */

UnleashedRecomp/ui/game_window.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,12 @@ const char* GameWindow::GetTitle()
282282
{
283283
if (Config::UseOfficialTitleOnTitleBar)
284284
{
285-
return Config::Language == ELanguage::Japanese
285+
auto isSWA = Config::Language == ELanguage::Japanese;
286+
287+
if (Config::UseAlternateTitle)
288+
isSWA = !isSWA;
289+
290+
return isSWA
286291
? "SONIC WORLD ADVENTURE"
287292
: "SONIC UNLEASHED";
288293
}

UnleashedRecomp/user/config_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, HomingAttackOnJump, false);
9292
CONFIG_DEFINE_HIDDEN("Codes", bool, HUDToggleKey, false);
9393
CONFIG_DEFINE_HIDDEN("Codes", bool, SaveScoreAtCheckpoints, false);
9494
CONFIG_DEFINE_HIDDEN("Codes", bool, SkipIntroLogos, false);
95+
CONFIG_DEFINE_HIDDEN("Codes", bool, UseAlternateTitle, false);
9596
CONFIG_DEFINE_HIDDEN("Codes", bool, UseArrowsForTimeOfDayTransition, false);
9697
CONFIG_DEFINE_HIDDEN("Codes", bool, UseOfficialTitleOnTitleBar, false);
9798

UnleashedRecompLib/config/SWA.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,3 +1105,9 @@ registers = ["r3"]
11051105
name = "DisableBoostFilterMidAsmHook"
11061106
address = 0x82B48C9C
11071107
registers = ["r11"]
1108+
1109+
[[midasm_hook]]
1110+
name = "UseAlternateTitleMidAsmHook"
1111+
address = 0x82580F44
1112+
jump_address_on_true = 0x82580F48
1113+
jump_address_on_false = 0x82580FA0

0 commit comments

Comments
 (0)