Skip to content

Commit

Permalink
[#15] Combine on_{3,4,5}t_exec_cycle().
Browse files Browse the repository at this point in the history
  • Loading branch information
kosarev committed Aug 26, 2021
1 parent eefc716 commit ef5bca1
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,10 @@ class internals::disasm_base : public B {
fast_u8 hi = self().on_read_next_byte();
return make16(hi, lo); }

void on_3t_exec_cycle() {}
void on_4t_exec_cycle() {}
void on_5t_exec_cycle() {}

void on_format(const char *fmt) {
self().on_format_impl(fmt, /* args= */ nullptr);
}
Expand Down Expand Up @@ -1566,10 +1570,6 @@ class z80_disasm

fast_u8 on_disp_read() { return self().on_read_next_byte(); }

void on_3t_exec_cycle() {}
void on_4t_exec_cycle() {}
void on_5t_exec_cycle() {}

void on_format_char(char c, const void **&args,
typename base::output_buff &out) {
switch(c) {
Expand Down Expand Up @@ -2450,8 +2450,9 @@ class internals::executor_base : public B {
self().set_pc_on_imm16_read(inc16(pc));
return make16(hi, lo); }

void on_3t_exec_cycle() {
self().on_tick(3); }
void on_3t_exec_cycle() { self().on_tick(3); }
void on_4t_exec_cycle() { self().on_tick(4); }
void on_5t_exec_cycle() { self().on_tick(5); }

fast_u8 on_input_cycle(fast_u16 port) {
// Z80 samples the value at t4 of the input cycle, see
Expand Down Expand Up @@ -3954,14 +3955,6 @@ class z80_executor : public internals::executor_base<B> {
return self().on_read_cycle(addr);
}

void on_4t_exec_cycle() {
self().on_tick(4);
}

void on_5t_exec_cycle() {
self().on_tick(5);
}

protected:
using base::self;
};
Expand Down

0 comments on commit ef5bca1

Please sign in to comment.