X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdrom.c;h=10fc61562ee7d250a98e1d3a20a5654087b7b2ab;hb=4d311cb718868cf9d78238fcbc5643bc2551ae34;hp=0f1479e288c3403c184755a969462a6d828b3518;hpb=7e6d030e6da39c49b51cbdb2e9cf3feb0a2b9a56;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 0f1479e2..10fc6156 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -325,6 +325,7 @@ void cdrLidSeekInterrupt(void) if (stat.Status & STATUS_SHELLOPEN) { + memset(cdr.Prev, 0xff, sizeof(cdr.Prev)); cdr.DriveState = DRIVESTATE_LID_OPEN; CDRLID_INT(0x800); } @@ -597,8 +598,14 @@ static u32 cdrAlignTimingHack(u32 cycles) * active), but before the game's handler loop reads I_STAT. The time * window for this is quite small (~1k cycles of so). Apparently this * somehow happens naturally on the real hardware. + * + * Note: always enforcing this breaks other games like Crash PAL version + * (inputs get dropped because bios handler doesn't see interrupts). */ - u32 vint_rel = rcnts[3].cycleStart + 63000 - psxRegs.cycle; + u32 vint_rel; + if (psxRegs.cycle - rcnts[3].cycleStart > 250000) + return cycles; + vint_rel = rcnts[3].cycleStart + 63000 - psxRegs.cycle; vint_rel += PSXCLK / 60; while ((s32)(vint_rel - cycles) < 0) vint_rel += PSXCLK / 60; @@ -1154,7 +1161,8 @@ void cdrInterrupt(void) { cycles = (cdr.Mode & 0x80) ? cdReadTime : cdReadTime * 2; cycles += seekTime; - cycles = cdrAlignTimingHack(cycles); + if (Config.hacks.cdr_read_timing) + cycles = cdrAlignTimingHack(cycles); CDRPLAYREAD_INT(cycles, 1); SetPlaySeekRead(cdr.StatP, STATUS_SEEK);