This commit is contained in:
redcode
2016-07-04 13:45:19 +02:00
parent ff138a076e
commit 12f9e68a56

View File

@@ -43,7 +43,7 @@ CPU_Z80_USE_LOCAL_HEADER | Use this if you have imported _Z80.h_ and _Z80.c_ to
## API
### `z80_run`
#### `z80_run`
**Description**
Runs the CPU for the given amount of ```cycles```.
@@ -63,7 +63,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_power`
#### `z80_power`
**Description**
Switchs the CPU power status.
@@ -79,7 +79,7 @@ void z80_power(Z80 *object, zboolean state);
**Return value**
None.
### `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.
@@ -95,7 +95,7 @@ void z80_reset(Z80 *object);
**Return value**
None.
### `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.
@@ -111,7 +111,7 @@ void z80_nmi(Z80 *object);
**Return value**
None.
### `z80_int`
#### `z80_int`
**Description**
Switchs the state of the maskable interrupt. This is equivalent to a change in the `INT` line of a real Z80 CPU.
@@ -133,7 +133,7 @@ None.
Before using an instance of the Z80 emulator, its `cb` structure must be initialized with the pointers to the callbacks that your program must provide in order to make possible for the CPU to access the emulated machine's resources. All the callbacks are mandatory except `halt`, which is optional and should be initialized to `NULL` if not used.
### `read`
#### `read`
**Description**
Called when the CPU needs to read 8 bits from memory.
@@ -151,7 +151,7 @@ ZContext16BitAddressRead8Bit read;
**Return value**
The 8 bits read from memory.
### `write`
#### `write`
**Description**
Called when the CPU needs to write 8 bits to memory.
@@ -170,7 +170,7 @@ ZContext16BitAddressWrite8Bit write;
**Return value**
None.
### `in`
#### `in`
**Description**
Called when the CPU needs to read 8 bits from an I/O port.
@@ -188,7 +188,7 @@ ZContext16BitAddressRead8Bit in;
**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.
@@ -207,7 +207,7 @@ ZContext16BitAddressWrite8Bit out;
**Return value**
None.
### `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.
@@ -224,7 +224,7 @@ ZContextRead32Bit int_data;
**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.