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,8 +169,15 @@ 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);
if ((resetCode & 0x1fffffff) != 0) if ((resetCode & 0x1fffffff) != 0)
@ -183,16 +190,17 @@ void OSGetResetCode()
} }
NPC = LR; NPC = LR;
} }
else
u16 GetIOSVersion() {
{ HLE::UnPatch("OSGetResetCode");
return Memory::Read_U16(0x00003140); 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)
{ {