From ffe25da78aed74784d419ede5b5254e71c6d458d Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Mon, 8 Jun 2015 20:25:48 +0200 Subject: [PATCH 1/2] Boot: Automatically temporarily set GameCube language to 0 when booting NTSC games. NTSC GameCubes have no Language setting, so the language byte in SRAM is always 0. Some NTSC games do react oddly and display unfinished translations and similar when the byte is set to a nonzero value that corresponds to a non-English language on a PAL GameCube. See issue 7731: https://code.google.com/p/dolphin-emu/issues/detail?id=7731. --- Source/Core/Core/BootManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index 85396fad4b..d645fb3c40 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -49,6 +49,7 @@ struct ConfigCache { bool valid, bCPUThread, bSkipIdle, bSyncGPUOnSkipIdleHack, bFPRF, bAccurateNaNs, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread, bSyncGPU, bFastDiscSpeed, bDSPHLE, bHLE_BS2, bProgressive; + int iSelectedLanguage; int iCPUCore, Volume; int iWiimoteSource[MAX_BBMOTES]; SIDevices Pads[MAX_SI_CHANNELS]; @@ -120,6 +121,7 @@ bool BootCore(const std::string& _rFilename) config_cache.framelimit = SConfig::GetInstance().m_Framelimit; config_cache.frameSkip = SConfig::GetInstance().m_FrameSkip; config_cache.bProgressive = StartUp.bProgressive; + config_cache.iSelectedLanguage = StartUp.SelectedLanguage; for (unsigned int i = 0; i < MAX_BBMOTES; ++i) { config_cache.iWiimoteSource[i] = g_wiimote_sources[i]; @@ -183,6 +185,12 @@ bool BootCore(const std::string& _rFilename) } } + // Some NTSC GameCube games such as Baten Kaitos react strangely to language settings that would be invalid on an NTSC system + if (StartUp.bNTSC) + { + StartUp.SelectedLanguage = 0; + } + // Wii settings if (StartUp.bWii) { @@ -288,6 +296,7 @@ void Stop() SConfig::GetInstance().sBackend = config_cache.sBackend; SConfig::GetInstance().m_DSPEnableJIT = config_cache.m_EnableJIT; StartUp.bProgressive = config_cache.bProgressive; + StartUp.SelectedLanguage = config_cache.iSelectedLanguage; SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", config_cache.bProgressive); // Only change these back if they were actually set by game ini, since they can be changed while a game is running. From 33f5aaf956b8caa3bed6c657e778b05defd99b15 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Mon, 8 Jun 2015 22:02:43 +0200 Subject: [PATCH 2/2] GameCube Config: Add option to override the NTSC auto language change. Some NTSC games have translations on the game disc that can be accessed via the system language byte. --- Source/Core/Core/BootManager.cpp | 2 +- Source/Core/Core/ConfigManager.cpp | 2 ++ Source/Core/Core/CoreParameter.cpp | 3 ++- Source/Core/Core/CoreParameter.h | 1 + .../Core/DolphinWX/Config/GameCubeConfigPane.cpp | 14 ++++++++++++++ Source/Core/DolphinWX/Config/GameCubeConfigPane.h | 2 ++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index d645fb3c40..236f66f05b 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -186,7 +186,7 @@ bool BootCore(const std::string& _rFilename) } // Some NTSC GameCube games such as Baten Kaitos react strangely to language settings that would be invalid on an NTSC system - if (StartUp.bNTSC) + if (!StartUp.bOverrideGCLanguage && StartUp.bNTSC) { StartUp.SelectedLanguage = 0; } diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 7d7323bd54..0cdc8a0207 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -191,6 +191,7 @@ void SConfig::SaveCoreSettings(IniFile& ini) core->Set("Apploader", m_LocalCoreStartupParameter.m_strApploader); core->Set("EnableCheats", m_LocalCoreStartupParameter.bEnableCheats); core->Set("SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage); + core->Set("OverrideGCLang", m_LocalCoreStartupParameter.bOverrideGCLanguage); core->Set("DPL2Decoder", m_LocalCoreStartupParameter.bDPL2Decoder); core->Set("Latency", m_LocalCoreStartupParameter.iLatency); core->Set("MemcardAPath", m_strMemoryCardA); @@ -437,6 +438,7 @@ void SConfig::LoadCoreSettings(IniFile& ini) core->Get("Apploader", &m_LocalCoreStartupParameter.m_strApploader); core->Get("EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false); core->Get("SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0); + core->Get("OverrideGCLang", &m_LocalCoreStartupParameter.bOverrideGCLanguage, false); core->Get("DPL2Decoder", &m_LocalCoreStartupParameter.bDPL2Decoder, false); core->Get("Latency", &m_LocalCoreStartupParameter.iLatency, 2); core->Get("MemcardAPath", &m_strMemoryCardA); diff --git a/Source/Core/Core/CoreParameter.cpp b/Source/Core/Core/CoreParameter.cpp index 7806683fc9..7259a18a7f 100644 --- a/Source/Core/Core/CoreParameter.cpp +++ b/Source/Core/Core/CoreParameter.cpp @@ -43,7 +43,7 @@ SCoreStartupParameter::SCoreStartupParameter() bMMU(false), bDCBZOFF(false), iBBDumpPort(0), bFastDiscSpeed(false), bSyncGPU(false), - SelectedLanguage(0), bWii(false), + SelectedLanguage(0), bOverrideGCLanguage(false), bWii(false), bConfirmStop(false), bHideCursor(false), bAutoHideCursor(false), bUsePanicHandlers(true), bOnScreenDisplayMessages(true), iRenderWindowXPos(-1), iRenderWindowYPos(-1), @@ -86,6 +86,7 @@ void SCoreStartupParameter::LoadDefaults() bFastDiscSpeed = false; bEnableMemcardSaving = true; SelectedLanguage = 0; + bOverrideGCLanguage = false; bWii = false; bDPL2Decoder = false; iLatency = 14; diff --git a/Source/Core/Core/CoreParameter.h b/Source/Core/Core/CoreParameter.h index 3cf744b987..867640bdfb 100644 --- a/Source/Core/Core/CoreParameter.h +++ b/Source/Core/Core/CoreParameter.h @@ -193,6 +193,7 @@ struct SCoreStartupParameter float fSyncGpuOverclock; int SelectedLanguage; + bool bOverrideGCLanguage; bool bWii; diff --git a/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp b/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp index 7909cf41ec..888bab7576 100644 --- a/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp @@ -55,6 +55,10 @@ void GameCubeConfigPane::InitializeGUI() m_system_lang_choice->SetToolTip(_("Sets the GameCube system language.")); m_system_lang_choice->Bind(wxEVT_CHOICE, &GameCubeConfigPane::OnSystemLanguageChange, this); + m_override_lang_checkbox = new wxCheckBox(this, wxID_ANY, _("Override Language on NTSC Games")); + m_override_lang_checkbox->SetToolTip(_("Lets the system language be set to values that games were not designed for. This can allow the use of extra translations for a few games, but can also lead to text display issues.")); + m_override_lang_checkbox->Bind(wxEVT_CHECKBOX, &GameCubeConfigPane::OnOverrideLanguageCheckBoxChanged, this); + m_skip_bios_checkbox = new wxCheckBox(this, wxID_ANY, _("Skip BIOS")); m_skip_bios_checkbox->Bind(wxEVT_CHECKBOX, &GameCubeConfigPane::OnSkipBiosCheckBoxChanged, this); @@ -96,6 +100,7 @@ void GameCubeConfigPane::InitializeGUI() sGamecubeIPLSettings->Add(new wxStaticText(this, wxID_ANY, _("System Language:")), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM, 5); sGamecubeIPLSettings->Add(m_system_lang_choice, wxGBPosition(1, 1), wxDefaultSpan, wxLEFT | wxRIGHT | wxBOTTOM, 5); + sGamecubeIPLSettings->Add(m_override_lang_checkbox, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL, 5); wxStaticBoxSizer* const sbGamecubeIPLSettings = new wxStaticBoxSizer(wxVERTICAL, this, _("IPL Settings")); sbGamecubeIPLSettings->Add(sGamecubeIPLSettings); @@ -128,6 +133,7 @@ void GameCubeConfigPane::LoadGUIValues() m_system_lang_choice->SetSelection(startup_params.SelectedLanguage); m_skip_bios_checkbox->SetValue(startup_params.bHLE_BS2); + m_override_lang_checkbox->SetValue(startup_params.bOverrideGCLanguage); wxArrayString slot_devices; slot_devices.Add(_(DEV_NONE_STR)); @@ -199,6 +205,7 @@ void GameCubeConfigPane::RefreshGUI() if (Core::IsRunning()) { m_system_lang_choice->Disable(); + m_override_lang_checkbox->Disable(); m_skip_bios_checkbox->Disable(); } } @@ -210,6 +217,13 @@ void GameCubeConfigPane::OnSystemLanguageChange(wxCommandEvent& event) AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_REFRESH_LIST)); } +void GameCubeConfigPane::OnOverrideLanguageCheckBoxChanged(wxCommandEvent& event) +{ + SConfig::GetInstance().m_LocalCoreStartupParameter.bOverrideGCLanguage = m_override_lang_checkbox->IsChecked(); + + AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_REFRESH_LIST)); +} + void GameCubeConfigPane::OnSkipBiosCheckBoxChanged(wxCommandEvent& event) { SConfig::GetInstance().m_LocalCoreStartupParameter.bHLE_BS2 = m_skip_bios_checkbox->IsChecked(); diff --git a/Source/Core/DolphinWX/Config/GameCubeConfigPane.h b/Source/Core/DolphinWX/Config/GameCubeConfigPane.h index 874dc6ad3c..f2d3284da7 100644 --- a/Source/Core/DolphinWX/Config/GameCubeConfigPane.h +++ b/Source/Core/DolphinWX/Config/GameCubeConfigPane.h @@ -23,6 +23,7 @@ private: void RefreshGUI(); void OnSystemLanguageChange(wxCommandEvent&); + void OnOverrideLanguageCheckBoxChanged(wxCommandEvent&); void OnSkipBiosCheckBoxChanged(wxCommandEvent&); void OnSlotAChanged(wxCommandEvent&); void OnSlotBChanged(wxCommandEvent&); @@ -36,6 +37,7 @@ private: wxArrayString m_ipl_language_strings; wxChoice* m_system_lang_choice; + wxCheckBox* m_override_lang_checkbox; wxCheckBox* m_skip_bios_checkbox; wxChoice* m_exi_devices[3]; wxButton* m_memcard_path[2];