Z80TestHarness Class
Definition
Base class for a Z80 emulator test harness. Implement this class to use it with the test suites.
c#
public abstract class Z80TestHarness : TestHarness<Cycle>Constructors
| Name | Description |
|---|---|
Z80TestHarness() |
Properties
| Name | Description |
|---|---|
FlagC | Gets or sets the carry flag, C. |
FlagH | Gets or sets the half-carry flag, H. |
FlagN | Gets or sets the add/subtract flag, N. |
FlagPV | Gets or sets the parity/overflow flag, P/V. |
FlagS | Gets or sets the sign flag, S. |
FlagX | Gets or sets the undocumented X flag, bit 3 of the F register. |
FlagY | Gets or sets the undocumented Y flag, bit 5 of the F register. |
FlagZ | Gets or sets the zero flag, Z. |
HALTAdvancesPC | Does the HALT instruction advance PC? |
Halted | Gets or sets whether the CPU is in the halted state. |
IFF1 | Gets or sets the IFF1 interrupt flip-flop. |
IFF2 | Gets or sets the IFF2 interrupt flip-flop. |
IM | Gets or sets the interrupt mode. |
Interrupt | Gets or sets whether the external interrupt line is asserted. |
IOReader | Gets the IO reader implementation. |
IOWriter | Gets the IO writer implementation. |
NextRegisterWrites | Gets the Next registers written to, in the order they were written. Z80N only; a Z80 never writes to one. |
RegisterA | Gets or sets the A register. |
RegisterAF | Gets or sets the AF register pair. |
RegisterB | Gets or sets the B register. |
RegisterBC | Gets or sets the BC register pair. |
RegisterC | Gets or sets the C register. |
RegisterD | Gets or sets the D register. |
RegisterDE | Gets or sets the DE register pair. |
RegisterE | Gets or sets the E register. |
RegisterF | Gets or sets the F register. |
RegisterH | Gets or sets the H register. |
RegisterHL | Gets or sets the HL register pair. |
RegisterI | Gets or sets the I register. |
RegisterIX | Gets or sets the IX register pair. |
RegisterIXH | Gets or sets the IXH register. |
RegisterIXL | Gets or sets the IXL register. |
RegisterIY | Gets or sets the IY register pair. |
RegisterIYH | Gets or sets the IYH register. |
RegisterIYL | Gets or sets the IYL register. |
RegisterL | Gets or sets the L register. |
RegisterPC | Gets or sets the PC register. |
RegisterQ | Gets or sets the internal Q register. |
RegisterR | Gets or sets the R register. |
RegisterSP | Gets or sets the SP register. |
RegisterWZ | Gets or sets the internal WZ register, sometimes called MEMPTR. |
RomArea | Gets or sets the ROM area in memory. Memory writes in this area by the emulator should be ignored. |
ShadowRegisterAF | Gets or sets the AF' register pair. |
ShadowRegisterBC | Gets or sets the BC' register pair. |
ShadowRegisterDE | Gets or sets the DE' register pair. |
ShadowRegisterHL | Gets or sets the HL' register pair. |
Methods
| Name | Description |
|---|---|
ExecuteInstruction() | Executes a single instruction. |
ExecuteInstruction(TextWriter) | Executes a single instruction with debug output. |
OnRomAreaChanged() | Called when RomArea changes. Override to update your emulator with the ROM area. |
Reset() | Resets the test harness state. |
SetIO<TIO>(TIO) | Sets both the IO reader and writer to the same implementation. |
WriteNextRegister(Byte, Byte) | Records a write to a Next register. Z80N emulators should call this when they perform one. The register number is used as the port of the IOEvent. |