Skip to content

Fix "Use Alternate Title" code not swapping logos for certain scenarios #1519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions UnleashedRecomp/patches/misc_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ bool UseAlternateTitleMidAsmHook()
return isSWA;
}

bool UseAlternateTitleStaffRollMidAsmHook(PPCRegister& r1)
{
auto pGroupName = (Hedgehog::Base::CSharedString*)g_memory.Translate(r1.s64 + 0x60);

if (Config::UseAlternateTitle)
{
// Redirect English title to Japanese title.
if (strcmp(pGroupName->c_str(), "OFCI5") == 0 || strcmp(pGroupName->c_str(), "OTLR11") == 0)
return Config::Language == ELanguage::Japanese;

// Redirect Japanese title to English title.
if (strcmp(pGroupName->c_str(), "JFCI7") == 0 || strcmp(pGroupName->c_str(), "JTLR13") == 0)
return Config::Language != ELanguage::Japanese;
}

if (pGroupName->c_str()[0] == 'J')
return Config::Language == ELanguage::Japanese;

if (pGroupName->c_str()[0] == 'O')
return Config::Language != ELanguage::Japanese;

return true;
}

/* Hook function that gets the game region
and force result to zero for Japanese
to display the correct logos. */
Expand Down
23 changes: 23 additions & 0 deletions UnleashedRecompLib/config/SWA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1101,12 +1101,35 @@ name = "ObjGrindDashPanelAllocMidAsmHook"
address = 0x82614948
registers = ["r3"]

# Title screen logo
[[midasm_hook]]
name = "UseAlternateTitleMidAsmHook"
address = 0x82580F44
jump_address_on_true = 0x82580F48
jump_address_on_false = 0x82580FA0

# Advertise movie logo
[[midasm_hook]]
name = "UseAlternateTitleMidAsmHook"
address = 0x82B73780
jump_address_on_true = 0x82B73784
jump_address_on_false = 0x82B737F8

# Opening movie logo
[[midasm_hook]]
name = "UseAlternateTitleMidAsmHook"
address = 0x82B73630
jump_address_on_true = 0x82B73634
jump_address_on_false = 0x82B736B0

# Staff roll logo
[[midasm_hook]]
name = "UseAlternateTitleStaffRollMidAsmHook"
address = 0x8257EBF0
registers = ["r1"]
jump_address_on_true = 0x8257EC7C
jump_address_on_false = 0x8257ECC0

[[midasm_hook]]
name = "EndingTextAllocMidAsmHook"
address = 0x8257E284
Expand Down
Loading