From 8f1b1eb924b81f2f0b0eb5d810e3bf3fa44b1a78 Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Tue, 29 Aug 2023 23:04:59 +0200 Subject: [PATCH] cpu/decoder - Implement INC rr and DEC rr --- cpu/decoder.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpu/decoder.cpp b/cpu/decoder.cpp index fe54a2e..a34dcdd 100644 --- a/cpu/decoder.cpp +++ b/cpu/decoder.cpp @@ -119,6 +119,16 @@ void Cpu::executeInstruction() break; } } + else if((op & 0xCF) == 0x03) // INC rr + { + state.reg16((op >> 4) & 0x3) += 1; + mcycles = 2; + } + else if((op & 0xCF) == 0x0B) // INC rr + { + state.reg16((op >> 4) & 0x3) -= 1; + mcycles = 2; + } else if((op & 0xE7) == 0xC2) // JP cc, nn: { u16 nn = readPC16();