Added instruction cycle counting to new Z80 core

This commit is contained in:
Nik Henson 2011-07-26 21:47:59 +00:00
parent 79e8172340
commit 62f695cc96
2 changed files with 608 additions and 23 deletions

File diff suppressed because it is too large Load diff

View file

@ -27,7 +27,6 @@
* *
* Known inaccuracies: * Known inaccuracies:
* *
* - No timing. Each instruction takes one "cycle".
* - Interrupts are accepted immediately after EI instruction. In reality, * - Interrupts are accepted immediately after EI instruction. In reality,
* interrupts become enabled after the instruction following EI. This * interrupts become enabled after the instruction following EI. This
* could be implemented with a state machine in Run() if needed. * could be implemented with a state machine in Run() if needed.
@ -73,19 +72,17 @@ class CZ80
{ {
public: public:
/* /*
* Run(numOps): * Run(numCycles):
* *
* Runs the Z80 for the specified number of instructions. * Runs the Z80 for the specified number of instruction cycles.
* *
* Parameters: * Parameters:
* numOps Number of instructions to execute. Cycle-accurate timing * numCycles Number of instruction cycles to execute.
* is not yet supported.
* *
* Returns: * Returns:
* Number of instructions actually executed. For now, this will not * Number of instruction cycles actually executed.
* differ from numOps.
*/ */
int Run(int numOps); int Run(int numCycles);
/* /*
* TriggerNMI(void): * TriggerNMI(void):