1 // Copyright 2016 Dolphin Emulator Project 2 // Licensed under GPLv2+ 3 // Refer to the license.txt file included. 4 5 #pragma once 6 7 #include <optional> 8 #include <string> 9 10 #include "Common/CommonTypes.h" 11 12 namespace DiscIO 13 { 14 // Increment CACHE_REVISION (GameFileCache.cpp) if these enums are modified 15 16 enum class Platform 17 { 18 GameCubeDisc = 0, 19 WiiDisc, 20 WiiWAD, 21 ELFOrDOL, 22 NumberOfPlatforms 23 }; 24 25 enum class Country 26 { 27 Europe = 0, 28 Japan, 29 USA, 30 Australia, 31 France, 32 Germany, 33 Italy, 34 Korea, 35 Netherlands, 36 Russia, 37 Spain, 38 Taiwan, 39 World, 40 Unknown, 41 NumberOfCountries 42 }; 43 44 // This numbering matches Nintendo's GameCube/Wii region numbering. 45 enum class Region 46 { 47 NTSC_J = 0, // Japan and Taiwan (and South Korea for GameCube only) 48 NTSC_U = 1, // Mainly North America 49 PAL = 2, // Mainly Europe and Oceania 50 Unknown = 3, // Nintendo uses this to mean region free, but we also use it for unknown regions 51 NTSC_K = 4 // South Korea (Wii only) 52 }; 53 54 // Languages 0 - 9 match Nintendo's Wii language numbering. 55 // Languages 1 - 6 match Nintendo's PAL GameCube languages 0 - 5. 56 // NTSC GameCubes only support one language and thus don't number languages. 57 enum class Language 58 { 59 Japanese = 0, 60 English = 1, 61 German = 2, 62 French = 3, 63 Spanish = 4, 64 Italian = 5, 65 Dutch = 6, 66 SimplifiedChinese = 7, // Not selectable on any unmodded retail Wii 67 TraditionalChinese = 8, // Not selectable on any unmodded retail Wii 68 Korean = 9, 69 Unknown 70 }; 71 72 std::string GetName(Country country, bool translate); 73 std::string GetName(Language language, bool translate); 74 75 bool IsDisc(Platform volume_type); 76 bool IsWii(Platform volume_type); 77 bool IsNTSC(Region region); 78 79 Country TypicalCountryForRegion(Region region); 80 Region SysConfCountryToRegion(u8 country_code); 81 // Avoid using this function if you can. Country codes aren't always reliable region indicators. 82 Region CountryCodeToRegion(u8 country_code, Platform platform, 83 Region expected_region = Region::Unknown, 84 std::optional<u16> revision = {}); 85 Country CountryCodeToCountry(u8 country_code, Platform platform, Region region = Region::Unknown, 86 std::optional<u16> revision = {}); 87 88 Region GetSysMenuRegion(u16 title_version); 89 std::string GetSysMenuVersionString(u16 title_version); 90 91 const std::string& GetCompanyFromID(const std::string& company_id); 92 } // namespace DiscIO 93