README.md
This commit is contained in:
22
README.md
22
README.md
@@ -40,7 +40,7 @@ CPU_Z80_USE_LOCAL_HEADER | Use this if you have imported _Z80.h_ and _Z80.c_ to
|
||||
|
||||
## API
|
||||
|
||||
#### `z80_power`
|
||||
### `z80_power`
|
||||
|
||||
**Description**
|
||||
Changes the CPU power status.
|
||||
@@ -53,7 +53,7 @@ void z80_power(Z80 *object, zboolean state);
|
||||
`object` → A pointer to a Z80 emulator instance object.
|
||||
`state` → `TRUE` for power ON, `FALSE` otherwise.
|
||||
|
||||
#### `z80_reset`
|
||||
### `z80_reset`
|
||||
|
||||
**Description**
|
||||
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.
|
||||
@@ -66,7 +66,7 @@ void z80_reset(Z80 *object);
|
||||
**Parameters**
|
||||
`object` → A pointer to a Z80 emulator instance object.
|
||||
|
||||
#### `z80_run`
|
||||
### `z80_run`
|
||||
|
||||
**Description**
|
||||
Runs the CPU for a given number of ```cycles```.
|
||||
@@ -86,7 +86,7 @@ The number of cycles executed.
|
||||
**Discusion**
|
||||
Given the fact that one Z80 instruction needs between 4 and 23 cycles to be executed, it is not always possible to run the CPU the exact number of cycles specfified.
|
||||
|
||||
#### `z80_nmi`
|
||||
### `z80_nmi`
|
||||
|
||||
**Description**
|
||||
Performs a non-maskable interrupt. This is equivalent to a pulse in the `NMI` line of a real Z80 CPU.
|
||||
@@ -99,7 +99,7 @@ void z80_nmi(Z80 *object);
|
||||
**Parameters**
|
||||
`object` → A pointer to a Z80 emulator instance object.
|
||||
|
||||
#### `z80_int`
|
||||
### `z80_int`
|
||||
|
||||
**Description**
|
||||
Changes the state of the maskable interrupt. This is equivalent to a change in the `INT` line of a real Z80 CPU.
|
||||
@@ -118,7 +118,7 @@ void z80_int(Z80 *object, zboolean state);
|
||||
|
||||
Before using an instance of the Z80 emulator, its callback pointers must be initialized with the pointers to the functions that your program must provide in order to make possible for the CPU to access the emulated machine's resources. All callbacks are mandatory except `halt`, which is optional and must be set to `NULL` if not used.
|
||||
|
||||
#### `read`
|
||||
### `read`
|
||||
|
||||
**Description**
|
||||
Called when the CPU needs to read 8 bits from memory.
|
||||
@@ -135,7 +135,7 @@ zuint8 (* read)(void *context, zuint16 address);
|
||||
**Return value**
|
||||
The 8 bits read from memory.
|
||||
|
||||
#### `write`
|
||||
### `write`
|
||||
|
||||
**Description**
|
||||
Called when the CPU needs to write 8 bits to memory.
|
||||
@@ -150,7 +150,7 @@ void (* write)(void *context, zuint16 address, zuint8 value);
|
||||
`address` → The memory address to write.
|
||||
`value` → The value to write in `address`.
|
||||
|
||||
#### `in`
|
||||
### `in`
|
||||
|
||||
**Description**
|
||||
Called when the CPU needs to read 8 bits from an I/O port.
|
||||
@@ -167,7 +167,7 @@ zuint8 (* in)(void *context, zuint16 port);
|
||||
**Return value**
|
||||
The 8 bits read from the I/O port.
|
||||
|
||||
#### `out`
|
||||
### `out`
|
||||
|
||||
**Description**
|
||||
Called when the CPU needs to write 8 bits to an I/O port.
|
||||
@@ -182,7 +182,7 @@ void (* out)(void *context, zuint16 port, zuint8 value);
|
||||
`port` → The number of the I/O port.
|
||||
`value` → The value to write.
|
||||
|
||||
#### `int_data`
|
||||
### `int_data`
|
||||
|
||||
**Description**
|
||||
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.
|
||||
@@ -198,7 +198,7 @@ zuint32 (* int_data)(void *context);
|
||||
**Return value**
|
||||
A 32-bit value containing the bytes of an instruction. The instruction must begin at the most significant byte of the value.
|
||||
|
||||
#### `halt`
|
||||
### `halt`
|
||||
|
||||
**Description**
|
||||
Called when the CPU enters or exits the halt state.
|
||||
|
||||
Reference in New Issue
Block a user