Nintendo Entertainment System · build log
The 6502, cycle for cycle
The NES’s CPU core, cpu/6502, matches the original chip on every bus access. In simulation it ran in lockstep with perfect6502, a transistor-level model of the real 6502, over two million cycles of random code with random interrupts, and on 1,500 decimal-mode cases. All 8,991 lines of nestest’s reference log match, cycle counts included, and blargg’s test of every official opcode passes.
The lockstep also turned up three things outside our own code: a memory bug in perfect6502’s newest version, an operation perfect6502 leaves out of three rarely used opcodes, and the exact half-cycle at which the chip samples its interrupt lines.