From 8a20e961740222fc34d48b8e7a0c6fd7c6909350 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 22 Nov 2023 00:27:27 +0200 Subject: [PATCH] cdrom: always error out on shell open Duckstation claims it has been verified on console. libretro/pcsx_rearmed#804 --- libpcsxcore/cdrom.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index fac5fd39..6d8e631e 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -344,26 +344,22 @@ void cdrLidSeekInterrupt(void) // 02, 12, 10 if (!(cdr.StatP & STATUS_SHELLOPEN)) { + StopReading(); SetPlaySeekRead(cdr.StatP, 0); cdr.StatP |= STATUS_SHELLOPEN; // IIRC this sometimes doesn't happen on real hw // (when lots of commands are sent?) - if (cdr.Reading) { - StopReading(); - SetResultSize(2); - cdr.Result[0] = cdr.StatP | STATUS_SEEKERROR; - cdr.Result[1] = ERROR_SHELLOPEN; - setIrq(DiskError, 0x1006); - } + SetResultSize(2); + cdr.Result[0] = cdr.StatP | STATUS_SEEKERROR; + cdr.Result[1] = ERROR_SHELLOPEN; if (cdr.CmdInProgress) { psxRegs.interrupt &= ~(1 << PSXINT_CDR); cdr.CmdInProgress = 0; - SetResultSize(2); cdr.Result[0] = cdr.StatP | STATUS_ERROR; cdr.Result[1] = ERROR_NOTREADY; - setIrq(DiskError, 0x1007); } + setIrq(DiskError, 0x1006); set_event(PSXINT_CDRLID, cdReadTime * 30); break; -- 2.39.5