Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Homebrew region inconsistency exposed by #2596. #2622

Merged
merged 2 commits into from
Jun 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Source/Core/Core/Boot/Boot_BS2Emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 8 additions & 4 deletions Source/Core/Core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,17 +717,21 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2)
else if (!strcasecmp(Extension.c_str(), ".elf"))
{
bWii = CBoot::IsElfWii(m_strFilename);
set_region_dir = USA_DIR;
// TODO: Right now GC homebrew boots in NTSC and Wii homebrew in PAL.
// This is intentional so that Wii homebrew can boot in both 50Hz and 60Hz, without forcing all GC homebrew to 50Hz.
// In the future, it probably makes sense to add a Region setting for homebrew somewhere in the emulator config.
bNTSC = bWii ? false : true;
set_region_dir = bNTSC ? USA_DIR : EUR_DIR;
m_BootType = BOOT_ELF;
bNTSC = true;
}
else if (!strcasecmp(Extension.c_str(), ".dol"))
{
CDolLoader dolfile(m_strFilename);
bWii = dolfile.IsWii();
set_region_dir = USA_DIR;
// TODO: See the ELF code above.
bNTSC = bWii ? false : true;
set_region_dir = bNTSC ? USA_DIR : EUR_DIR;
m_BootType = BOOT_DOL;
bNTSC = true;
}
else if (!strcasecmp(Extension.c_str(), ".dff"))
{
Expand Down