Skip to content

Commit

Permalink
Small simplification of the IM0 code
Browse files Browse the repository at this point in the history
  • Loading branch information
agaxia committed Nov 23, 2023
1 parent 600ef57 commit 76788c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sources/Z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ INSN(hook)
/* 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* A */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* B */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* C */ 1, 0, 3, 3, 3, 0, 0, 1, 1, 1, 3, 0, 3, 3, 0, 1,
/* C */ 1, 0, 3, 0, 3, 0, 0, 1, 1, 1, 3, 0, 3, 3, 0, 1,
/* D */ 1, 0, 3, 0, 3, 0, 0, 1, 1, 0, 3, 0, 3, 0, 0, 1,
/* E */ 1, 0, 3, 0, 3, 0, 0, 1, 1, 1, 3, 0, 3, 0, 0, 1,
/* F */ 1, 0, 3, 0, 3, 0, 0, 1, 1, 0, 3, 0, 3, 0, 0, 1};
Expand Down Expand Up @@ -2558,7 +2558,9 @@ Z80_API zusize z80_run(Z80 *self, zusize cycles)

else {
cycles += 2 + insn_table[ird](self);
PC = im0.pc;

/* Restore PC, except for `jp WORD` */
if (ird != 0xC3) PC = im0.pc;
}

im0_finalize:
Expand Down

0 comments on commit 76788c3

Please sign in to comment.