From 20ca1ad823c3139656d9f067cec2d4ea0ce8f352 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 25 Nov 2023 22:37:28 +0200 Subject: [PATCH] cdrom: fail pausing on seek libretro/pcsx_rearmed#790 --- libpcsxcore/cdrom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 6d8e631e..3991bad9 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -715,6 +715,7 @@ void cdrInterrupt(void) { int read_ok; u16 not_ready = 0; u8 IrqStat = Acknowledge; + u8 DriveStateOld; u16 Cmd; int i; @@ -964,7 +965,16 @@ void cdrInterrupt(void) { second_resp_time = (((cdr.Mode & MODE_SPEED) ? 1 : 2) * 1097107); } SetPlaySeekRead(cdr.StatP, 0); + DriveStateOld = cdr.DriveState; cdr.DriveState = DRIVESTATE_PAUSED; + if (DriveStateOld == DRIVESTATE_SEEK) { + // According to Duckstation this fails, but the + // exact conditions and effects are not clear. + // Moto Racer World Tour seems to rely on this. + // For now assume pause works anyway, just errors out. + error = ERROR_NOTREADY; + goto set_error; + } break; case CdlPause + CMD_PART2: -- 2.39.5