Z80TestHarness Class
Definition
Base class for a Z80 emulator test harness. Implement this class to use it with the test suites.
Constructors
Name | Description |
---|---|
Properties
Name | Description |
---|---|
Gets the recorded CPU cycles. Only available when RecordCycles is true. | |
Gets or sets the carry flag, C. | |
Gets or sets the half-carry flag, H. | |
Gets or sets the add/subtract flag, N. | |
Gets or sets the parity/overflow flag, P/V. | |
Gets or sets the sign flag, S. | |
Gets or sets the undocumented X flag, bit 3 of the F register. | |
Gets or sets the undocumented Y flag, bit 5 of the F register. | |
Gets or sets the zero flag, Z. | |
Gets or sets whether the CPU is in the halted state. | |
Gets or sets the IFF1 interrupt flip-flop. | |
Gets or sets the IFF2 interrupt flip-flop. | |
Gets or sets the interrupt mode. | |
Gets or sets whether an interrupt is pending. | |
Gets the IO reader implementation. | |
Gets the IO writer implementation. | |
A mutable list of Cycles to update when RecordCycles is | |
Gets or sets whether CPU cycles should be recorded. | |
Gets or sets the A register. | |
Gets or sets the AF register pair. | |
Gets or sets the B register. | |
Gets or sets the BC register pair. | |
Gets or sets the C register. | |
Gets or sets the D register. | |
Gets or sets the DE register pair. | |
Gets or sets the E register. | |
Gets or sets the F register. | |
Gets or sets the H register. | |
Gets or sets the HL register pair. | |
Gets or sets the I register. | |
Gets or sets the IX register pair. | |
Gets or sets the IXH register. | |
Gets or sets the IXL register. | |
Gets or sets the IY register pair. | |
Gets or sets the IYH register. | |
Gets or sets the IYL register. | |
Gets or sets the L register. | |
Gets or sets the PC register. | |
Gets or sets the internal Q register. | |
Gets or sets the R register. | |
Gets or sets the SP register. | |
Gets or sets the internal WZ register, sometimes called MEMPTR. | |
Gets or sets the ROM area in memory. Memory writes in this area by the emulator should be ignored. | |
Gets or sets the AF' register pair. | |
Gets or sets the BC' register pair. | |
Gets or sets the DE' register pair. | |
Gets or sets the HL' register pair. | |
Gets or sets the number of T-states (clock cycles) executed. |
Methods
Name | Description |
---|---|
Asserts that the actual value is equal to the expected value. If the values are not equal, an error is reported. | |
Signals that a test has failed with the provided error message. | |
Clears memory. | |
Copies a span of bytes into the memory starting at the specified address. | |
Copies a sequence of bytes into memory starting at the specified address. | |
Creates an assertion scope that allows multiple AssertEqual<T>(T, T, DefaultInterpolatedStringHandler) assertions to be made with just one AssertFail(String). | |
Executes a single instruction. | |
Executes a single instruction with debug output. | |
Called when RomArea changes. Override to update your emulator with the ROM area. | |
Reads a byte from memory. | |
Reads a word in little endian format from memory. | |
Resets the test harness state. | |
Sets both the IO reader and writer to the same implementation. | |
Writes a byte to memory. Does not take RomArea into account as this is used by tests to setup memory. | |
Writes a word in little endian format to memory. Does not take RomArea into account as this is used by tests to setup memory. |