From 61c8ce2711201344d633d3fad86f04027869f03a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 8 Aug 2015 22:31:51 +0200 Subject: [PATCH 1/3] 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. --- Source/Core/Core/Boot/Boot_BS2Emu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp index 3ab6ed6c58..6ee859c73a 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(); From a0b873445fb2e48e518b173af06187ffd1044940 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 10 Aug 2015 16:05:04 +0200 Subject: [PATCH 2/3] Set Speed Up Disc Transfer rate in the Sonic Riders INI 091db36 added a new delay for disc commands in an attempt to fix issues. It fixed Sonic Riders crashing after the third level... or so we thought. 091db36 also happened changed the order disc reads happen in so that the data is copied to memory before the emulated delay is finished. This was inaccurate and caused an audio problem in Resident Evil 3, leading to the old order being restored in 8cc6e5c. Now that the order is correct, Sonic Riders is broken again, despite 091db36's delay still existing. We're more or less back to square one - nobody knows what's broken, and nobody knows how to fix it. This commit restores SUDTR to Sonic Rider's game INI so that it'll work out of the box in 5.0 just like in 4.0. --- Data/Sys/GameSettings/GXE.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/Data/Sys/GameSettings/GXE.ini b/Data/Sys/GameSettings/GXE.ini index 84c522725b..cbbcdadc33 100644 --- a/Data/Sys/GameSettings/GXE.ini +++ b/Data/Sys/GameSettings/GXE.ini @@ -2,6 +2,7 @@ [Core] # Values set here will override the main Dolphin settings. +FastDiscSpeed = True [EmuState] # The Emulation State. 1 is worst, 5 is best, 0 is not set. From 6dce8b4debc6ac41ce11bc328e38c85ce54b3fff Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 10 Aug 2015 19:11:29 +0200 Subject: [PATCH 3/3] DiscScrubber: Add another nullptr check --- Source/Core/DiscIO/DiscScrubber.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp index db68027f8c..1546abf0b5 100644 --- a/Source/Core/DiscIO/DiscScrubber.cpp +++ b/Source/Core/DiscIO/DiscScrubber.cpp @@ -95,6 +95,9 @@ bool SetupScrub(const std::string& filename, int block_size) m_BlocksPerCluster = CLUSTER_SIZE / m_BlockSize; m_Disc = CreateVolumeFromFilename(filename); + if (!m_Disc) + return false; + m_FileSize = m_Disc->GetSize(); u32 numClusters = (u32)(m_FileSize / CLUSTER_SIZE);