From 8399ca3389019fa65da8eb27816aef125d567d06 Mon Sep 17 00:00:00 2001 From: gameblabla Date: Wed, 25 Aug 2021 22:35:07 +0200 Subject: [PATCH] CDROM: Rename Reset+Init commands, fix "This is Football 2" lockup Upon the reset command being issued, we need to set the Mode to 0x20 (as it was confirmed in Mednafen) and also disable the muting. We also change the seektime for the reset command appropriately. Please see Mednafen's implementation as reference : https://github.com/libretro-mirrors/mednafen-git/blob/1899500078169e787f86eb5302a3f35abdaa8764/src/psx/cdc.cpp#L2007 This fixes the black screen issue in "This is Football 2". This also fixes the black screen issue in Pooh's Party after you selected a character. --- libpcsxcore/cdrom.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 00a10e12..2cafe196 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -58,7 +58,7 @@ static unsigned char *pTransfer; #define CdlStandby 7 #define CdlStop 8 #define CdlPause 9 -#define CdlInit 10 +#define CdlReset 10 #define CdlMute 11 #define CdlDemute 12 #define CdlSetfilter 13 @@ -76,19 +76,19 @@ static unsigned char *pTransfer; #define CdlTest 25 #define CdlID 26 #define CdlReadS 27 -#define CdlReset 28 +#define CdlInit 28 #define CdlGetQ 29 #define CdlReadToc 30 char *CmdName[0x100]= { "CdlSync", "CdlNop", "CdlSetloc", "CdlPlay", "CdlForward", "CdlBackward", "CdlReadN", "CdlStandby", - "CdlStop", "CdlPause", "CdlInit", "CdlMute", + "CdlStop", "CdlPause", "CdlReset", "CdlMute", "CdlDemute", "CdlSetfilter", "CdlSetmode", "CdlGetmode", "CdlGetlocL", "CdlGetlocP", "CdlReadT", "CdlGetTN", "CdlGetTD", "CdlSeekL", "CdlSeekP", "CdlSetclock", "CdlGetclock", "CdlTest", "CdlID", "CdlReadS", - "CdlReset", NULL, "CDlReadToc", NULL + "CdlInit", NULL, "CDlReadToc", NULL }; unsigned char Test04[] = { 0 }; @@ -736,13 +736,15 @@ void cdrInterrupt() { cdr.Stat = Complete; break; - case CdlInit: - AddIrqQueue(CdlInit + 0x100, cdReadTime * 6); + case CdlReset: + cdr.Muted = FALSE; + cdr.Mode = 0x20; /* Needed for This is Football 2, Pooh's Party and possibly others. */ + AddIrqQueue(CdlReset + 0x100, 4100000); no_busy_error = 1; start_rotating = 1; break; - case CdlInit + 0x100: + case CdlReset + 0x100: cdr.Stat = Complete; break; @@ -893,7 +895,7 @@ void cdrInterrupt() { cdr.Stat = Complete; break; - case CdlReset: + case CdlInit: // yes, it really sets STATUS_SHELLOPEN cdr.StatP |= STATUS_SHELLOPEN; cdr.DriveState = DRIVESTATE_RESCAN_CD; @@ -1278,8 +1280,8 @@ void cdrWrite1(unsigned char rt) { StopReading(); break; - case CdlReset: case CdlInit: + case CdlReset: cdr.Seeked = SEEK_DONE; StopCdda(); StopReading(); -- 2.39.5