Skip to content

Commit

Permalink
[#15] Move on_{reti,retn}().
Browse files Browse the repository at this point in the history
  • Loading branch information
kosarev committed Aug 27, 2021
1 parent 9c7982b commit 8b01f1e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,10 @@ class internals::disasm_base : public B {
self().on_format("nop"); }
void on_ret() {
self().on_format("ret"); }
void on_reti() {
self().on_format("reti"); }
void on_retn() {
self().on_format("retn"); }
void on_rst(fast_u16 nn) {
self().on_format("rst W", nn); }
void on_rot(rot k, reg r, fast_u8 d) {
Expand Down Expand Up @@ -1813,10 +1817,6 @@ class z80_disasm
self().on_format("push G", rp, irp); }
void on_ret_cc(condition cc) {
self().on_format("ret C", cc); }
void on_reti() {
self().on_format("reti"); }
void on_retn() {
self().on_format("retn"); }
void on_xim(fast_u8 op, fast_u8 mode) {
self().on_format("xim W, U", 0xed00 | op, mode); }
void on_xneg(fast_u8 op) {
Expand Down Expand Up @@ -2668,6 +2668,16 @@ class internals::executor_base : public B {
fast_u16 pc = self().on_pop();
self().on_set_wz(pc);
self().set_pc_on_return(pc); }
void on_reti_retn() {
// According to Sean Young's The Undocumented Z80
// Documented, both RETI and RETN copy IFF2 to IFF1.
// http://z80.info/zip/z80-documented.pdf
self().set_iff1_on_reti_retn(self().get_iff2_on_reti_retn());
self().on_return(); }
void on_reti() {
self().on_reti_retn(); }
void on_retn() {
self().on_reti_retn(); }
void on_jump(fast_u16 nn) {
self().on_set_wz(nn);
self().set_pc_on_jump(nn); }
Expand Down Expand Up @@ -3952,16 +3962,6 @@ class z80_executor : public internals::executor_base<B> {
void on_ret_cc(condition cc) {
if(check_condition(cc))
self().on_return(); }
void on_reti_retn() {
// According to Sean Young's The Undocumented Z80
// Documented, both RETI and RETN copy IFF2 to IFF1.
// http://z80.info/zip/z80-documented.pdf
self().set_iff1_on_reti_retn(self().get_iff2_on_reti_retn());
self().on_return(); }
void on_reti() {
self().on_reti_retn(); }
void on_retn() {
self().on_reti_retn(); }

protected:
using base::self;
Expand Down

0 comments on commit 8b01f1e

Please sign in to comment.