diff options
| author | JosJuice <josjuice@gmail.com> | 2019-04-11 16:39:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-11 16:39:49 +0200 |
| commit | d5ed3cbd88b9cd473b4de5fbbf576ab18db2ab37 (patch) | |
| tree | 3ccba3b1e0c4e4e285ec6069f83c0efebb6ee253 /Source/Core/DiscIO/Enums.cpp | |
| parent | 372b8552ce7c94c026e2309c0b9089440bdae672 (diff) | |
| parent | 8709b21ac30f5da5c32ef056b6562a37345b5f82 (diff) | |
Merge pull request #7922 from JosJuice/verify-disc
Add a Verify tab to game properties
Diffstat (limited to 'Source/Core/DiscIO/Enums.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Enums.cpp | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/Source/Core/DiscIO/Enums.cpp b/Source/Core/DiscIO/Enums.cpp index e46ca238d0..f3f1f3bf71 100644 --- a/Source/Core/DiscIO/Enums.cpp +++ b/Source/Core/DiscIO/Enums.cpp @@ -145,7 +145,8 @@ Country TypicalCountryForRegion(Region region) } } -Region CountryCodeToRegion(u8 country_code, Platform platform, Region expected_region) +Region CountryCodeToRegion(u8 country_code, Platform platform, Region expected_region, + std::optional<u16> revision) { switch (country_code) { @@ -159,11 +160,24 @@ Region CountryCodeToRegion(u8 country_code, Platform platform, Region expected_r return Region::NTSC_J; // Korean GC games in English or Taiwanese Wii games case 'E': - if (expected_region == Region::NTSC_J) - return Region::NTSC_J; // Korean GC games in English - else + if (platform != Platform::GameCubeDisc) return Region::NTSC_U; // The most common country code for NTSC-U + if (revision) + { + if (*revision >= 0x30) + return Region::NTSC_J; // Korean GC games in English + else + return Region::NTSC_U; // The most common country code for NTSC-U + } + else + { + if (expected_region == Region::NTSC_J) + return Region::NTSC_J; // Korean GC games in English + else + return Region::NTSC_U; // The most common country code for NTSC-U + } + case 'B': case 'N': return Region::NTSC_U; @@ -198,7 +212,8 @@ Region CountryCodeToRegion(u8 country_code, Platform platform, Region expected_r } } -Country CountryCodeToCountry(u8 country_code, Platform platform, Region region) +Country CountryCodeToCountry(u8 country_code, Platform platform, Region region, + std::optional<u16> revision) { switch (country_code) { @@ -214,10 +229,10 @@ Country CountryCodeToCountry(u8 country_code, Platform platform, Region region) return region == Region::NTSC_U ? Country::USA : Country::Europe; case 'W': - if (region == Region::PAL) - return Country::Europe; // Only the Nordic version of Ratatouille (Wii) - else if (platform == Platform::GameCubeDisc) + if (platform == Platform::GameCubeDisc) return Country::Korea; // GC games in English released in Korea + else if (region == Region::PAL) + return Country::Europe; // Only the Nordic version of Ratatouille (Wii) else return Country::Taiwan; // Wii games in traditional Chinese released in Taiwan @@ -251,11 +266,24 @@ Country CountryCodeToCountry(u8 country_code, Platform platform, Region region) // NTSC case 'E': - if (region == Region::NTSC_J) - return Country::Korea; // GC games in English released in Korea - else + if (platform != Platform::GameCubeDisc) return Country::USA; // The most common country code for NTSC-U + if (revision) + { + if (*revision >= 0x30) + return Country::Korea; // GC games in English released in Korea + else + return Country::USA; // The most common country code for NTSC-U + } + else + { + if (region == Region::NTSC_J) + return Country::Korea; // GC games in English released in Korea + else + return Country::USA; // The most common country code for NTSC-U + } + case 'B': // PAL games released on NTSC-U VC case 'N': // NTSC-J games released on NTSC-U VC return Country::USA; |
