Accurate region detection for NAND titles

This commit is contained in:
JosJuice
2018-10-28 10:33:16 +01:00
parent dd922660c9
commit 8baafcc523
6 changed files with 18 additions and 13 deletions

View File

@ -84,11 +84,15 @@ Country VolumeWAD::GetCountry(const Partition& partition) const
if (!m_tmd.IsValid())
return Country::Unknown;
u8 country_code = static_cast<u8>(m_tmd.GetTitleId() & 0xff);
if (country_code == 2) // SYSMENU
const u8 country_byte = static_cast<u8>(m_tmd.GetTitleId() & 0xff);
if (country_byte == 2) // SYSMENU
return TypicalCountryForRegion(GetSysMenuRegion(m_tmd.GetTitleVersion()));
return CountryCodeToCountry(country_code, Platform::WiiWAD);
const Region region = GetRegion();
if (CountryCodeToRegion(country_byte, Platform::WiiWAD, region) != region)
return TypicalCountryForRegion(region);
return CountryCodeToCountry(country_byte, Platform::WiiWAD, region);
}
const IOS::ES::TMDReader& VolumeWAD::GetTMD(const Partition& partition) const