From 486de022dfe65344e5898c19534a8c5c4fc19bee Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 9 May 2017 22:10:40 +0200 Subject: [PATCH] Don't run EmulatedBS2_Wii with VolumeDirectory VolumeDirectory doesn't support necessities like TMDs, so thanks to 5.0-2172 (18968ab), EmulatedBS2_Wii crashes when the inserted disc is a VolumeDirectory. This commit fixes that. This commit makes our DOL booting code very similar to our ELF booting code. One exception is that the DOL booting code still always calls SetupBAT. (Note that EmulatedBS2_GC calls SetupBAT even if no disc is inserted.) I'm not sure if there's a point to the difference, but I thought I'd better avoid changing it so that I don't break anything. --- Source/Core/Core/Boot/Boot.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 79f08118bf..c69d50b75c 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -354,18 +354,24 @@ bool CBoot::BootUp() volume = SetDisc(DiscIO::CreateVolumeFromFilename(_StartupPara.m_strDefaultISO)); } - if (!EmulatedBS2(dolWii, volume)) + // Poor man's bootup + if (dolWii) { - if (dolWii) - HID4.SBE = 1; + HID4.SBE = 1; SetupBAT(dolWii); - if (dolWii) - SetupWiiMemory(volume, 0x000000010000003a); - - dolLoader.Load(); - PC = dolLoader.GetEntryPoint(); + // Because there is no TMD to get the requested system (IOS) version from, + // we default to IOS58, which is the version used by the Homebrew Channel. + SetupWiiMemory(volume, 0x000000010000003a); } + else + { + EmulatedBS2_GC(volume, true); + } + + Load_FST(dolWii, volume); + dolLoader.Load(); + PC = dolLoader.GetEntryPoint(); if (LoadMapFromFilename()) HLE::PatchFunctions();