From 2daaaae3b2bb131d88ad750d8a74c146f04da62a Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 18 Jul 2012 23:54:02 +0300 Subject: [PATCH] cdrom: reset cmd buffer when cmd is accepted wrong but hopefully not as much as it was --- libpcsxcore/cdrom.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 -- 2.39.5