Core: Set bWii before calling Host_TitleChanged

This commit is contained in:
JosJuice 2020-09-13 16:36:27 +02:00
parent 43d11ca3eb
commit 1ddf7277b9
1 changed files with 12 additions and 10 deletions

View File

@ -819,10 +819,10 @@ struct SetGameMetadata
SetGameMetadata(SConfig* config_, DiscIO::Region* region_) : config(config_), region(region_) {} SetGameMetadata(SConfig* config_, DiscIO::Region* region_) : config(config_), region(region_) {}
bool operator()(const BootParameters::Disc& disc) const bool operator()(const BootParameters::Disc& disc) const
{ {
config->SetRunningGameMetadata(*disc.volume, disc.volume->GetGamePartition()); *region = disc.volume->GetRegion();
config->bWii = disc.volume->GetVolumeType() == DiscIO::Platform::WiiDisc; config->bWii = disc.volume->GetVolumeType() == DiscIO::Platform::WiiDisc;
config->m_disc_booted_from_game_list = true; config->m_disc_booted_from_game_list = true;
*region = disc.volume->GetRegion(); config->SetRunningGameMetadata(*disc.volume, disc.volume->GetGamePartition());
return true; return true;
} }
@ -831,9 +831,8 @@ struct SetGameMetadata
if (!executable.reader->IsValid()) if (!executable.reader->IsValid())
return false; return false;
config->bWii = executable.reader->IsWii();
*region = DiscIO::Region::Unknown; *region = DiscIO::Region::Unknown;
config->bWii = executable.reader->IsWii();
// Strip the .elf/.dol file extension and directories before the name // Strip the .elf/.dol file extension and directories before the name
SplitPath(executable.path, nullptr, &config->m_debugger_game_id, nullptr); SplitPath(executable.path, nullptr, &config->m_debugger_game_id, nullptr);
@ -854,9 +853,10 @@ struct SetGameMetadata
} }
const IOS::ES::TMDReader& tmd = wad.GetTMD(); const IOS::ES::TMDReader& tmd = wad.GetTMD();
config->SetRunningGameMetadata(tmd, DiscIO::Platform::WiiWAD);
config->bWii = true;
*region = tmd.GetRegion(); *region = tmd.GetRegion();
config->bWii = true;
config->SetRunningGameMetadata(tmd, DiscIO::Platform::WiiWAD);
return true; return true;
} }
@ -869,16 +869,18 @@ struct SetGameMetadata
PanicAlertT("This title cannot be booted."); PanicAlertT("This title cannot be booted.");
return false; return false;
} }
config->SetRunningGameMetadata(tmd, DiscIO::Platform::WiiWAD);
config->bWii = true;
*region = tmd.GetRegion(); *region = tmd.GetRegion();
config->bWii = true;
config->SetRunningGameMetadata(tmd, DiscIO::Platform::WiiWAD);
return true; return true;
} }
bool operator()(const BootParameters::IPL& ipl) const bool operator()(const BootParameters::IPL& ipl) const
{ {
config->bWii = false;
*region = ipl.region; *region = ipl.region;
config->bWii = false;
return true; return true;
} }
@ -888,8 +890,8 @@ struct SetGameMetadata
if (!dff_file) if (!dff_file)
return false; return false;
config->bWii = dff_file->GetIsWii();
*region = DiscIO::Region::NTSC_U; *region = DiscIO::Region::NTSC_U;
config->bWii = dff_file->GetIsWii();
return true; return true;
} }