diff options
author | ifcaro | 2020-07-04 15:26:16 +0200 |
---|---|---|
committer | GitHub | 2020-07-04 16:26:16 +0300 |
commit | fbf19ce6b6c02da47a67f58e23d8294cfcd18f55 (patch) | |
tree | e8c3798b6aedc00a1c5675563a040f36042fd972 | |
parent | b085fc5ae83c7e0f91cb3a8dc00bd14d2b8f9c1c (diff) | |
download | pcsx_rearmed-fbf19ce6b6c02da47a67f58e23d8294cfcd18f55.tar.gz pcsx_rearmed-fbf19ce6b6c02da47a67f58e23d8294cfcd18f55.tar.bz2 pcsx_rearmed-fbf19ce6b6c02da47a67f58e23d8294cfcd18f55.zip |
Fix crash on retrying mission in driver (#165)
Fix crash on retrying mission in driver
-rw-r--r-- | libpcsxcore/cdrom.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 3e31c0a..a725efa 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -539,6 +539,7 @@ void cdrInterrupt() { int start_rotating = 0; int error = 0; int delay; + unsigned int seekTime = 0; // Reschedule IRQ if (cdr.Stat) { @@ -909,6 +910,8 @@ void cdrInterrupt() { case CdlReadN: case CdlReadS: if (cdr.SetlocPending) { + seekTime = abs(msf2sec(cdr.SetSectorPlay) - msf2sec(cdr.SetSector)) * (cdReadTime / 200); + if(seekTime > 1000000) seekTime = 1000000; memcpy(cdr.SetSectorPlay, cdr.SetSector, 4); cdr.SetlocPending = 0; } @@ -948,7 +951,7 @@ void cdrInterrupt() { // - fix cutscene speech (startup) // ??? - use more accurate seek time later - CDREAD_INT((cdr.Mode & 0x80) ? (cdReadTime / 2) : cdReadTime * 1); + CDREAD_INT(((cdr.Mode & 0x80) ? (cdReadTime / 2) : cdReadTime * 1) + seekTime); } else { cdr.StatP |= STATUS_READ; cdr.StatP &= ~STATUS_SEEK; |