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.
This commit is contained in:
Léo Lam 2017-05-27 12:32:45 +02:00
parent 096399d371
commit 4d2fb9b9ba
4 changed files with 4 additions and 7 deletions

View File

@ -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
};

View File

@ -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));
}

View File

@ -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;
}

View File

@ -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)