Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix inability to boot NAND contents caused by 04c41c1.
Might be nice to refactor this code to decrease duplication, but for now
just a fix.
  • Loading branch information
comex committed Aug 31, 2013
1 parent 751c2e6 commit b187a38
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
16 changes: 13 additions & 3 deletions Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp
Expand Up @@ -19,6 +19,8 @@
#include "VolumeCreator.h"
#include "CommonPaths.h"

#include <memory>

static u32 state_checksum(u32 *buf, int len)
{
u32 checksum = 0;
Expand Down Expand Up @@ -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
Expand Down
15 changes: 11 additions & 4 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
Expand Up @@ -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;

}
}
}
Expand Down

0 comments on commit b187a38

Please sign in to comment.