Emulator: Fix DAA carry flag, opcode: 0x27

This commit is contained in:
Riyyi
2022-09-02 16:35:43 +02:00
parent 857865dfb9
commit 5b08c18127
+2 -3
View File
@@ -548,6 +548,8 @@ void CPU::daa()
if (!m_nf) { if (!m_nf) {
if (m_cf || m_a > 0x99) { if (m_cf || m_a > 0x99) {
m_a += 0x60; m_a += 0x60;
// Carry flag
m_cf = 1;
} }
if (m_hf || (m_a & 0xf) > 0x9) { 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; m_a = m_a & 0xff;
// Set flags // Set flags