DiscIO: Add GetRegion function and Region enum

Instead of needing different switch cases for
converting countries to regions in multiple places,
we now only need a single country-to-region switch case
(in DiscIO/Enums.cpp), and we get a nice Region type.
This commit is contained in:
JosJuice
2016-12-23 18:41:21 +01:00
parent 6aef0630f7
commit 66ea9f5cc1
26 changed files with 218 additions and 158 deletions

View File

@ -38,6 +38,16 @@ enum class Country
NUMBER_OF_COUNTRIES
};
// Regions 0 - 2 and 4 match Nintendo's Wii region numbering.
enum class Region
{
NTSC_J = 0, // Japan and Taiwan
NTSC_U = 1, // Mainly North America
PAL = 2, // Mainly Europe and Oceania
UNKNOWN_REGION = 3, // 3 seems to be unused? Anyway, we need an UNKNOWN_REGION. Let's put it here
NTSC_K = 4 // South Korea (Wii only)
};
// Languages 0 - 9 match Nintendo's Wii language numbering.
// Languages 1 - 6 match Nintendo's PAL GameCube languages 0 - 5.
// NTSC GameCubes only support one language and thus don't number languages.
@ -56,6 +66,8 @@ enum class Language
LANGUAGE_UNKNOWN
};
Region RegionSwitchGC(u8 country_code);
Region RegionSwitchWii(u8 country_code);
Country CountrySwitch(u8 country_code);
u8 GetSysMenuRegion(u16 title_version);
std::string GetCompanyFromID(const std::string& company_id);