Add warning comments to RegionSwitch and code that uses it

This commit is contained in:
JosJuice
2017-07-16 14:49:28 +02:00
parent cd60810d9d
commit db1c534b3e
6 changed files with 19 additions and 9 deletions

View File

@ -44,6 +44,7 @@ int GCMemcardDirectory::LoadGCI(const std::string& file_name, DiscIO::Region car
return NO_INDEX;
}
// This isn't a reliable way to detect regions. TODO: Get rid of this?
DiscIO::Region gci_region = DiscIO::RegionSwitchGC(gci.m_gci_header.Gamecode[3]);
// Some special save files have game IDs that we parse as UNKNOWN_REGION. For instance:
// - Datel Action Replay uses C as the fourth character. (Can be on any region's card.)

View File

@ -232,14 +232,6 @@ u64 TMDReader::GetIOSId() const
return Common::swap64(m_bytes.data() + offsetof(TMDHeader, ios_id));
}
DiscIO::Region TMDReader::GetRegion() const
{
if (GetTitleId() == Titles::SYSTEM_MENU)
return DiscIO::GetSysMenuRegion(GetTitleVersion());
return DiscIO::RegionSwitchWii(static_cast<u8>(GetTitleId() & 0xff));
}
u64 TMDReader::GetTitleId() const
{
return Common::swap64(m_bytes.data() + offsetof(TMDHeader, title_id));
@ -260,6 +252,14 @@ u16 TMDReader::GetGroupId() const
return Common::swap16(m_bytes.data() + offsetof(TMDHeader, group_id));
}
DiscIO::Region TMDReader::GetRegion() const
{
if (GetTitleId() == Titles::SYSTEM_MENU)
return DiscIO::GetSysMenuRegion(GetTitleVersion());
return DiscIO::RegionSwitchWii(static_cast<u8>(GetTitleId() & 0xff));
}
std::string TMDReader::GetGameID() const
{
char game_id[6];

View File

@ -185,12 +185,14 @@ public:
u16 GetBootIndex() const;
u64 GetIOSId() const;
DiscIO::Region GetRegion() const;
u64 GetTitleId() const;
u32 GetTitleFlags() const;
u16 GetTitleVersion() const;
u16 GetGroupId() const;
// Provides a best guess for the region. Might be inaccurate or UNKNOWN_REGION.
DiscIO::Region GetRegion() const;
// Constructs a 6-character game ID in the format typically used by Dolphin.
// If the 6-character game ID would contain unprintable characters,
// the title ID converted to hexadecimal is returned instead.