From: notaz Date: Wed, 18 Jul 2012 20:54:02 +0000 (+0300) Subject: cdrom: reset cmd buffer when cmd is accepted X-Git-Tag: r15~21 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2daaaae3b2bb131d88ad750d8a74c146f04da62a;p=pcsx_rearmed.git cdrom: reset cmd buffer when cmd is accepted wrong but hopefully not as much as it was --- diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 87855985..297c8aee 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -1264,6 +1264,9 @@ void cdrInterrupt() { Check_Shell( Irq ); + cdr.ParamP = 0; + cdr.ParamC = 0; + if (cdr.Stat != NoIntr && cdr.Reg2 != 0x18) { psxHu32ref(0x1070) |= SWAP32((u32)0x4); } @@ -1451,12 +1454,6 @@ void cdrWrite0(unsigned char rt) { CDR_LOG("cdrWrite0() Log: CD0 write: %x\n", rt); #endif cdr.Ctrl = (rt & 3) | (cdr.Ctrl & ~3); - - if (rt == 0) { - cdr.ParamP = 0; - cdr.ParamC = 0; - cdr.ResultReady = 0; - } } unsigned char cdrRead1(void) { @@ -1508,6 +1505,8 @@ void cdrWrite1(unsigned char rt) { if (cdr.Ctrl & 0x3) return; + cdr.ResultReady = 0; + switch (cdr.Cmd) { case CdlSync: cdr.Ctrl |= 0x80; @@ -1809,6 +1808,8 @@ void cdrWrite1(unsigned char rt) { break; default: + cdr.ParamP = 0; + cdr.ParamC = 0; #ifdef CDR_LOG CDR_LOG("cdrWrite1() Log: Unknown command: %x\n", cdr.Cmd); #endif