Hi! I've started working on a NES emulator and I'm now testing the CPU.
I've run through nestest.nes and all instructions execute correctly. My problem is, the cycle count is way off right from the start.
These are the first 10 cycle counts from the start:
I must be missing something fundamental, since it isn't even close to matching. I only increment the cycle counter after an instruction has been carried out.
Am I supposed to count cycles somewhere else? Right now only the CPU is implemented, nothing else.
I've run through nestest.nes and all instructions execute correctly. My problem is, the cycle count is way off right from the start.
These are the first 10 cycle counts from the start:
Code:
+------+-------------+-------------+
| Mine | Nestest.nes | Instruction |
+------+-------------+-------------+
| 0 | 0 | JMP $C5F5 |
| 5 | 9 | LDX #$00 |
| 7 | 15 | STX $00 |
| 10 | 24 | STX $10 |
| 13 | 33 | STX $11 |
| 16 | 42 | JSR $C72D |
| 22 | 42 | NOP |
| 24 | 60 | SEC |
| 26 | 66 | BCS $C735 |
| 28 | 72 | NOP |
+------+-------------+-------------+
| Mine | Nestest.nes | Instruction |
+------+-------------+-------------+
| 0 | 0 | JMP $C5F5 |
| 5 | 9 | LDX #$00 |
| 7 | 15 | STX $00 |
| 10 | 24 | STX $10 |
| 13 | 33 | STX $11 |
| 16 | 42 | JSR $C72D |
| 22 | 42 | NOP |
| 24 | 60 | SEC |
| 26 | 66 | BCS $C735 |
| 28 | 72 | NOP |
+------+-------------+-------------+
I must be missing something fundamental, since it isn't even close to matching. I only increment the cycle counter after an instruction has been carried out.
Am I supposed to count cycles somewhere else? Right now only the CPU is implemented, nothing else.