From 19f1a7d2de3a136810a84341db77d4f5eb8f3361 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 25 Jul 2024 02:34:23 +0300 Subject: [PATCH] cdrom: more hacks for more timing issues libretro/pcsx_rearmed#840 --- libpcsxcore/cdrom.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 4ef0a237..335c2dc5 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -835,9 +835,11 @@ void cdrInterrupt(void) { { for (i = 0; i < 3; i++) set_loc[i] = btoi(cdr.Param[i]); - cdr.RetryDetected = msfiEq(cdr.SetSector, set_loc) - && !cdr.SetlocPending; - //cdr.RetryDetected |= msfiEq(cdr.Param, cdr.Transfer); + if ((msfiEq(cdr.SetSector, set_loc)) //|| msfiEq(cdr.Param, cdr.Transfer)) + && !cdr.SetlocPending) + cdr.RetryDetected++; + else + cdr.RetryDetected = 0; memcpy(cdr.SetSector, set_loc, 3); cdr.SetSector[3] = 0; cdr.SetlocPending = 1; @@ -991,6 +993,7 @@ void cdrInterrupt(void) { Hokuto no Ken 2 InuYasha - Feudal Fairy Tale Dance Dance Revolution Konamix + Digimon Rumble Arena ... */ if (!(cdr.StatP & (STATUS_PLAY | STATUS_READ))) @@ -999,7 +1002,9 @@ void cdrInterrupt(void) { } else { - second_resp_time = 2 * 1097107; + second_resp_time = 2100011; + // a hack to try to avoid weird cmd vs irq1 races causing games to retry + second_resp_time += (cdr.RetryDetected & 15) * 100001; } SetPlaySeekRead(cdr.StatP, 0); DriveStateOld = cdr.DriveState; -- 2.39.5