Skip to content

Commit

Permalink
Added a check for the IOS version before overriding the OSGetResetCod…
Browse files Browse the repository at this point in the history
…e() function.

Fixes issue 6700.
  • Loading branch information
skidau committed Oct 5, 2013
1 parent f6c0fb7 commit b7d1c03
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions Source/Core/Core/Src/HLE/HLE_Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,30 +169,38 @@ u32 GetDolFileSize(std::string dol)
return (u32)pFileSystem->GetFileSize(dolFile.c_str());
}

void OSGetResetCode()
u16 GetIOSVersion()
{
u32 resetCode = Memory::Read_U32(0xCC003024);
return Memory::Read_U16(0x00003140);
}

if ((resetCode & 0x1fffffff) != 0)
void OSGetResetCode()
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii && GetIOSVersion() >= 30)
{
GPR(3) = resetCode | 0x80000000;
u32 resetCode = Memory::Read_U32(0xCC003024);

if ((resetCode & 0x1fffffff) != 0)
{
GPR(3) = resetCode | 0x80000000;
}
else
{
GPR(3) = 0;
}

NPC = LR;
}
else
{
GPR(3) = 0;
HLE::UnPatch("OSGetResetCode");
NPC = PC;
}

NPC = LR;
}

u16 GetIOSVersion()
{
return Memory::Read_U16(0x00003140);
}

void OSBootDol()
{
if (GetIOSVersion() >= 30)
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii && GetIOSVersion() >= 30)
{
if ((GPR(4) >> 28) == 0x8)
{
Expand Down

0 comments on commit b7d1c03

Please sign in to comment.