Skip to content

Commit

Permalink
Move LoadPatches calls
Browse files Browse the repository at this point in the history
LoadPatches was apparently never being called when booting
Wii discs. Maybe this will fix the recent regression with
cheat codes not getting loaded? I don't know how this
managed to work to begin with, though...

(The call was also moved for WADs, just for consistency.)
  • Loading branch information
JosJuice committed Mar 13, 2017
1 parent 8035270 commit 3278d60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Source/Core/Core/Boot/Boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "DiscIO/Enums.h"
#include "DiscIO/NANDContentLoader.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeCreator.h"

bool CBoot::DVDRead(u64 dvd_offset, u32 output_address, u32 length, bool decrypt)
{
Expand Down Expand Up @@ -289,11 +290,8 @@ bool CBoot::BootUp()
// If we can't load the bootrom file we HLE it instead
EmulatedBS2(_StartupPara.bWii);
}
else
{
// Load patches if they weren't already
PatchEngine::LoadPatches();
}

PatchEngine::LoadPatches();

// Scan for common HLE functions
if (_StartupPara.bHLE_BS2 && !_StartupPara.bEnableDebugging)
Expand Down Expand Up @@ -436,6 +434,8 @@ bool CBoot::BootUp()
case SConfig::BOOT_WII_NAND:
Boot_WiiWAD(_StartupPara.m_strFilename);

PatchEngine::LoadPatches();

if (LoadMapFromFilename())
HLE::PatchFunctions();

Expand Down
3 changes: 0 additions & 3 deletions Source/Core/Core/Boot/Boot_BS2Emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
// return
PC = PowerPC::ppcState.gpr[3];

// Load patches
PatchEngine::LoadPatches();

return true;
}

Expand Down
7 changes: 0 additions & 7 deletions Source/Core/Core/Boot/Boot_WiiWAD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include "Core/PatchEngine.h"

#include "DiscIO/NANDContentLoader.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeCreator.h"

struct StateFlags
{
Expand Down Expand Up @@ -93,10 +91,5 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename)
if (!IOS::HLE::BootstrapPPC(ContentLoader))
return false;

// Load patches and run startup patches
const std::unique_ptr<DiscIO::IVolume> pVolume(DiscIO::CreateVolumeFromFilename(_pFilename));
if (pVolume != nullptr)
PatchEngine::LoadPatches();

return true;
}

0 comments on commit 3278d60

Please sign in to comment.