X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fcdrom.c;h=3f4057954d3c5eb2830bcda0ffe405658f68896a;hb=b1eb84bc59c07b110e36714bf0222197f298ec09;hp=3d380785711353edf2a1bad6c3d45ac0c332dbf7;hpb=38e03f0aee6c94ff6c35a9597f45f88be5cae300;p=pcsx_rearmed.git diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 3d380785..3f405795 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -295,8 +295,8 @@ static void setIrq(int log_cmd) if (cdr.Stat) { int i; - SysPrintf("CDR IRQ=%d cmd %02x stat %02x: ", - !!(cdr.Stat & cdr.Reg2), log_cmd, cdr.Stat); + SysPrintf("%u cdrom: CDR IRQ=%d cmd %02x stat %02x: ", + psxRegs.cycle, !!(cdr.Stat & cdr.Reg2), log_cmd, cdr.Stat); for (i = 0; i < cdr.ResultC; i++) SysPrintf("%02x ", cdr.Result[i]); SysPrintf("\n"); @@ -545,7 +545,8 @@ static void cdrPlayInterrupt_Autopause() static int cdrSeekTime(unsigned char *target) { - int seekTime = abs(msf2sec(cdr.SetSectorPlay) - msf2sec(target)) * (cdReadTime / 200); + int diff = msf2sec(cdr.SetSectorPlay) - msf2sec(target); + int seekTime = abs(diff) * (cdReadTime / 200); /* * Gameblabla : * It was originally set to 1000000 for Driver, however it is not high enough for Worms Pinball @@ -650,7 +651,8 @@ void cdrInterrupt(void) { int i; if (cdr.Stat) { - CDR_LOG_I("cdrom: cmd %02x with irqstat %x\n", cdr.CmdInProgress, cdr.Stat); + CDR_LOG_I("%u cdrom: cmd %02x with irqstat %x\n", + psxRegs.cycle, cdr.CmdInProgress, cdr.Stat); return; } if (cdr.Irq1Pending) { @@ -1117,7 +1119,8 @@ void cdrInterrupt(void) { } else if (cdr.Cmd && cdr.Cmd != (Cmd & 0xff)) { cdr.CmdInProgress = cdr.Cmd; - CDR_LOG_I("cdrom: cmd %02x came before %02x finished\n", cdr.Cmd, Cmd); + CDR_LOG_I("%u cdrom: cmd %02x came before %02x finished\n", + psxRegs.cycle, cdr.Cmd, Cmd); } setIrq(Cmd); @@ -1343,7 +1346,7 @@ void cdrWrite1(unsigned char rt) { } #ifdef CDR_LOG_CMD_IRQ - SysPrintf("CD1 write: %x (%s)", rt, CmdName[rt]); + SysPrintf("%u cdrom: CD1 write: %x (%s)", psxRegs.cycle, rt, CmdName[rt]); if (cdr.ParamC) { int i; SysPrintf(" Param[%d] = {", cdr.ParamC); @@ -1364,8 +1367,8 @@ void cdrWrite1(unsigned char rt) { CDR_INT(5000); } else { - CDR_LOG_I("cdr: cmd while busy: %02x, prev %02x, busy %02x\n", - rt, cdr.Cmd, cdr.CmdInProgress); + CDR_LOG_I("%u cdrom: cmd while busy: %02x, prev %02x, busy %02x\n", + psxRegs.cycle, rt, cdr.Cmd, cdr.CmdInProgress); if (cdr.CmdInProgress < 0x100) // no pending 2nd response cdr.CmdInProgress = rt; } @@ -1427,11 +1430,13 @@ void cdrWrite3(unsigned char rt) { case 1: if (cdr.Stat & rt) { #ifdef CDR_LOG_CMD_IRQ - SysPrintf("ack %02x (w %02x)\n", cdr.Stat & rt, rt); + SysPrintf("%u cdrom: ack %02x (w %02x)\n", + psxRegs.cycle, cdr.Stat & rt, rt); #endif + // note: Croc vs Discworld Noir if (!(psxRegs.interrupt & (1 << PSXINT_CDR)) && (cdr.CmdInProgress || cdr.Irq1Pending)) - CDR_INT(2000); // 710+ + CDR_INT(850); // 711-993 } cdr.Stat &= ~rt;