diff --git a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp index dd4d8e2f2f..d9d9b03021 100644 --- a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp +++ b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp @@ -19,6 +19,8 @@ #include "VolumeCreator.h" #include "CommonPaths.h" +#include + 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 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 diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 3bbd4296e8..a0de1ce9c6 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -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 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; - } } }