diff options
| author | Anthony <Helios747@users.noreply.github.com> | 2019-08-21 09:00:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-21 09:00:06 -0700 |
| commit | 5f38386575948457a650afec25b2a32c2cab9247 (patch) | |
| tree | 8915456807b0bdb914f2fbb402d8b465727fc491 /Source/Core/DiscIO/Enums.cpp | |
| parent | bf9427fafe6a69ba85f847a6615ed1f0d16dfdf0 (diff) | |
| parent | 393709a45ae5591ab969a63914daa9feba70a2e4 (diff) | |
Merge pull request #8222 from JosJuice/allow-mismatched-region-settings
Replace "Override Language on NTSC Games" with "Allow Mismatched Region Settings"
Diffstat (limited to 'Source/Core/DiscIO/Enums.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Enums.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/Enums.cpp b/Source/Core/DiscIO/Enums.cpp index f7069c0012..6847b4e44a 100644 --- a/Source/Core/DiscIO/Enums.cpp +++ b/Source/Core/DiscIO/Enums.cpp @@ -145,6 +145,29 @@ Country TypicalCountryForRegion(Region region) } } +Region SysConfCountryToRegion(u8 country_code) +{ + if (country_code == 0) + return Region::Unknown; + + if (country_code < 0x08) // Japan + return Region::NTSC_J; + + if (country_code < 0x40) // Americas + return Region::NTSC_U; + + if (country_code < 0x80) // Europe, Oceania, parts of Africa + return Region::PAL; + + if (country_code < 0xa8) // Southeast Asia + return country_code == 0x88 ? Region::NTSC_K : Region::NTSC_J; + + if (country_code < 0xc0) // Middle East + return Region::NTSC_U; + + return Region::Unknown; +} + Region CountryCodeToRegion(u8 country_code, Platform platform, Region expected_region, std::optional<u16> revision) { |
