From e440b21640adfef98ad18c217748587dfe585ee3 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Mon, 28 Jun 2021 10:38:03 -0700 Subject: [PATCH] DVDInterface: Fix decrypting reads clearing the drive state This broke ejecting Wii discs while the game is running, as the drive state was set to Ready even when no disc was present, but other code still reported the missing disc, which confused games as you can't be both ready to read and have no disc. That would cause games to show an unrecoverable error screen, instead of a "please insert the game disc" screen. This only affected Wii games; the GameCube games used regular disc reads which worked fine. --- Source/Core/Core/HW/DVD/DVDInterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp index dd9a2c0ccf..3f239c32e1 100644 --- a/Source/Core/Core/HW/DVD/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp @@ -1251,7 +1251,9 @@ void PerformDecryptingRead(u32 position, u32 length, u32 output_address, const DiscIO::Partition& partition, ReplyType reply_type) { DIInterruptType interrupt_type = DIInterruptType::TCINT; - SetDriveState(DriveState::Ready); + + if (s_drive_state == DriveState::ReadyNoReadsMade) + SetDriveState(DriveState::Ready); const bool command_handled_by_thread = ExecuteReadCommand(static_cast(position) << 2, output_address, length, length, partition,