From 393709a45ae5591ab969a63914daa9feba70a2e4 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 30 Jun 2019 12:44:38 +0200 Subject: Also override the SYSCONF country setting Fixes https://bugs.dolphin-emu.org/issues/10066 --- Source/Core/DiscIO/Enums.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Source/Core/DiscIO/Enums.cpp') 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 revision) { -- cgit v1.2.3