From: gameblabla Date: Fri, 27 Aug 2021 22:05:02 +0000 (+0000) Subject: Improve CdlPause command based on Mednafen's implementation (#207) X-Git-Tag: r23~124 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3d555e0f3578b4e317f9739a715744cbe1a8395;p=pcsx_rearmed.git Improve CdlPause command based on Mednafen's implementation (#207) Reference : https://github.com/libretro-mirrors/mednafen-git/blob/master/src/psx/cdc.cpp#L1969 This fixed an issue with Worms Pinball booting to the language screen. Previously, it would sometimes boot to it but not reliably and the screen would always not appear or be black. Now, the emulator doesn't crash anymore and the language screen can be seen (although it is a glitchy mess). --- diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 95e739f9..2d9d77f0 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -722,7 +722,17 @@ void cdrInterrupt() { InuYasha - Feudal Fairy Tale: slower - Fixes battles */ - AddIrqQueue(CdlPause + 0x100, cdReadTime * 3); + /* Gameblabla - Tightening the timings (as taken from Mednafen). */ + if (cdr.DriveState != DRIVESTATE_STANDBY) + { + delay = 5000; + } + else + { + delay = (1124584 + (msf2sec(cdr.SetSectorPlay) * 42596 / (75 * 60))) * ((cdr.Mode & MODE_SPEED) ? 1 : 2); + CDRMISC_INT((cdr.Mode & MODE_SPEED) ? cdReadTime / 2 : cdReadTime); + } + AddIrqQueue(CdlPause + 0x100, delay); cdr.Ctrl |= 0x80; break;