From d56098566d23af3435e6754d3009ba81fd5cd374 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 23 Feb 2025 00:59:16 +0200 Subject: [PATCH] cdrom: try emulating fifo status bit is this good enough? notaz/pcsx_rearmed#354 --- libpcsxcore/cdrom.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 3fc5801c..e9c6f884 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -1455,21 +1455,19 @@ static void cdrReadInterrupt(void) cdrRead0: bit 0,1 - reg index bit 2 - adpcm active - bit 5 - 1 result ready - bit 6 - 1 dma ready + bit 3 - 1 parameter fifo empty + bit 4 - 1 parameter fifo not full + bit 5 - 1 response fifo not empty + bit 6 - 1 data fifo not empty bit 7 - 1 command being processed */ unsigned char cdrRead0(void) { - cdr.Ctrl &= ~0x24; + cdr.Ctrl &= ~0x64; cdr.Ctrl |= cdr.AdpcmActive << 2; cdr.Ctrl |= cdr.ResultReady << 5; + cdr.Ctrl |= ((signed int)(cdr.FifoOffset - cdr.FifoSize) >> 31) & 0x40; - //cdr.Ctrl &= ~0x40; - //if (cdr.FifoOffset != DATA_SIZE) - cdr.Ctrl |= 0x40; // data fifo not empty - - // What means the 0x10 and the 0x08 bits? I only saw it used by the bios cdr.Ctrl |= 0x18; CDR_LOG_IO("cdr r0.sta: %02x\n", cdr.Ctrl); -- 2.39.5