diff --git a/cpu/decoder.cpp b/cpu/decoder.cpp index f945d32..989e199 100644 --- a/cpu/decoder.cpp +++ b/cpu/decoder.cpp @@ -119,14 +119,9 @@ void Cpu::executeInstruction() break; } } - else if((op & 0xCF) == 0x03) // INC rr + else if((op & 0xC7) == 0x03) // INC rr; DEC rr { - state.reg16((op >> 4) & 0x3) += 1; - mcycles = 2; - } - else if((op & 0xCF) == 0x0B) // DEC rr - { - state.reg16((op >> 4) & 0x3) -= 1; + state.reg16((op >> 4) & 0x3) += ((op & 0x08) ? -1 : 1); mcycles = 2; } else if((op & 0xE7) == 0xC2) // JP cc, nn: