Doxygen comments.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
/**
|
||||
* @file Z80.h
|
||||
*
|
||||
* Interfaces to Data Buffer.
|
||||
*
|
||||
* This header define the interfaces of general purpose dynamic data buffer that
|
||||
* implemented by Equinox.
|
||||
*/
|
||||
|
||||
/* Zilog Z80 CPU Emulator API
|
||||
____ ____ ___ ___ ___
|
||||
/ __ \ / ___\ / __` __`\ / __`\
|
||||
@@ -31,35 +40,35 @@ this library. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
typedef struct {
|
||||
zusize cycles; /**< Cycles executed in the last call to z80_run. */
|
||||
void* context; /**< Callback functions' "context" argument. */
|
||||
void* context; /**< Callback functions' @c context argument. */
|
||||
ZZ80State state; /**< CPU registers and internal bits. */
|
||||
Z16Bit xy; /**< Temporaty IX/IY register for DD/FD prefixes. */
|
||||
zuint8 r7; /**< Backup of the 7th bit of the R register. */
|
||||
Z32Bit data; /**< Temporary cache of the current instruction. */
|
||||
|
||||
/** Called when the CPU needs to read 8 bits from memory.
|
||||
* @param context A pointer to the calling emulator instance.
|
||||
* @param context The value of the member @c context.
|
||||
* @param address The memory address to read.
|
||||
* @return The 8 bits read from memory. */
|
||||
|
||||
zuint8 (* read)(void *context, zuint16 address);
|
||||
|
||||
/** Called when the CPU needs to write 8 bits to memory.
|
||||
* @param context The value of the member `context`.
|
||||
* @param context The value of the member @c context.
|
||||
* @param address The memory address to write.
|
||||
* @param value The value to write in address. */
|
||||
|
||||
void (* write)(void *context, zuint16 address, zuint8 value);
|
||||
|
||||
/** Called when the CPU needs to read 8 bits from an I/O port.
|
||||
* @param context The value of the member `context`.
|
||||
* @param context The value of the member @c context.
|
||||
* @param port The number of the I/O port.
|
||||
* @return The 8 bits read from the I/O port. */
|
||||
|
||||
zuint8 (* in)(void *context, zuint16 port);
|
||||
|
||||
/** Called when the CPU needs to write 8 bits to an I/O port.
|
||||
* @param context The value of the member `context`.
|
||||
* @param context The value of the member @c context.
|
||||
* @param port The number of the I/O port.
|
||||
* @param value The value to write. */
|
||||
|
||||
@@ -68,15 +77,15 @@ typedef struct {
|
||||
/** Called when the CPU starts executing a maskable interrupt and the
|
||||
* interruption mode is 0. This callback must return the instruction
|
||||
* that the CPU would read from the data bus in this case.
|
||||
* @param context The value of the member `context`.
|
||||
* @param context The value of the member @c context.
|
||||
* @return A 32-bit value containing the bytes of an instruction. The
|
||||
* instruction must begin at the most significant byte of the value. */
|
||||
|
||||
zuint32 (* int_data)(void *context);
|
||||
|
||||
/** Called when the CPU enters or exits the halt state.
|
||||
* @param context The value of the member `context`.
|
||||
* @param state TRUE if halted, FALSE otherwise. */
|
||||
* @param context The value of the member @c context.
|
||||
* @param state @c TRUE if halted, @c FALSE otherwise. */
|
||||
|
||||
void (* halt)(void *context, zboolean state);
|
||||
} Z80;
|
||||
@@ -93,23 +102,23 @@ Z_C_SYMBOLS_BEGIN
|
||||
|
||||
/** Changes the CPU power status.
|
||||
* @param object A pointer to a Z80 emulator instance object.
|
||||
* @param state TRUE for power ON, FALSE otherwise. */
|
||||
* @param state @c TRUE = power ON, @c FALSE = power OFF. */
|
||||
|
||||
CPU_Z80_API void z80_power(Z80 *object, zboolean state);
|
||||
|
||||
/** Resets the CPU by reinitializing its variables and sets its registers to
|
||||
* the state they would be in a real Z80 CPU after a pulse in the RESET line
|
||||
* the state they would be in a real Z80 CPU after a pulse in the RESET line.
|
||||
* @param object A pointer to a Z80 emulator instance object. */
|
||||
|
||||
CPU_Z80_API void z80_reset(Z80 *object);
|
||||
|
||||
/** Runs the CPU for a given number of cycles.
|
||||
* @details Given the fact that one Z80 instruction needs between 4 and 23
|
||||
* cycles to be executed, it's not always possible to run the CPU the exact
|
||||
* number of cycles specfified.
|
||||
/** Runs the CPU for a given number of @p cycles.
|
||||
* @param object A pointer to a Z80 emulator instance object.
|
||||
* @param cycles The number of cycles to be executed.
|
||||
* @return The number of cycles executed. */
|
||||
* @return The number of cycles executed.
|
||||
* @note Given the fact that one Z80 instruction needs between 4 and 23
|
||||
* cycles to be executed, it's not always possible to run the CPU the exact
|
||||
* number of @p cycles specfified. */
|
||||
|
||||
CPU_Z80_API zusize z80_run(Z80 *object, zusize cycles);
|
||||
|
||||
@@ -122,7 +131,7 @@ CPU_Z80_API void z80_nmi(Z80 *object);
|
||||
/** Changes the state of the maskable interrupt.
|
||||
* @details This is equivalent to a change in the INT line of a real Z80 CPU.
|
||||
* @param object A pointer to a Z80 emulator instance object.
|
||||
* @param state TRUE = set line high, FALSE = set line low */
|
||||
* @param state @c TRUE = line high, @c FALSE = line low. */
|
||||
|
||||
CPU_Z80_API void z80_int(Z80 *object, zboolean state);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user