From 4d2fb9b9ba857239187f3cffaa0739abac818874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 27 May 2017 12:32:45 +0200 Subject: [PATCH] Core: Replace BOOT_MIOS with an explicit "is MIOS" flag I didn't know better back then, but the boot type is only supposed to be used for the actual boot params. It shouldn't be used or changed after booting. --- Source/Core/Core/ConfigManager.h | 2 +- Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp | 4 +--- Source/Core/Core/IOS/MIOS.cpp | 2 +- Source/Core/Core/State.cpp | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index 33e6009ec6..5102d400ba 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -129,6 +129,7 @@ struct SConfig : NonCopyable bool bOverrideGCLanguage = false; bool bWii = false; + bool m_is_mios = false; // Interface settings bool bConfirmStop = false; @@ -195,7 +196,6 @@ struct SConfig : NonCopyable BOOT_ELF, BOOT_DOL, BOOT_WII_NAND, - BOOT_MIOS, BOOT_BS2, BOOT_DFF }; diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp index a4c9c3ad1b..22544118c5 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp @@ -236,9 +236,7 @@ void CEXIIPL::SetCS(int _iCS) void CEXIIPL::UpdateRTC() { u32 epoch = - (SConfig::GetInstance().bWii || SConfig::GetInstance().m_BootType == SConfig::BOOT_MIOS) ? - WII_EPOCH : - GC_EPOCH; + (SConfig::GetInstance().bWii || SConfig::GetInstance().m_is_mios) ? WII_EPOCH : GC_EPOCH; u32 rtc = Common::swap32(GetEmulatedTime(epoch)); std::memcpy(m_RTC, &rtc, sizeof(u32)); } diff --git a/Source/Core/Core/IOS/MIOS.cpp b/Source/Core/Core/IOS/MIOS.cpp index ceb51f6f75..57f9451d43 100644 --- a/Source/Core/Core/IOS/MIOS.cpp +++ b/Source/Core/Core/IOS/MIOS.cpp @@ -168,7 +168,7 @@ bool Load() Memory::Write_U32(0x00000000, ADDRESS_INIT_SEMAPHORE); NOTICE_LOG(IOS, "IPL ready."); - SConfig::GetInstance().m_BootType = SConfig::BOOT_MIOS; + SConfig::GetInstance().m_is_mios = true; DVDInterface::UpdateRunningGameMetadata(); return true; } diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index a3fffacea6..01cbd1d2fe 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -156,8 +156,7 @@ static std::string DoState(PointerWrap& p) return version_created_by; } - bool is_wii = - SConfig::GetInstance().bWii || SConfig::GetInstance().m_BootType == SConfig::BOOT_MIOS; + bool is_wii = SConfig::GetInstance().bWii || SConfig::GetInstance().m_is_mios; const bool is_wii_currently = is_wii; p.Do(is_wii); if (is_wii != is_wii_currently)