Skip to content

Commit

Permalink
[#15] Combine on_decode_dec_rp().
Browse files Browse the repository at this point in the history
  • Loading branch information
kosarev committed Aug 29, 2021
1 parent 6973086 commit 8896f8f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -1221,9 +1227,6 @@ class i8080_decoder : public internals::decoder_base<B> {
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;
Expand Down Expand Up @@ -1256,9 +1259,6 @@ class z80_decoder : public internals::decoder_base<B> {
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;
Expand Down

0 comments on commit 8896f8f

Please sign in to comment.