From e3d555e0f3578b4e317f9739a715744cbe1a8395 Mon Sep 17 00:00:00 2001 From: gameblabla Date: Fri, 27 Aug 2021 22:05:02 +0000 Subject: [PATCH] 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). --- libpcsxcore/cdrom.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; -- 2.39.5