Skip to content

Commit

Permalink
Fixed a bug preventing the CPU from entering the HALT state due to th…
Browse files Browse the repository at this point in the history
…e end of an INT signal.
  • Loading branch information
redcode committed Jan 11, 2023
1 parent 222a65e commit 8f5d64b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sources/Z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,9 +1302,15 @@ INSTRUCTION(halt)
{
Q_0
PC++;
if (REQUEST) return 4;

if ((self->cycles += 4) >= self->cycle_limit)
{
RESUME = Z80_RESUME_HALT;
return 0;
}

if (REQUEST) return 0;
RESUME = Z80_RESUME_HALT;
if ((self->cycles += 4) >= self->cycle_limit) return 0;
}

SET_HALT_LINE(TRUE);
Expand Down

0 comments on commit 8f5d64b

Please sign in to comment.