Fix inability to boot NAND contents caused by 04c41c1d38.

Might be nice to refactor this code to decrease duplication, but for now
just a fix.
This commit is contained in:
comex 2013-08-31 14:58:19 -04:00
parent 751c2e69f6
commit b187a38433
2 changed files with 24 additions and 7 deletions

View File

@ -19,6 +19,8 @@
#include "VolumeCreator.h"
#include "CommonPaths.h"
#include <memory>
static u32 state_checksum(u32 *buf, int len)
{
u32 checksum = 0;
@ -89,9 +91,17 @@ bool CBoot::Boot_WiiWAD(const char* _pFilename)
WII_IPC_HLE_Interface::SetDefaultContentFile(_pFilename);
CDolLoader DolLoader(pContent->m_pData, pContent->m_Size);
DolLoader.Load();
PC = DolLoader.GetEntryPoint() | 0x80000000;
std::unique_ptr<CDolLoader> pDolLoader;
if (pContent->m_pData)
{
pDolLoader.reset(new CDolLoader(pContent->m_pData, pContent->m_Size));
}
else
{
pDolLoader.reset(new CDolLoader(pContent->m_Filename.c_str()));
}
pDolLoader->Load();
PC = pDolLoader->GetEntryPoint() | 0x80000000;
// Pass the "#002 check"
// Apploader should write the IOS version and revision to 0x3140, and compare it

View File

@ -847,12 +847,19 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
if (pContent)
{
LoadWAD(Common::GetTitleContentPath(TitleID));
CDolLoader DolLoader(pContent->m_pData, pContent->m_Size);
DolLoader.Load(); // TODO: Check why sysmenu does not load the DOL correctly
PC = DolLoader.GetEntryPoint() | 0x80000000;
std::unique_ptr<CDolLoader> pDolLoader;
if (pContent->m_pData)
{
pDolLoader.reset(new CDolLoader(pContent->m_pData, pContent->m_Size));
}
else
{
pDolLoader.reset(new CDolLoader(pContent->m_Filename.c_str()));
}
pDolLoader->Load(); // TODO: Check why sysmenu does not load the DOL correctly
PC = pDolLoader->GetEntryPoint() | 0x80000000;
IOSv = ContentLoader.GetIosVersion();
bSuccess = true;
}
}
}