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
1 changed files with 25 additions and 17 deletions

View File

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