Boot: Decide setting.txt's country settings based on the game's video mode when no valid country code is found rather than defaulting to Europe.

This commit is contained in:
Admiral H. Curtiss 2015-06-17 23:52:41 +02:00
parent 1b8b99e9f1
commit 7276d80adc
1 changed files with 8 additions and 5 deletions

View File

@ -166,21 +166,24 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
bool CBoot::SetupWiiMemory(DiscIO::IVolume::ECountry country)
{
static const CountrySetting SETTING_EUROPE = {"EUR", "PAL", "EU", "LE"};
static const CountrySetting SETTING_USA = {"USA", "NTSC", "US", "LU"};
static const CountrySetting SETTING_JAPAN = {"JPN", "NTSC", "JP", "LJ"};
static const CountrySetting SETTING_KOREA = {"KOR", "NTSC", "KR", "LKH"};
static const std::map<DiscIO::IVolume::ECountry, const CountrySetting> country_settings = {
{DiscIO::IVolume::COUNTRY_EUROPE, SETTING_EUROPE},
{DiscIO::IVolume::COUNTRY_USA, {"USA", "NTSC", "US", "LU"}},
{DiscIO::IVolume::COUNTRY_JAPAN, {"JPN", "NTSC", "JP", "LJ"}},
{DiscIO::IVolume::COUNTRY_KOREA, {"KOR", "NTSC", "KR", "LKH"}},
{DiscIO::IVolume::COUNTRY_USA, SETTING_USA},
{DiscIO::IVolume::COUNTRY_JAPAN, SETTING_JAPAN},
{DiscIO::IVolume::COUNTRY_KOREA, SETTING_KOREA},
//TODO: Determine if Taiwan have their own specific settings.
// Also determine if there are other specific settings
// for other countries.
{DiscIO::IVolume::COUNTRY_TAIWAN, {"JPN", "NTSC", "JP", "LJ"}}
{DiscIO::IVolume::COUNTRY_TAIWAN, SETTING_JAPAN}
};
auto entryPos = country_settings.find(country);
const CountrySetting& country_setting =
(entryPos != country_settings.end()) ?
entryPos->second :
SETTING_EUROPE; //Default to EUROPE
(SConfig::GetInstance().bNTSC ? SETTING_USA : SETTING_EUROPE); // default to USA or EUR depending on game's video mode
SettingsHandler gen;
std::string serno;