From ddea64ec63adf6ae1119aaa1c3dd6b34205ff5e7 Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Tue, 29 Aug 2023 16:54:17 +0200 Subject: [PATCH] cpu/decoder - Remove unnessary intermediate variable --- cpu/decoder.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cpu/decoder.cpp b/cpu/decoder.cpp index fac61c1..01c45a3 100644 --- a/cpu/decoder.cpp +++ b/cpu/decoder.cpp @@ -203,18 +203,12 @@ void Cpu::executeInstruction() mcycles = 2; break; case 0xFA: // LD A, [nn] - { - u16 addr = readPC16(); - state.A = bus->read8(addr); - mcycles = 4; - } + state.A = bus->read8(readPC16()); + mcycles = 4; break; case 0xEA: // LD [nn], A - { - u16 addr = readPC16(); - bus->write8(addr, state.A); - mcycles = 4; - } + bus->write8(readPC16(), state.A); + mcycles = 4; break; case 0xF2: // LD A, [0xFF : C] state.A = bus->read8(make_u16(0xFFu,state.C));