X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdrom.c;h=18d6bf9eb352098c167510c4ffdd586f6796550a;hb=8c84ba5f4478dd4e7cc48e86f1b023bc6b99ea9c;hp=145ca32ebe051fb8c73ec4b7a084aa76ed9bc421;hpb=752c1c850b35ff0239abc4d55be091542f52bae4;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 145ca32e..18d6bf9e 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -597,8 +597,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 +1160,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); @@ -1284,8 +1291,6 @@ static void cdrReadInterrupt(void) u8 subqPos[3]; int read_ok; - SetPlaySeekRead(cdr.StatP, STATUS_READ | STATUS_ROTATING); - memcpy(subqPos, cdr.SetSectorPlay, sizeof(subqPos)); msfiAdd(subqPos, cdr.SubqForwardSectors); UpdateSubq(subqPos); @@ -1295,6 +1300,9 @@ static void cdrReadInterrupt(void) return; } + // note: CdlGetlocL should work as soon as STATUS_READ is indicated + SetPlaySeekRead(cdr.StatP, STATUS_READ | STATUS_ROTATING); + read_ok = ReadTrack(cdr.SetSectorPlay); if (read_ok) buf = CDR_getBuffer();