From a6e034904c2ae8b254b707a17df7de161efbfd6c Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 20 Sep 2023 22:49:40 +0300 Subject: [PATCH] cdrom: some report mode details trusting mednafen on this one libretro/pcsx_rearmed#762 --- libpcsxcore/cdrom.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 6f48df05..0ae2c50b 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -65,7 +65,8 @@ static struct { unsigned char Absolute[3]; } subq; unsigned char TrackChanged; - unsigned char unused3[3]; + unsigned char ReportDelay; + unsigned char unused3[2]; unsigned int freeze_ver; unsigned char Prev[4]; @@ -524,7 +525,9 @@ static void cdrPlayInterrupt_Autopause() StopCdda(); SetPlaySeekRead(cdr.StatP, 0); } - else if (((cdr.Mode & MODE_REPORT) || cdr.FastForward || cdr.FastBackward)) { + else if ((cdr.Mode & MODE_REPORT) && !cdr.ReportDelay && + ((cdr.subq.Absolute[2] & 0x0f) == 0 || cdr.FastForward || cdr.FastBackward)) + { cdr.Result[0] = cdr.StatP; cdr.Result[1] = cdr.subq.Track; cdr.Result[2] = cdr.subq.Index; @@ -560,6 +563,9 @@ static void cdrPlayInterrupt_Autopause() SetResultSize(8); setIrq(0x1001); } + + if (cdr.ReportDelay) + cdr.ReportDelay--; } // LastReadCycles @@ -817,6 +823,7 @@ void cdrInterrupt(void) { cdr.SubqForwardSectors = 1; cdr.TrackChanged = FALSE; cdr.FirstSector = 1; + cdr.ReportDelay = 60; if (!Config.Cdda) CDR_play(cdr.SetSectorPlay); -- 2.39.5