X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fcdrom.c;h=098b77d0b9691a910a135abcb628b94fb4453a1c;hp=10fc61562ee7d250a98e1d3a20a5654087b7b2ab;hb=399f666e98e02f2d451b0df140c57d1a308a1b86;hpb=ae36bb287237de0a199f52de86dbfc6115d4cb70 diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 10fc6156..098b77d0 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -1503,14 +1503,22 @@ void cdrWrite3(unsigned char rt) { break; // transfer case 1: if (cdr.Stat & rt) { + u32 nextCycle = psxRegs.intCycle[PSXINT_CDR].sCycle + + psxRegs.intCycle[PSXINT_CDR].cycle; #ifdef CDR_LOG_CMD_IRQ - SysPrintf("%u cdrom: ack %02x (w %02x)\n", - psxRegs.cycle, cdr.Stat & rt, rt); + SysPrintf("%u cdrom: ack %02x (w=%02x p=%d,%d)\n", + psxRegs.cycle, cdr.Stat & rt, rt, + !!(psxRegs.interrupt & (1 << PSXINT_CDR)), + nextCycle - psxRegs.cycle); #endif - // note: Croc vs Discworld Noir + // note: Croc, Shadow Tower (more) vs Discworld Noir (<993) if (!(psxRegs.interrupt & (1 << PSXINT_CDR)) && (cdr.CmdInProgress || cdr.Irq1Pending)) - CDR_INT(850); // 711-993 + { + s32 c = 2048 - (psxRegs.cycle - nextCycle); + c = MAX_VALUE(c, 512); + CDR_INT(c); + } } cdr.Stat &= ~rt;