Skip to content

Commit

Permalink
HALT line signal codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcode committed Jul 17, 2023
1 parent 19f9b47 commit 500c7b9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion API/Z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ typedef struct {
/** @brief Value of the @p state parameter of <tt>@ref Z80::halt</tt> when the
* HALT line goes high due to a special RESET signal. */

#define Z80_HALT_EARLY_EXIT 2
#define Z80_HALT_EXIT_EARLY 2

/** @brief Value of the @p state paratemer of <tt>@ref Z80::halt</tt> when the
* HALT line goes low and then high due to a special RESET signal during the
Expand Down
2 changes: 1 addition & 1 deletion documentation/APIReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Sometimes the emulator runs out of clock cycles while performing long tasks that
HALT state codes
----------------

.. doxygendefine:: Z80_HALT_EARLY_EXIT
.. doxygendefine:: Z80_HALT_EXIT_EARLY
.. doxygendefine:: Z80_HALT_CANCEL

Register accessors
Expand Down
4 changes: 2 additions & 2 deletions sources/Z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ INSN(halt)
HALT_LINE = FALSE;

if (self->halt != Z_NULL)
self->halt(CONTEXT, Z80_HALT_EARLY_EXIT);
self->halt(CONTEXT, Z80_HALT_EXIT_EARLY);

if ((DATA[0] = opcode) != 0x76)
{
Expand Down Expand Up @@ -2234,7 +2234,7 @@ Z80_API zusize z80_run(Z80 *self, zusize cycles)
HALT_LINE = FALSE;

if (self->halt != Z_NULL)
self->halt(CONTEXT, Z80_HALT_EARLY_EXIT);
self->halt(CONTEXT, Z80_HALT_EXIT_EARLY);

if (IS_XY_PREFIX(DATA[0] = opcode = DATA[2]))
self->cycles += insn_table[FETCH_OPCODE(PC)](self);
Expand Down
6 changes: 4 additions & 2 deletions sources/Z80.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
____ \/__/ /\_\ __ \\ \/\ \ ______________________________________
| /\_____\\_____\\_____\ |
| Zilog \/_____//_____//_____/ CPU Emulator - Pascal Binding |
| Copyright (C) 2022 Zoran Vučenović. |
| Copyright (C) 2022-2023 Zoran Vučenović. |
| |
| Permission to use, copy, modify, and/or distribute this software |
| for any purpose with or without fee is hereby granted. |
Expand Down Expand Up @@ -148,7 +148,9 @@ TZ80 = record
Z80_RESUME_XY = 2;
Z80_RESUME_IM0_XY = 3;

Z80_HALT_EARLY_EXIT = 2;
Z80_HALT_EXIT = 0;
Z80_HALT_ENTER = 1;
Z80_HALT_EXIT_EARLY = 2;
Z80_HALT_CANCEL = 3;

var
Expand Down

0 comments on commit 500c7b9

Please sign in to comment.