diff --git a/API/Z80.h b/API/Z80.h
index d12c13a..b4f497f 100644
--- a/API/Z80.h
+++ b/API/Z80.h
@@ -530,7 +530,7 @@ typedef struct {
/** @brief Value of the @p state parameter of @ref Z80::halt 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 @ref Z80::halt when the
* HALT line goes low and then high due to a special RESET signal during the
diff --git a/documentation/APIReference.rst b/documentation/APIReference.rst
index ee1deda..f2cfc33 100644
--- a/documentation/APIReference.rst
+++ b/documentation/APIReference.rst
@@ -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
diff --git a/sources/Z80.c b/sources/Z80.c
index 8589149..d8d72d9 100644
--- a/sources/Z80.c
+++ b/sources/Z80.c
@@ -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)
{
@@ -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);
diff --git a/sources/Z80.pas b/sources/Z80.pas
index e61ba90..2b99f77 100644
--- a/sources/Z80.pas
+++ b/sources/Z80.pas
@@ -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. |
@@ -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