mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 17:32:30 +00:00
Replace "Override Language on NTSC Games" with "Allow Mismatched Region Settings"
This new setting is like Override Language on NTSC Games, except instead of only applying to the GameCube language setting, it also applies to the Wii language setting. Fixes https://bugs.dolphin-emu.org/issues/11299
This commit is contained in:
parent
b88e5610ab
commit
561a4cfcce
18 changed files with 87 additions and 51 deletions
|
@ -211,7 +211,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
|
|||
core->Set("AccurateNaNs", bAccurateNaNs);
|
||||
core->Set("EnableCheats", bEnableCheats);
|
||||
core->Set("SelectedLanguage", SelectedLanguage);
|
||||
core->Set("OverrideGCLang", bOverrideGCLanguage);
|
||||
core->Set("OverrideRegionSettings", bOverrideRegionSettings);
|
||||
core->Set("DPL2Decoder", bDPL2Decoder);
|
||||
core->Set("AudioLatency", iLatency);
|
||||
core->Set("AudioStretch", m_audio_stretch);
|
||||
|
@ -486,7 +486,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
|
|||
core->Get("SyncOnSkipIdle", &bSyncGPUOnSkipIdleHack, true);
|
||||
core->Get("EnableCheats", &bEnableCheats, false);
|
||||
core->Get("SelectedLanguage", &SelectedLanguage, 0);
|
||||
core->Get("OverrideGCLang", &bOverrideGCLanguage, false);
|
||||
core->Get("OverrideRegionSettings", &bOverrideRegionSettings, false);
|
||||
core->Get("DPL2Decoder", &bDPL2Decoder, false);
|
||||
core->Get("AudioLatency", &iLatency, 20);
|
||||
core->Get("AudioStretch", &m_audio_stretch, false);
|
||||
|
@ -650,7 +650,7 @@ void SConfig::LoadJitDebugSettings(IniFile& ini)
|
|||
|
||||
void SConfig::ResetRunningGameMetadata()
|
||||
{
|
||||
SetRunningGameMetadata("00000000", "", 0, 0, DiscIO::Country::Unknown);
|
||||
SetRunningGameMetadata("00000000", "", 0, 0, DiscIO::Region::Unknown);
|
||||
}
|
||||
|
||||
void SConfig::SetRunningGameMetadata(const DiscIO::Volume& volume,
|
||||
|
@ -660,13 +660,13 @@ void SConfig::SetRunningGameMetadata(const DiscIO::Volume& volume,
|
|||
{
|
||||
SetRunningGameMetadata(volume.GetGameID(), volume.GetGameTDBID(),
|
||||
volume.GetTitleID().value_or(0), volume.GetRevision().value_or(0),
|
||||
volume.GetCountry());
|
||||
volume.GetRegion());
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRunningGameMetadata(volume.GetGameID(partition), volume.GetGameTDBID(),
|
||||
volume.GetTitleID(partition).value_or(0),
|
||||
volume.GetRevision(partition).value_or(0), volume.GetCountry());
|
||||
volume.GetRevision(partition).value_or(0), volume.GetRegion());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -682,15 +682,13 @@ void SConfig::SetRunningGameMetadata(const IOS::ES::TMDReader& tmd, DiscIO::Plat
|
|||
!DVDInterface::UpdateRunningGameMetadata(tmd_title_id))
|
||||
{
|
||||
// If not launching a disc game, just read everything from the TMD.
|
||||
const DiscIO::Country country = DiscIO::CountryCodeToCountry(
|
||||
static_cast<u8>(tmd_title_id), platform, tmd.GetRegion(), tmd.GetTitleVersion());
|
||||
SetRunningGameMetadata(tmd.GetGameID(), tmd.GetGameTDBID(), tmd_title_id, tmd.GetTitleVersion(),
|
||||
country);
|
||||
tmd.GetRegion());
|
||||
}
|
||||
}
|
||||
|
||||
void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::string& gametdb_id,
|
||||
u64 title_id, u16 revision, DiscIO::Country country)
|
||||
u64 title_id, u16 revision, DiscIO::Region region)
|
||||
{
|
||||
const bool was_changed = m_game_id != game_id || m_gametdb_id != gametdb_id ||
|
||||
m_title_id != title_id || m_revision != revision;
|
||||
|
@ -723,9 +721,7 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri
|
|||
}
|
||||
|
||||
const Core::TitleDatabase title_database;
|
||||
const DiscIO::Language language = !bWii && country == DiscIO::Country::Japan ?
|
||||
DiscIO::Language::Japanese :
|
||||
GetCurrentLanguage(bWii);
|
||||
const DiscIO::Language language = GetLanguageAdjustedForRegion(bWii, region);
|
||||
m_title_description = title_database.Describe(m_gametdb_id, language);
|
||||
NOTICE_LOG(CORE, "Active title: %s", m_title_description.c_str());
|
||||
Host_TitleChanged();
|
||||
|
@ -782,7 +778,7 @@ void SConfig::LoadDefaults()
|
|||
bFastDiscSpeed = false;
|
||||
bEnableMemcardSdWriting = true;
|
||||
SelectedLanguage = 0;
|
||||
bOverrideGCLanguage = false;
|
||||
bOverrideRegionSettings = false;
|
||||
bWii = false;
|
||||
bDPL2Decoder = false;
|
||||
iLatency = 20;
|
||||
|
@ -995,6 +991,40 @@ DiscIO::Language SConfig::GetCurrentLanguage(bool wii) const
|
|||
return language;
|
||||
}
|
||||
|
||||
DiscIO::Language SConfig::GetLanguageAdjustedForRegion(bool wii, DiscIO::Region region) const
|
||||
{
|
||||
const DiscIO::Language language = GetCurrentLanguage(wii);
|
||||
|
||||
if (!wii && region == DiscIO::Region::NTSC_K)
|
||||
region = DiscIO::Region::NTSC_J; // NTSC-K only exists on Wii, so use a fallback
|
||||
|
||||
if (!wii && region == DiscIO::Region::NTSC_J && language == DiscIO::Language::English)
|
||||
return DiscIO::Language::Japanese; // English and Japanese both use the value 0 in GC SRAM
|
||||
|
||||
if (!bOverrideRegionSettings)
|
||||
{
|
||||
if (region == DiscIO::Region::NTSC_J)
|
||||
return DiscIO::Language::Japanese;
|
||||
|
||||
if (region == DiscIO::Region::NTSC_U && language != DiscIO::Language::English &&
|
||||
(!wii || (language != DiscIO::Language::French && language != DiscIO::Language::Spanish)))
|
||||
{
|
||||
return DiscIO::Language::English;
|
||||
}
|
||||
|
||||
if (region == DiscIO::Region::PAL &&
|
||||
(language < DiscIO::Language::English || language > DiscIO::Language::Dutch))
|
||||
{
|
||||
return DiscIO::Language::English;
|
||||
}
|
||||
|
||||
if (region == DiscIO::Region::NTSC_K)
|
||||
return DiscIO::Language::Korean;
|
||||
}
|
||||
|
||||
return language;
|
||||
}
|
||||
|
||||
IniFile SConfig::LoadDefaultGameIni() const
|
||||
{
|
||||
return LoadDefaultGameIni(GetGameID(), m_revision);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue