From 34861074c114e4b2b76eb18274073ccfda467f29 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 8 Jun 2024 16:37:08 +1000 Subject: [PATCH] CDROM: Ensure complete IRQs for Init go through Fixes booting games with OpenBIOS and its Init spam. --- src/core/cdrom.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index abe8c2fc1..7575cbbd8 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -2241,9 +2241,21 @@ void CDROM::ExecuteCommandSecondResponse(void*, TickCount ticks, TickCount ticks DoIDRead(); break; + case Command::Init: + { + // OpenBIOS spams Init, so we need to ensure the completion actually gets through. + // If we have a pending command (which is probably init), cancel it. + if (HasPendingCommand()) + { + WARNING_LOG("Cancelling pending command 0x{:02X} ({}) due to init completion.", static_cast(s_command), + s_command_info[static_cast(s_command)].name); + EndCommand(); + } + } + [[fallthrough]]; + case Command::ReadTOC: case Command::Pause: - case Command::Init: case Command::MotorOn: case Command::Stop: DoStatSecondResponse();