742,382 failures

-

Emu’s 65816 core was passing the tests I had, so I added another inception level.

The first run reported 742,382 failures. Well, we have some work to do…

SingleStepTests/65816 contains about 3 GB of test data: 512 files covering every opcode in native and emulation modes, with 10,000 cases in each file. Each case describes an initial CPU state, the expected bus cycles and the final register and memory values.

The failures exposed several bugs in the CPU core:

After fixing these, the count dropped to 16,262 failures, with 508 of the 512 files passing completely. The remaining differences involved status timing in REP, SEP and RTI, and a direct-page wrapping case where the test reference disagreed with the manual.

This huge test suite is downloaded separately with tools/fetch-sst65816.sh for on-demand use. For routine builds, I’ve also adapted gilyon’s 65816 tests to run headless. Its 1,610 tests cover every opcode except STP and WAI, in 8- and 16-bit widths, and take about 15 ms.

That suite found two more wrapping errors, in (d,x) addressing and the stack accesses of JSR (a,x). These cases also disagree with SingleStepTests, so the two suites need comparing with care.

I also fixed WAI wake-up behavior and added a regression test ROM for it.


Share: