diff --git a/Source/Core/Core/Src/BootManager.cpp b/Source/Core/Core/Src/BootManager.cpp index e0fac1da87..113a12f761 100644 --- a/Source/Core/Core/Src/BootManager.cpp +++ b/Source/Core/Core/Src/BootManager.cpp @@ -47,7 +47,6 @@ #include "VideoBackendBase.h" #include "Movie.h" - namespace BootManager { @@ -137,6 +136,11 @@ bool BootCore(const std::string& _rFilename) } } + if (game_ini.Exists("Core", "WiiProfile")) + game_ini.Get("Core", "WiiProfile", &StartUp.strWiiControllerProfile); + if (game_ini.Exists("Core", "GCProfile")) + game_ini.Get("Core", "GCProfile", &StartUp.strGCControllerProfile); + // Run the game // Init the core if (!Core::Init()) @@ -169,6 +173,8 @@ void Stop() StartUp.bDSPHLE = config_cache.bDSPHLE; StartUp.bDisableWiimoteSpeaker = config_cache.bDisableWiimoteSpeaker; StartUp.m_strVideoBackend = config_cache.strBackend; + StartUp.strGCControllerProfile = ""; + StartUp.strWiiControllerProfile = ""; VideoBackend::ActivateBackend(StartUp.m_strVideoBackend); } } diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index e67935906b..d5e7537354 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -138,7 +138,9 @@ struct SCoreStartupParameter int iTheme; int iPosX, iPosY, iWidth, iHeight; - + + std::string strGCControllerProfile; + std::string strWiiControllerProfile; enum EBootBS2 { BOOT_DEFAULT, diff --git a/Source/Core/Core/Src/HW/GCPad.cpp b/Source/Core/Core/Src/HW/GCPad.cpp index 68ba3ab88a..62090dfc4f 100644 --- a/Source/Core/Core/Src/HW/GCPad.cpp +++ b/Source/Core/Core/Src/HW/GCPad.cpp @@ -20,6 +20,7 @@ #include "ControllerInterface/ControllerInterface.h" #include "GCPadEmu.h" +#include "../ConfigManager.h" #include "../../InputCommon/Src/InputConfig.h" @@ -55,7 +56,7 @@ void Initialize(void* const hwnd) g_controller_interface.Initialize(); // load the saved controller config - g_plugin.LoadConfig(); + g_plugin.LoadConfig(SConfig::GetInstance().m_LocalCoreStartupParameter.strGCControllerProfile); } void GetStatus(u8 _numPAD, SPADStatus* _pPADStatus) diff --git a/Source/Core/Core/Src/HW/Wiimote.cpp b/Source/Core/Core/Src/HW/Wiimote.cpp index 0928deffb1..4b95677581 100644 --- a/Source/Core/Core/Src/HW/Wiimote.cpp +++ b/Source/Core/Core/Src/HW/Wiimote.cpp @@ -5,6 +5,7 @@ #include "WiimoteReal/WiimoteReal.h" #include "WiimoteEmu/WiimoteEmu.h" #include "Movie.h" +#include "../ConfigManager.h" #include "ControllerInterface/ControllerInterface.h" @@ -44,7 +45,7 @@ void Initialize(void* const hwnd) g_controller_interface.SetHwnd(hwnd); g_controller_interface.Initialize(); - g_plugin.LoadConfig(); + g_plugin.LoadConfig(SConfig::GetInstance().m_LocalCoreStartupParameter.strWiiControllerProfile); WiimoteReal::Initialize(); diff --git a/Source/Core/InputCommon/Src/InputConfig.cpp b/Source/Core/InputCommon/Src/InputConfig.cpp index b9d2a93b99..19be23ec74 100644 --- a/Source/Core/InputCommon/Src/InputConfig.cpp +++ b/Source/Core/InputCommon/Src/InputConfig.cpp @@ -26,10 +26,13 @@ InputPlugin::~InputPlugin() delete *i; } -bool InputPlugin::LoadConfig() +bool InputPlugin::LoadConfig(std::string ini) { IniFile inifile; - if (inifile.Load(File::GetUserPath(D_CONFIG_IDX) + ini_name + ".ini")) + std::string ini2 = ini; + if (ini == "") + ini = ini_name; + if (inifile.Load(File::GetUserPath(D_CONFIG_IDX) + ini + ".ini")) { std::vector< ControllerEmu* >::const_iterator i = controllers.begin(), @@ -37,7 +40,11 @@ bool InputPlugin::LoadConfig() for (; i!=e; ++i) { // load settings from ini - (*i)->LoadConfig(inifile.GetOrCreateSection((*i)->GetName().c_str())); + std::string section; + section = (*i)->GetName(); + if (ini2 != "") + section = "Profile"; + (*i)->LoadConfig(inifile.GetOrCreateSection(section.c_str())); // update refs (*i)->UpdateReferences(g_controller_interface); } diff --git a/Source/Core/InputCommon/Src/InputConfig.h b/Source/Core/InputCommon/Src/InputConfig.h index 4d25334ce7..bf12217304 100644 --- a/Source/Core/InputCommon/Src/InputConfig.h +++ b/Source/Core/InputCommon/Src/InputConfig.h @@ -42,7 +42,7 @@ public: ~InputPlugin(); - bool LoadConfig(); + bool LoadConfig(std::string ini); void SaveConfig(); std::vector< ControllerEmu* > controllers;