Browse Source

Emulator: Fix non-prefix rotate opcodes

master
Riyyi 2 years ago
parent
commit
80c68035c5
  1. 8
      src/cpu.cpp

8
src/cpu.cpp

@ -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:

Loading…
Cancel
Save