Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8426 from JosJuice/volumeverifier-region-mismatch
VolumeVerifier: Improve region/game ID mismatch checking
  • Loading branch information
lioncash committed Oct 24, 2019
2 parents d95745f + 77b9a70 commit 780d34d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Source/Core/DiscIO/VolumeVerifier.cpp
Expand Up @@ -841,20 +841,26 @@ void VolumeVerifier::CheckMisc()
}

const Region region = m_volume.GetRegion();
const Platform platform = m_volume.GetVolumeType();

constexpr std::string_view GAMECUBE_PLACEHOLDER_ID = "RELSAB";
constexpr std::string_view WII_PLACEHOLDER_ID = "RABAZZ";

if (game_id_encrypted.size() < 4)
{
AddProblem(Severity::Low, Common::GetStringT("The game ID is unusually short."));
}
else
else if (game_id_encrypted != GAMECUBE_PLACEHOLDER_ID && game_id_encrypted != WII_PLACEHOLDER_ID)
{
char country_code;
if (IsDisc(m_volume.GetVolumeType()))
country_code = game_id_encrypted[3];
else
country_code = static_cast<char>(m_volume.GetTitleID().value_or(0) & 0xff);
if (CountryCodeToRegion(country_code, platform, region) != region)

const Platform platform = m_volume.GetVolumeType();
const std::optional<u16> revision = m_volume.GetRevision();

if (CountryCodeToRegion(country_code, platform, region, revision) != region)
{
AddProblem(Severity::Medium,
Common::GetStringT(
Expand Down

0 comments on commit 780d34d

Please sign in to comment.