Emulator: Fix non-prefix rotate opcodes

This commit is contained in:
Riyyi
2022-10-16 12:46:10 +02:00
parent 8f016b1095
commit 80c68035c5
+4 -4
View File
@@ -1241,7 +1241,7 @@ void CPU::ra()
m_cf = (m_a & 0x80) == 0x80; m_cf = (m_a & 0x80) == 0x80;
// Rotate register A left // Rotate register A left
m_a = (m_a >> 7) | (m_a << 1); m_a = ((m_a >> 7) | (m_a << 1)) & 0xff;
break; break;
case 0x0f: // RRCA case 0x0f: // RRCA
@@ -1256,7 +1256,7 @@ void CPU::ra()
m_cf = (m_a & 0x1) == 0x1; m_cf = (m_a & 0x1) == 0x1;
// Rotate register A right // Rotate register A right
m_a = (m_a >> 1) | (m_a << 7); m_a = ((m_a >> 1) | (m_a << 7)) & 0xff;
break; break;
case 0x17: { // RLA case 0x17: { // RLA
@@ -1272,7 +1272,7 @@ void CPU::ra()
m_cf = (m_a & 0x80) == 0x80; m_cf = (m_a & 0x80) == 0x80;
// Rotate register A left through carry // Rotate register A left through carry
m_a = old_carry | (m_a << 1); m_a = (old_carry | (m_a << 1)) & 0xff;
break; break;
} }
case 0x1f: { // RRA case 0x1f: { // RRA
@@ -1289,7 +1289,7 @@ void CPU::ra()
m_cf = (m_a & 0x1) == 0x1; m_cf = (m_a & 0x1) == 0x1;
// Rotate register A right through carry // Rotate register A right through carry
m_a = (m_a >> 1) | (old_carry << 7); m_a = ((m_a >> 1) | (old_carry << 7)) & 0xff;
break; break;
} }
default: default: