From 8896f8fc6912dfe51a4f2bae6681459673e3af64 Mon Sep 17 00:00:00 2001 From: Ivan Kosarev Date: Sun, 29 Aug 2021 13:08:58 +0100 Subject: [PATCH] [#15] Combine on_decode_dec_rp(). --- z80.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/z80.h b/z80.h index e770939..4ef78b3 100644 --- a/z80.h +++ b/z80.h @@ -687,6 +687,12 @@ class internals::decoder_base : public B { else self().on_fetch_cycle_extra_2t(); self().on_inc_rp(rp); } + void on_decode_dec_rp(regp rp) { + if(!self().on_is_z80()) + self().on_fetch_cycle_extra_1t(); + else + self().on_fetch_cycle_extra_2t(); + self().on_dec_rp(rp); } // Jumps. void on_decode_xcall_nn(fast_u8 op) { @@ -1221,9 +1227,6 @@ class i8080_decoder : public internals::decoder_base { if(r != reg::at_hl) self().on_fetch_cycle_extra_1t(); self().on_dec_r(r); } - void on_decode_dec_rp(regp rp) { - self().on_fetch_cycle_extra_1t(); - self().on_dec_rp(rp); } protected: using base::self; @@ -1256,9 +1259,6 @@ class z80_decoder : public internals::decoder_base { self().on_instr_prefix(iregp::iy); } void on_decode_dec_r(reg r) { self().on_dec_r(r, read_disp_or_null(r)); } - void on_decode_dec_rp(regp rp) { - self().on_fetch_cycle_extra_2t(); - self().on_dec_rp(rp); } protected: using base::self;