Added a check for the IOS version before overriding the OSGetResetCode() function.

Fixes issue 6700.
This commit is contained in:
skidau
2013-10-05 12:41:59 +10:00
parent f6c0fb7bbe
commit b7d1c03c8a

View File

@ -169,7 +169,14 @@ u32 GetDolFileSize(std::string dol)
return (u32)pFileSystem->GetFileSize(dolFile.c_str()); return (u32)pFileSystem->GetFileSize(dolFile.c_str());
} }
u16 GetIOSVersion()
{
return Memory::Read_U16(0x00003140);
}
void OSGetResetCode() void OSGetResetCode()
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii && GetIOSVersion() >= 30)
{ {
u32 resetCode = Memory::Read_U32(0xCC003024); u32 resetCode = Memory::Read_U32(0xCC003024);
@ -184,15 +191,16 @@ void OSGetResetCode()
NPC = LR; NPC = LR;
} }
else
u16 GetIOSVersion()
{ {
return Memory::Read_U16(0x00003140); HLE::UnPatch("OSGetResetCode");
NPC = PC;
}
} }
void OSBootDol() void OSBootDol()
{ {
if (GetIOSVersion() >= 30) if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii && GetIOSVersion() >= 30)
{ {
if ((GPR(4) >> 28) == 0x8) if ((GPR(4) >> 28) == 0x8)
{ {