Skip to content

Commit

Permalink
[C++] Make sure on_get_int_vector() always gets called before on_get_…
Browse files Browse the repository at this point in the history
…i().
  • Loading branch information
kosarev committed Aug 19, 2024
1 parent c4bfa3f commit bb0cbcb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class root {
unsigned on_get_int_mode() const { return 0; }
void on_set_int_mode(unsigned mode) { unused(mode); }
void on_set_is_int_disabled(bool f) { unused(f); }
fast_u8 on_get_int_vector() { return 0xFF; }
fast_u8 on_get_int_vector() { return 0xff; }

void set_i_on_ld(fast_u8 i) { self().on_set_i(i); }

Expand Down Expand Up @@ -3770,7 +3770,9 @@ class internals::executor_base : public B {
break;
case 2: {
// ack(7) w(3) w(3) r(3) r(3)
fast_u16 vector_addr = make16(self().on_get_i(), self().on_get_int_vector());
fast_u8 v = self().on_get_int_vector();
fast_u8 i = self().on_get_i();
fast_u16 vector_addr = make16(i, v);
fast_u8 lo = self().on_read_cycle(vector_addr);
fast_u8 hi = self().on_read_cycle(inc16(vector_addr));
isr_addr = make16(hi, lo); }
Expand Down

0 comments on commit bb0cbcb

Please sign in to comment.