From efc6762068d4c9205e5576fbdba88f01b685b92d Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Wed, 30 Aug 2023 00:25:49 +0200 Subject: [PATCH] cpu/decoder - Remove extaneous code of instruction already implemented elsewhere --- cpu/decoder.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/cpu/decoder.cpp b/cpu/decoder.cpp index 97f0dbb..2ba95fd 100644 --- a/cpu/decoder.cpp +++ b/cpu/decoder.cpp @@ -17,7 +17,7 @@ void Cpu::executeInstruction() printf("@0x%04x: opcode %02X\n",currentpc,op); #endif - if ((op & 0xC0) == 0x40 && op != 0x76) // LD r, r' + if ((op & 0xC0) == 0x40 && op != 0x76) // LD r, r'; LD r, [HL]; LD [HL], r { u8 tmp; switch(op & 0x07) @@ -42,16 +42,6 @@ void Cpu::executeInstruction() default: state.reg8((op >> 3) & 0x7) = imm; break; } } - else if((op & 0xC7) == 0x46 && op != 0x76) // LD r, [HL] - { - u8 data = bus->read8(state.HL); - state.reg8((op >> 3) & 0x7) = data; - } - else if((op & 0xC8) == 0x70 && op != 0x76) // LD [HL], r - { - u8 data = state.reg8(op & 0x7); - bus->write8(state.HL, data); - } else if((op & 0xCF) == 0x01) // LD rr, nn { u16 data = readPC16();