Merge pull request #4319 from leoetlino/sysconf

Don't read/store settings directly from/to SYSCONF (and fix config restore)
This commit is contained in:
shuffle2 2016-10-09 02:34:52 -07:00 committed by GitHub
commit c8cb1fa7d7
32 changed files with 191 additions and 129 deletions

View File

@ -9,6 +9,7 @@
#include "AudioCommon/OpenALStream.h"
#include "AudioCommon/aldlist.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/Thread.h"
#include "Core/ConfigManager.h"

View File

@ -7,6 +7,7 @@
#include "AudioCommon/WaveFile.h"
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Core/ConfigManager.h"
constexpr size_t WaveFileWriter::BUFFER_SIZE;

View File

@ -31,6 +31,7 @@
#include "Common/CommonTypes.h"
#include "Common/IniFile.h"
#include "Common/Logging/LogManager.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Core/ARDecrypt.h"

View File

@ -10,6 +10,7 @@
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/MathUtil.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Core/Boot/Boot.h"

View File

@ -26,7 +26,8 @@
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/SysConf.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Core/BootManager.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
@ -35,7 +36,6 @@
#include "Core/HW/Sram.h"
#include "Core/HW/WiimoteReal/WiimoteReal.h"
#include "Core/Host.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h"
#include "Core/Movie.h"
#include "Core/NetPlayProto.h"
#include "VideoCommon/VideoBackendBase.h"
@ -149,9 +149,6 @@ void ConfigCache::RestoreConfig(SConfig* config)
config->SelectedLanguage = iSelectedLanguage;
config->iCPUCore = iCPUCore;
config->m_SYSCONF->SetData("IPL.PGS", bProgressive);
config->m_SYSCONF->SetData("IPL.E60", bPAL60);
// Only change these back if they were actually set by game ini, since they can be changed while a
// game is running.
if (bSetVolume)
@ -279,9 +276,6 @@ bool BootCore(const std::string& _rFilename)
// Wii settings
if (StartUp.bWii)
{
// Flush possible changes to SYSCONF to file
SConfig::GetInstance().m_SYSCONF->Save();
int source;
for (unsigned int i = 0; i < MAX_WIIMOTES; ++i)
{
@ -370,19 +364,8 @@ bool BootCore(const std::string& _rFilename)
StartUp.bPAL60 = false;
}
SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", StartUp.bProgressive);
SConfig::GetInstance().m_SYSCONF->SetData("IPL.E60", StartUp.bPAL60);
if (StartUp.bWii)
{
// Disable WiiConnect24's standby mode. If it is enabled, it prevents us from receiving
// shutdown commands in the State Transition Manager (STM).
// TODO: remove this if and once Dolphin supports WC24 standby mode.
SConfig::GetInstance().m_SYSCONF->SetData<u8>("IPL.IDL", 0x00);
NOTICE_LOG(BOOT, "Disabling WC24 'standby' (shutdown to idle) to avoid hanging on shutdown");
RestoreBTInfoSection();
}
SConfig::GetInstance().SaveSettingsToSysconf();
// Run the game
// Init the core
@ -398,10 +381,14 @@ bool BootCore(const std::string& _rFilename)
void Stop()
{
Core::Stop();
RestoreConfig();
}
SConfig& StartUp = SConfig::GetInstance();
StartUp.m_strUniqueID = "00000000";
config_cache.RestoreConfig(&StartUp);
void RestoreConfig()
{
SConfig::GetInstance().LoadSettingsFromSysconf();
SConfig::GetInstance().m_strUniqueID = "00000000";
config_cache.RestoreConfig(&SConfig::GetInstance());
}
} // namespace

View File

@ -10,5 +10,9 @@ namespace BootManager
{
bool BootCore(const std::string& _rFilename);
// Stop the emulation core and restore the configuration.
void Stop();
// Synchronise Dolphin's configuration with the SYSCONF (which may have changed during emulation),
// and restore settings that were overriden by per-game INIs or for some other reason.
void RestoreConfig();
}

View File

