Browse Source

Emulator: Fix DAA carry flag, opcode: 0x27

master
Riyyi 2 years ago
parent
commit
5b08c18127
  1. 5
      src/cpu.cpp

5
src/cpu.cpp

@ -548,6 +548,8 @@ void CPU::daa()
if (!m_nf) {
if (m_cf || m_a > 0x99) {
m_a += 0x60;
// Carry flag
m_cf = 1;
}
if (m_hf || (m_a & 0xf) > 0x9) {
@ -564,9 +566,6 @@ void CPU::daa()
}
}
// Carry flag
m_cf = (m_a & 0x100) == 0x100;
m_a = m_a & 0xff;
// Set flags

Loading…
Cancel
Save