aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2012-07-18 23:49:47 +0300
committernotaz2012-07-19 00:20:13 +0300
commit50b13be9826da8433b39bd7d02cce2422f91cf0c (patch)
tree4e3823b87c92860fe3e2fac11441e4f4693e4ee7
parentaafcb4ddc257478d613611adcae7cb13fd716577 (diff)
downloadpcsx_rearmed-50b13be9826da8433b39bd7d02cce2422f91cf0c.tar.gz
pcsx_rearmed-50b13be9826da8433b39bd7d02cce2422f91cf0c.tar.bz2
pcsx_rearmed-50b13be9826da8433b39bd7d02cce2422f91cf0c.zip
cdrom: mask selector bits correctly
-rw-r--r--libpcsxcore/cdrom.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c
index fa0e6a9..8785598 100644
--- a/libpcsxcore/cdrom.c
+++ b/libpcsxcore/cdrom.c
@@ -1450,7 +1450,7 @@ void cdrWrite0(unsigned char rt) {
#ifdef CDR_LOG
CDR_LOG("cdrWrite0() Log: CD0 write: %x\n", rt);
#endif
- cdr.Ctrl = rt | (cdr.Ctrl & ~0x3);
+ cdr.Ctrl = (rt & 3) | (cdr.Ctrl & ~3);
if (rt == 0) {
cdr.ParamP = 0;
@@ -1506,7 +1506,7 @@ void cdrWrite1(unsigned char rt) {
}
#endif
- if (cdr.Ctrl & 0x1) return;
+ if (cdr.Ctrl & 0x3) return;
switch (cdr.Cmd) {
case CdlSync:
@@ -1861,7 +1861,7 @@ void cdrWrite2(unsigned char rt) {
cdr.Reg2 = rt;
break;
}
- } else if (!(cdr.Ctrl & 0x1) && cdr.ParamP < 8) {
+ } else if (!(cdr.Ctrl & 0x3) && cdr.ParamP < 8) {
cdr.Param[cdr.ParamP++] = rt;
cdr.ParamC++;
}
@@ -1914,7 +1914,7 @@ void cdrWrite3(unsigned char rt) {
}
- if (rt == 0x07 && cdr.Ctrl & 0x1) {
+ if (rt == 0x07 && (cdr.Ctrl & 3) == 1) {
cdr.Stat = 0;
if (cdr.Irq == 0xff) {
@@ -1939,7 +1939,7 @@ void cdrWrite3(unsigned char rt) {
return;
}
- if (rt == 0x80 && !(cdr.Ctrl & 0x1) && cdr.Readed == 0) {
+ if (rt == 0x80 && !(cdr.Ctrl & 0x3) && cdr.Readed == 0) {
cdr.Readed = 1;
cdr.pTransfer = cdr.Transfer;