@ -10,7 +10,10 @@
#include "Common/CommonPaths.h"
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Common/SysConf.h"
#include "Core/Boot/Boot.h"
#include "Core/Boot/Boot_DOL.h"
@ -18,6 +21,7 @@
#include "Core/Core.h" // for bWii
#include "Core/FifoPlayer/FifoDataFile.h"
#include "Core/HW/SI.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device_usb_bt_base.h"
#include "Core/PowerPC/PowerPC.h"
#include "DiscIO/Enums.h"
@ -25,6 +29,39 @@
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeCreator.h"
// Change from IPL.LNG value to IPL.SADR country code.
// http://wiibrew.org/wiki/Country_Codes
static u8 GetSADRCountryCode(DiscIO::Language language)
{
switch (language)
{
case DiscIO::Language::LANGUAGE_JAPANESE:
return 1; // Japan
case DiscIO::Language::LANGUAGE_ENGLISH:
return 49; // USA
case DiscIO::Language::LANGUAGE_GERMAN:
return 78; // Germany
case DiscIO::Language::LANGUAGE_FRENCH:
return 77; // France
case DiscIO::Language::LANGUAGE_SPANISH:
return 105; // Spain
case DiscIO::Language::LANGUAGE_ITALIAN:
return 83; // Italy
case DiscIO::Language::LANGUAGE_DUTCH:
return 94; // Netherlands
case DiscIO::Language::LANGUAGE_SIMPLIFIED_CHINESE:
case DiscIO::Language::LANGUAGE_TRADITIONAL_CHINESE:
return 157; // China
case DiscIO::Language::LANGUAGE_KOREAN:
return 136; // Korea
case DiscIO::Language::LANGUAGE_UNKNOWN:
break;
}
PanicAlert("Invalid language. Defaulting to Japanese.");
return 1;
}
SConfig* SConfig::m_Instance;
SConfig::SConfig()
@ -32,6 +69,7 @@ SConfig::SConfig()
LoadDefaults();
// Make sure we have log manager
LoadSettings();
LoadSettingsFromSysconf();
}
void SConfig::Init()
@ -48,7 +86,6 @@ void SConfig::Shutdown()
SConfig::~SConfig()
{
SaveSettings();
delete m_SYSCONF;
}
void SConfig::SaveSettings()
@ -56,7 +93,6 @@ void SConfig::SaveSettings()
NOTICE_LOG(BOOT, "Saving settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff
m_SYSCONF->Reload();
SaveGeneralSettings(ini);
SaveInterfaceSettings(ini);
@ -70,9 +106,9 @@ void SConfig::SaveSettings()
SaveAnalyticsSettings(ini);
SaveNetworkSettings(ini);
SaveBluetoothPassthroughSettings(ini);
SaveSysconfSettings(ini);
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
m_SYSCONF->Save();
}
namespace
@ -334,6 +370,47 @@ void SConfig::SaveBluetoothPassthroughSettings(IniFile& ini)
section->Set("LinkKeys", m_bt_passthrough_link_keys);
}
void SConfig::SaveSysconfSettings(IniFile& ini)
{
IniFile::Section* section = ini.GetOrCreateSection("Sysconf");
section->Set("SensorBarPosition", m_sensor_bar_position);
section->Set("SensorBarSensitivity", m_sensor_bar_sensitivity);
section->Set("SpeakerVolume", m_speaker_volume);
section->Set("WiimoteMotor", m_wiimote_motor);
section->Set("WiiLanguage", m_wii_language);
section->Set("AspectRatio", m_wii_aspect_ratio);
section->Set("Screensaver", m_wii_screensaver);
}
void SConfig::SaveSettingsToSysconf()
{
SysConf sysconf;
sysconf.SetData<u8>("IPL.SSV", m_wii_screensaver);
sysconf.SetData<u8>("IPL.LNG", m_wii_language);
u8 country_code = GetSADRCountryCode(static_cast<DiscIO::Language>(m_wii_language));
sysconf.SetArrayData("IPL.SADR", &country_code, 1);
sysconf.SetData<u8>("IPL.AR", m_wii_aspect_ratio);
sysconf.SetData<u8>("BT.BAR", m_sensor_bar_position);
sysconf.SetData<u32>("BT.SENS", m_sensor_bar_sensitivity);
sysconf.SetData<u8>("BT.SPKV", m_speaker_volume);
sysconf.SetData("BT.MOT", m_wiimote_motor);
sysconf.SetData("IPL.PGS", bProgressive);
sysconf.SetData("IPL.E60", bPAL60);
// Disable WiiConnect24's standby mode. If it is enabled, it prevents us from receiving
// shutdown commands in the State Transition Manager (STM).
// TODO: remove this if and once Dolphin supports WC24 standby mode.
sysconf.SetData<u8>("IPL.IDL", 0x00);
NOTICE_LOG(COMMON, "Disabling WC24 'standby' (shutdown to idle) to avoid hanging on shutdown");
RestoreBTInfoSection(&sysconf);
sysconf.Save();
}
void SConfig::LoadSettings()
{
INFO_LOG(BOOT, "Loading Settings from %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
@ -352,8 +429,7 @@ void SConfig::LoadSettings()
LoadNetworkSettings(ini);
LoadAnalyticsSettings(ini);
LoadBluetoothPassthroughSettings(ini);
m_SYSCONF = new SysConf();
LoadSysconfSettings(ini);
}
void SConfig::LoadGeneralSettings(IniFile& ini)
@ -626,6 +702,34 @@ void SConfig::LoadBluetoothPassthroughSettings(IniFile& ini)
section->Get("LinkKeys", &m_bt_passthrough_link_keys, "");
}
void SConfig::LoadSysconfSettings(IniFile& ini)
{
IniFile::Section* section = ini.GetOrCreateSection("Sysconf");
section->Get("SensorBarPosition", &m_sensor_bar_position, m_sensor_bar_position);
section->Get("SensorBarSensitivity", &m_sensor_bar_sensitivity, m_sensor_bar_sensitivity);
section->Get("SpeakerVolume", &m_speaker_volume, m_speaker_volume);
section->Get("WiimoteMotor", &m_wiimote_motor, m_wiimote_motor);
section->Get("WiiLanguage", &m_wii_language, m_wii_language);
section->Get("AspectRatio", &m_wii_aspect_ratio, m_wii_aspect_ratio);
section->Get("Screensaver", &m_wii_screensaver, m_wii_screensaver);
}
void SConfig::LoadSettingsFromSysconf()
{
SysConf sysconf;
m_wii_screensaver = sysconf.GetData<u8>("IPL.SSV");
m_wii_language = sysconf.GetData<u8>("IPL.LNG");
m_wii_aspect_ratio = sysconf.GetData<u8>("IPL.AR");
m_sensor_bar_position = sysconf.GetData<u8>("BT.BAR");
m_sensor_bar_sensitivity = sysconf.GetData<u32>("BT.SENS");
m_speaker_volume = sysconf.GetData<u8>("BT.SPKV");
m_wiimote_motor = sysconf.GetData<u8>("BT.MOT") != 0;
bProgressive = sysconf.GetData<u8>("IPL.PGS") != 0;
bPAL60 = sysconf.GetData<u8>("IPL.E60") != 0;
}
void SConfig::LoadDefaults()
{
bEnableDebugging = false;
@ -966,7 +1070,7 @@ DiscIO::Language SConfig::GetCurrentLanguage(bool wii) const
{
int language_value;
if (wii)
language_value = SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG");
language_value = SConfig::GetInstance().m_wii_language;
else
language_value = SConfig::GetInstance().SelectedLanguage + 1;
DiscIO::Language language = static_cast<DiscIO::Language>(language_value);

View File

@ -10,7 +10,6 @@
#include "Common/IniFile.h"
#include "Common/NonCopyable.h"
#include "Common/SysConf.h"
#include "Core/HW/EXI_Device.h"
#include "Core/HW/SI_Device.h"
@ -151,6 +150,15 @@ struct SConfig : NonCopyable
int m_bt_passthrough_vid = -1;
std::string m_bt_passthrough_link_keys;
// SYSCONF settings
int m_sensor_bar_position = 0x01;
int m_sensor_bar_sensitivity = 0x03;
int m_speaker_volume = 0x58;
bool m_wiimote_motor = true;
int m_wii_language = 0x01;
int m_wii_aspect_ratio = 0x01;
int m_wii_screensaver = 0x00;
// Fifo Player related settings
bool bLoopFifoReplay = true;
@ -305,14 +313,15 @@ struct SConfig : NonCopyable
bool m_SSLDumpRootCA;
bool m_SSLDumpPeerCert;
SysConf* m_SYSCONF;
// Save settings
void SaveSettings();
// Load settings
void LoadSettings();
void LoadSettingsFromSysconf();
void SaveSettingsToSysconf();
// Return the permanent and somewhat globally used instance of this struct
static SConfig& GetInstance() { return (*m_Instance); }
static void Init();
@ -334,6 +343,7 @@ private:
void SaveNetworkSettings(IniFile& ini);
void SaveAnalyticsSettings(IniFile& ini);
void SaveBluetoothPassthroughSettings(IniFile& ini);
void SaveSysconfSettings(IniFile& ini);
void LoadGeneralSettings(IniFile& ini);
void LoadInterfaceSettings(IniFile& ini);
@ -347,6 +357,7 @@ private:
void LoadNetworkSettings(IniFile& ini);
void LoadAnalyticsSettings(IniFile& ini);
void LoadBluetoothPassthroughSettings(IniFile& ini);
void LoadSysconfSettings(IniFile& ini);
static SConfig* m_Instance;
};

View File

@ -27,6 +27,7 @@
#include "Common/Timer.h"
#include "Core/Analytics.h"
#include "Core/BootManager.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
@ -248,8 +249,8 @@ bool Init()
if (g_aspect_wide)
{
IniFile gameIni = _CoreParameter.LoadGameIni();
gameIni.GetOrCreateSection("Wii")->Get(
"Widescreen", &g_aspect_wide, !!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR"));
gameIni.GetOrCreateSection("Wii")->Get("Widescreen", &g_aspect_wide,
!!SConfig::GetInstance().m_wii_aspect_ratio);
}
s_window_handle = Host_GetRenderHandle();
@ -661,9 +662,7 @@ void EmuThread()
// Clear on screen messages that haven't expired
OSD::ClearMessages();
// Reload sysconf file in order to see changes committed during emulation
if (core_parameter.bWii)
SConfig::GetInstance().m_SYSCONF->Reload();
BootManager::RestoreConfig();
INFO_LOG(CONSOLE, "Stop [Video Thread]\t\t---- Shutdown complete ----");
Movie::Shutdown();

View File

@ -7,6 +7,7 @@
#include "Core/FifoPlayer/FifoRecorder.h"
#include "Common/MsgHandler.h"
#include "Common/Thread.h"
#include "Core/ConfigManager.h"
#include "Core/FifoPlayer/FifoAnalyzer.h"

View File

@ -5,6 +5,7 @@
#include "Core/HW/Sram.h"
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
#include "Core/ConfigManager.h"
// english

View File

@ -304,7 +304,7 @@ Wiimote::Wiimote(const unsigned int index)
m_hotkeys->AddInput(_trans("Upright Hold"), false);
// TODO: This value should probably be re-read if SYSCONF gets changed
m_sensor_bar_on_top = SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.BAR") != 0;
m_sensor_bar_on_top = SConfig::GetInstance().m_sensor_bar_position != 0;
// --- reset eeprom/register/values to default ---
Reset();

View File

@ -11,6 +11,7 @@
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
#include "Common/SysConf.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/HW/Memmap.h"
@ -18,15 +19,14 @@
constexpr u16 BT_INFO_SECTION_LENGTH = 0x460;
void BackUpBTInfoSection()
void BackUpBTInfoSection(SysConf* sysconf)
{
const std::string filename = File::GetUserPath(D_SESSION_WIIROOT_IDX) + DIR_SEP WII_BTDINF_BACKUP;
if (File::Exists(filename))
return;
File::IOFile backup(filename, "wb");
std::vector<u8> section(BT_INFO_SECTION_LENGTH);
if (!SConfig::GetInstance().m_SYSCONF->GetArrayData("BT.DINF", section.data(),
static_cast<u16>(section.size())))
if (!sysconf->GetArrayData("BT.DINF", section.data(), static_cast<u16>(section.size())))
{
ERROR_LOG(WII_IPC_WIIMOTE, "Failed to read source BT.DINF section");
return;
@ -35,7 +35,7 @@ void BackUpBTInfoSection()
ERROR_LOG(WII_IPC_WIIMOTE, "Failed to back up BT.DINF section");
}
void RestoreBTInfoSection()
void RestoreBTInfoSection(SysConf* sysconf)
{
const std::string filename = File::GetUserPath(D_SESSION_WIIROOT_IDX) + DIR_SEP WII_BTDINF_BACKUP;
if (!File::Exists(filename))
@ -47,9 +47,7 @@ void RestoreBTInfoSection()
ERROR_LOG(WII_IPC_WIIMOTE, "Failed to read backed up BT.DINF section");
return;
}
SConfig::GetInstance().m_SYSCONF->SetArrayData("BT.DINF", section.data(),
static_cast<u16>(section.size()));
SConfig::GetInstance().m_SYSCONF->Save();
sysconf->SetArrayData("BT.DINF", section.data(), static_cast<u16>(section.size()));
File::Delete(filename);
}

View File

@ -7,8 +7,10 @@
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "Core/IPC_HLE/WII_IPC_HLE_Device.h"
void BackUpBTInfoSection();
void RestoreBTInfoSection();
class SysConf;
void BackUpBTInfoSection(SysConf* sysconf);
void RestoreBTInfoSection(SysConf* sysconf);
class CWII_IPC_HLE_Device_usb_oh1_57e_305_base : public IWII_IPC_HLE_Device
{

View File

@ -4,6 +4,7 @@
#include "Core/HW/WII_IPC.h"
#include "Common/CommonPaths.h"
#include "Common/SysConf.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
@ -33,27 +34,23 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::CWII_IPC_HLE_Device_usb_oh1_57e_305_emu
u32 _DeviceID, const std::string& _rDeviceName)
: CWII_IPC_HLE_Device_usb_oh1_57e_305_base(_DeviceID, _rDeviceName)
{
SysConf* sysconf;
std::unique_ptr<SysConf> owned_sysconf;
SysConf sysconf;
if (Core::g_want_determinism)
{
// See SysConf::UpdateLocation for comment about the Future.
owned_sysconf.reset(new SysConf());
sysconf = owned_sysconf.get();
sysconf->LoadFromFile(File::GetUserPath(D_SESSION_WIIROOT_IDX) +
DIR_SEP WII_SYSCONF_DIR DIR_SEP WII_SYSCONF);
sysconf.LoadFromFile(File::GetUserPath(D_SESSION_WIIROOT_IDX) +
DIR_SEP WII_SYSCONF_DIR DIR_SEP WII_SYSCONF);
}
else
{
sysconf = SConfig::GetInstance().m_SYSCONF;
BackUpBTInfoSection();
BackUpBTInfoSection(&sysconf);
}
// Activate only first Wiimote by default
_conf_pads BT_DINF;
SetUsbPointer(this);
if (!sysconf->GetArrayData("BT.DINF", (u8*)&BT_DINF, sizeof(_conf_pads)))
if (!sysconf.GetArrayData("BT.DINF", (u8*)&BT_DINF, sizeof(_conf_pads)))
{
PanicAlertT("Trying to read from invalid SYSCONF\nWiimote bt ids are not available");
}
@ -88,7 +85,7 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305_emu::CWII_IPC_HLE_Device_usb_oh1_57e_305_emu
BT_DINF.num_registered = MAX_BBMOTES;
// save now so that when games load sysconf file it includes the new Wiimotes
// and the correct order for connected Wiimotes
if (!sysconf->SetArrayData("BT.DINF", (u8*)&BT_DINF, sizeof(_conf_pads)) || !sysconf->Save())
if (!sysconf.SetArrayData("BT.DINF", (u8*)&BT_DINF, sizeof(_conf_pads)) || !sysconf.Save())
PanicAlertT("Failed to write BT.DINF to SYSCONF");
}

View File

@ -496,7 +496,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305_real::SaveLinkKeys()
if (!config_string.empty())
config_string.pop_back();
SConfig::GetInstance().m_bt_passthrough_link_keys = config_string;
SConfig::GetInstance().SaveSettings();
}
bool CWII_IPC_HLE_Device_usb_oh1_57e_305_real::OpenDevice(libusb_device* device)

View File

@ -1482,7 +1482,7 @@ void GetSettings()
s_bNetPlay = NetPlay::IsNetPlayRunning();
if (SConfig::GetInstance().bWii)
{
s_language = SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG");
s_language = SConfig::GetInstance().m_wii_language;
}
else
{

View File

@ -10,6 +10,8 @@
#include "Common/ENetUtil.h"
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
#include "Core/HW/EXI_DeviceIPL.h"

View File

@ -7,6 +7,7 @@
#include <string>
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
#include "Core/PowerPC/JitCommon/JitCache.h"

View File

@ -9,6 +9,7 @@
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
#include "Core/PowerPC/PPCAnalyst.h"

View File

@ -19,6 +19,7 @@
#include "Common/CommonPaths.h"
#include "Common/FileSearch.h"
#include "Common/FileUtil.h"
#include "Common/MsgHandler.h"
#include "Core/ConfigManager.h"
#include "Core/HotkeyManager.h"
#include "DolphinWX/Config/InterfaceConfigPane.h"

View File

@ -223,7 +223,6 @@ void PathConfigPane::OnNANDRootChanged(wxCommandEvent& event)
File::SetUserPath(D_WIIROOT_IDX, nand_path);
m_nand_root_dirpicker->SetPath(StrToWxStr(nand_path));
SConfig::GetInstance().m_SYSCONF->UpdateLocation();
DiscIO::CNANDContentManager::Access().ClearCache();
main_frame->UpdateWiiMenuChoice();

View File

@ -12,7 +12,6 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/IPC_HLE/WII_IPC_HLE.h"
#include "DiscIO/Enums.h"
#include "DolphinWX/Config/WiiConfigPane.h"
#include "DolphinWX/DolphinSlider.h"
#include "DolphinWX/WxUtils.h"
@ -154,18 +153,18 @@ void WiiConfigPane::InitializeGUI()
void WiiConfigPane::LoadGUIValues()
{
m_screensaver_checkbox->SetValue(!!SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.SSV"));
m_screensaver_checkbox->SetValue(!!SConfig::GetInstance().m_wii_screensaver);
m_pal60_mode_checkbox->SetValue(SConfig::GetInstance().bPAL60);
m_aspect_ratio_choice->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR"));
m_system_language_choice->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG"));
m_aspect_ratio_choice->SetSelection(SConfig::GetInstance().m_wii_aspect_ratio);
m_system_language_choice->SetSelection(SConfig::GetInstance().m_wii_language);
m_sd_card_checkbox->SetValue(SConfig::GetInstance().m_WiiSDCard);
m_connect_keyboard_checkbox->SetValue(SConfig::GetInstance().m_WiiKeyboard);
m_bt_sensor_bar_pos->SetSelection(SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.BAR"));
m_bt_sensor_bar_sens->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<u32>("BT.SENS"));
m_bt_speaker_volume->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.SPKV"));
m_bt_wiimote_motor->SetValue(SConfig::GetInstance().m_SYSCONF->GetData<bool>("BT.MOT"));
m_bt_sensor_bar_pos->SetSelection(SConfig::GetInstance().m_sensor_bar_position);
m_bt_sensor_bar_sens->SetValue(SConfig::GetInstance().m_sensor_bar_sensitivity);
m_bt_speaker_volume->SetValue(SConfig::GetInstance().m_speaker_volume);
m_bt_wiimote_motor->SetValue(SConfig::GetInstance().m_wiimote_motor);
}
void WiiConfigPane::RefreshGUI()
@ -186,13 +185,12 @@ void WiiConfigPane::RefreshGUI()
void WiiConfigPane::OnScreenSaverCheckBoxChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("IPL.SSV", m_screensaver_checkbox->IsChecked());
SConfig::GetInstance().m_wii_screensaver = m_screensaver_checkbox->IsChecked();
}
void WiiConfigPane::OnPAL60CheckBoxChanged(wxCommandEvent& event)
{
SConfig::GetInstance().bPAL60 = m_pal60_mode_checkbox->IsChecked();
SConfig::GetInstance().m_SYSCONF->SetData("IPL.E60", m_pal60_mode_checkbox->IsChecked());
}
void WiiConfigPane::OnSDCardCheckBoxChanged(wxCommandEvent& event)
@ -208,69 +206,30 @@ void WiiConfigPane::OnConnectKeyboardCheckBoxChanged(wxCommandEvent& event)
void WiiConfigPane::OnSystemLanguageChoiceChanged(wxCommandEvent& event)
{
DiscIO::Language wii_system_lang =
static_cast<DiscIO::Language>(m_system_language_choice->GetSelection());
SConfig::GetInstance().m_SYSCONF->SetData("IPL.LNG", wii_system_lang);
u8 country_code = GetSADRCountryCode(wii_system_lang);
if (!SConfig::GetInstance().m_SYSCONF->SetArrayData("IPL.SADR", &country_code, 1))
WxUtils::ShowErrorDialog(_("Failed to update country code in SYSCONF"));
SConfig::GetInstance().m_wii_language = m_system_language_choice->GetSelection();
}
void WiiConfigPane::OnAspectRatioChoiceChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("IPL.AR", m_aspect_ratio_choice->GetSelection());
SConfig::GetInstance().m_wii_aspect_ratio = m_aspect_ratio_choice->GetSelection();
}
void WiiConfigPane::OnSensorBarPosChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.BAR", event.GetInt());
SConfig::GetInstance().m_sensor_bar_position = event.GetInt();
}
void WiiConfigPane::OnSensorBarSensChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.SENS", event.GetInt());
SConfig::GetInstance().m_sensor_bar_sensitivity = event.GetInt();
}
void WiiConfigPane::OnSpeakerVolumeChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.SPKV", event.GetInt());
SConfig::GetInstance().m_speaker_volume = event.GetInt();
}
void WiiConfigPane::OnWiimoteMotorChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_SYSCONF->SetData("BT.MOT", event.GetInt());
}
// Change from IPL.LNG value to IPL.SADR country code.
// http://wiibrew.org/wiki/Country_Codes
u8 WiiConfigPane::GetSADRCountryCode(DiscIO::Language language)
{
switch (language)
{
case DiscIO::Language::LANGUAGE_JAPANESE:
return 1; // Japan
case DiscIO::Language::LANGUAGE_ENGLISH:
return 49; // USA
case DiscIO::Language::LANGUAGE_GERMAN:
return 78; // Germany
case DiscIO::Language::LANGUAGE_FRENCH:
return 77; // France
case DiscIO::Language::LANGUAGE_SPANISH:
return 105; // Spain
case DiscIO::Language::LANGUAGE_ITALIAN:
return 83; // Italy
case DiscIO::Language::LANGUAGE_DUTCH:
return 94; // Netherlands
case DiscIO::Language::LANGUAGE_SIMPLIFIED_CHINESE:
case DiscIO::Language::LANGUAGE_TRADITIONAL_CHINESE:
return 157; // China
case DiscIO::Language::LANGUAGE_KOREAN:
return 136; // Korea
case DiscIO::Language::LANGUAGE_UNKNOWN:
break;
}
PanicAlert("Invalid language. Defaulting to Japanese.");
return 1;
SConfig::GetInstance().m_wiimote_motor = event.IsChecked();
}

