mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Accurate region detection for NAND titles
This commit is contained in:
@ -295,11 +295,16 @@ u16 TMDReader::GetGroupId() const
|
||||
|
||||
DiscIO::Region TMDReader::GetRegion() const
|
||||
{
|
||||
if (!IsChannel(GetTitleId()))
|
||||
return DiscIO::Region::Unknown;
|
||||
|
||||
if (GetTitleId() == Titles::SYSTEM_MENU)
|
||||
return DiscIO::GetSysMenuRegion(GetTitleVersion());
|
||||
|
||||
return DiscIO::CountryCodeToRegion(static_cast<u8>(GetTitleId() & 0xff),
|
||||
DiscIO::Platform::WiiWAD);
|
||||
const DiscIO::Region region =
|
||||
static_cast<DiscIO::Region>(Common::swap16(m_bytes.data() + offsetof(TMDHeader, region)));
|
||||
|
||||
return region <= DiscIO::Region::NTSC_K ? region : DiscIO::Region::Unknown;
|
||||
}
|
||||
|
||||
std::string TMDReader::GetGameID() const
|
||||
|
@ -201,8 +201,6 @@ public:
|
||||
u32 GetTitleFlags() const;
|
||||
u16 GetTitleVersion() const;
|
||||
u16 GetGroupId() const;
|
||||
|
||||
// Provides a best guess for the region. Might be inaccurate or Region::Unknown.
|
||||
DiscIO::Region GetRegion() const;
|
||||
|
||||
// Constructs a 6-character game ID in the format typically used by Dolphin.
|
||||
|
Reference in New Issue
Block a user