From edcf6819e2e72e110b9726c85899847513e474df Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 22 Jan 2017 16:53:56 +0100 Subject: [PATCH] Don't load game INIs in Core::Init The game INIs are already loaded in BootManager::BootCore, which is executed right before. Let's put the g_aspect_wide code there instead. --- Source/Core/Core/BootManager.cpp | 9 ++++++--- Source/Core/Core/Core.cpp | 14 ++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index dd3708a0c6..a437ab1856 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -282,9 +282,15 @@ bool BootCore(const std::string& _rFilename) } } + Core::g_aspect_wide = StartUp.bWii; + // Wii settings if (StartUp.bWii) { + IniFile::Section* wii_section = game_ini.GetOrCreateSection("Wii"); + wii_section->Get("Widescreen", &Core::g_aspect_wide, !!StartUp.m_wii_aspect_ratio); + wii_section->Get("Language", &StartUp.m_wii_language, StartUp.m_wii_language); + int source; for (unsigned int i = 0; i < MAX_WIIMOTES; ++i) { @@ -305,9 +311,6 @@ bool BootCore(const std::string& _rFilename) g_wiimote_sources[WIIMOTE_BALANCE_BOARD] = source; WiimoteReal::ChangeWiimoteSource(WIIMOTE_BALANCE_BOARD, source); } - - IniFile::Section* wii_section = game_ini.GetOrCreateSection("Wii"); - wii_section->Get("Language", &StartUp.m_wii_language, StartUp.m_wii_language); } } diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index c32b0b6d33..18cda8c4f0 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -230,8 +230,6 @@ bool IsGPUThread() // BootManager.cpp bool Init() { - const SConfig& _CoreParameter = SConfig::GetInstance(); - if (s_emu_thread.joinable()) { if (IsRunning()) @@ -249,19 +247,11 @@ bool Init() Core::UpdateWantDeterminism(/*initial*/ true); - INFO_LOG(OSREPORT, "Starting core = %s mode", _CoreParameter.bWii ? "Wii" : "GameCube"); - INFO_LOG(OSREPORT, "CPU Thread separate = %s", _CoreParameter.bCPUThread ? "Yes" : "No"); + INFO_LOG(OSREPORT, "Starting core = %s mode", SConfig::GetInstance().bWii ? "Wii" : "GameCube"); + INFO_LOG(OSREPORT, "CPU Thread separate = %s", SConfig::GetInstance().bCPUThread ? "Yes" : "No"); Host_UpdateMainFrame(); // Disable any menus or buttons at boot - g_aspect_wide = _CoreParameter.bWii; - if (g_aspect_wide) - { - IniFile gameIni = _CoreParameter.LoadGameIni(); - gameIni.GetOrCreateSection("Wii")->Get("Widescreen", &g_aspect_wide, - !!SConfig::GetInstance().m_wii_aspect_ratio); - } - s_window_handle = Host_GetRenderHandle(); // Start the emu thread