View File

@ -8,11 +8,6 @@
#include <wx/panel.h>
#include "Common/CommonTypes.h"
namespace DiscIO
{
enum class Language;
}
class DolphinSlider;
class wxCheckBox;
class wxChoice;
@ -40,8 +35,6 @@ private:
void OnSpeakerVolumeChanged(wxCommandEvent&);
void OnWiimoteMotorChanged(wxCommandEvent&);
static u8 GetSADRCountryCode(DiscIO::Language language);
wxArrayString m_system_language_strings;
wxArrayString m_aspect_ratio_strings;
wxArrayString m_bt_sensor_bar_pos_strings;

View File

@ -1180,7 +1180,7 @@ void CFrame::DoStop()
if (NetPlayDialog::GetNetPlayClient())
NetPlayDialog::GetNetPlayClient()->Stop();
BootManager::Stop();
Core::Stop();
UpdateGUI();
}
}

View File

@ -32,6 +32,7 @@
#include "Common/FifoQueue.h"
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/MsgHandler.h"
#include "Core/ConfigManager.h"
#include "Core/HW/EXI_Device.h"

View File

@ -886,10 +886,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title)
this);
progressive_scan_checkbox->SetValue(SConfig::GetInstance().bProgressive);
// A bit strange behavior, but this needs to stay in sync with the main progressive boolean;
// TODO: Is this still necessary?
SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", SConfig::GetInstance().bProgressive);
szr_misc->Add(progressive_scan_checkbox);
}

View File

@ -130,9 +130,7 @@ protected:
void Event_ProgressiveScan(wxCommandEvent& ev)
{
SConfig::GetInstance().m_SYSCONF->SetData("IPL.PGS", ev.GetInt());
SConfig::GetInstance().bProgressive = ev.IsChecked();
ev.Skip();
}

View File

@ -6,6 +6,7 @@
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/MsgHandler.h"
#include "Core/ConfigManager.h"
#include "Core/HW/Wiimote.h"
#include "InputCommon/ControllerEmu.h"

View File

@ -9,6 +9,7 @@
#include "Common/CommonPaths.h"
#include "Common/FileUtil.h"
#include "Common/Logging/LogManager.h"
#include "Common/MsgHandler.h"
#include "Core/ConfigManager.h"
#include "Core/HW/Wiimote.h"

View File

@ -10,6 +10,7 @@
#include <vector>
#include "Common/Common.h"
#include "Common/MsgHandler.h"
namespace DX11
{

View File

@ -8,6 +8,7 @@
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"