diff --git a/src/cpu.rs b/src/cpu.rs index 965e967..a0e7869 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -915,10 +915,7 @@ impl CPU { /// Panic-free alternative to [Index] pub fn get_r8(&mut self, r8: R8, bus: &impl BusIO) -> u8 { match r8 { - R8::HLmem => { - self.m_cycles += 1; - self.read(self.hl.wide().0, bus).unwrap_or(0xff) - } + R8::HLmem => self.read(self.hl.wide().0, bus).unwrap_or(0xff), _ => self[r8].0, } } @@ -928,7 +925,6 @@ impl CPU { pub fn set_r8(&mut self, r8: R8, data: u8, bus: &mut impl BusIO) { match r8 { R8::HLmem => { - self.m_cycles += 1; let _ = self.write(self.hl.wide().0, data, bus); } _ => self[r8].0 = data,