summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2015-08-08 22:31:51 +0200
committerJosJuice <josjuice@gmail.com>2015-08-08 22:31:51 +0200
commit1d48a2f1798bf4b7e589c9e103e559d46eac2cb4 (patch)
treed6d234786b32e674d379aadb8e11258b1f99e559
parentcc79334faf14c8525d828eaafa99ed6432842de4 (diff)
Fix GC software crashing at boot if no disc is inserted
Same fix as 0b44d7c, plus a way to skip loading the apploader just like EmulatedBS2_Wii has been able to do for a long time.
-rw-r--r--Source/Core/Core/Boot/Boot_BS2Emu.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
index 9e79fac6cf..e565d0ab02 100644
--- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp
+++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp
@@ -56,7 +56,10 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
// Write necessary values
// Here we write values to memory that the apploader does not take care of. Game info goes
// to 0x80000000 according to YAGCD 4.2.
- DVDInterface::DVDRead(/*offset*/0x00000000, /*address*/0x00000000, 0x20, false); // write disc info
+
+ // It's possible to boot DOL and ELF files without a disc inserted
+ if (DVDInterface::VolumeIsValid())
+ DVDInterface::DVDRead(/*offset*/0x00000000, /*address*/0x00000000, 0x20, false); // write disc info
PowerPC::HostWrite_U32(0x0D15EA5E, 0x80000020); // Booted from bootrom. 0xE5207C22 = booted from jtag
PowerPC::HostWrite_U32(Memory::REALRAM_SIZE, 0x80000028); // Physical Memory Size (24MB on retail)
@@ -81,6 +84,9 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
HLE::Patch(0x81300000, "OSReport"); // HLE OSReport for Apploader
+ if (!DVDInterface::VolumeIsValid())
+ return false;
+
// Load Apploader to Memory - The apploader is hardcoded to begin at 0x2440 on the disc,
// but the size can differ between discs. Compare with YAGCD chap 13.
const DiscIO::IVolume& volume = DVDInterface::GetVolume();