How to setup TomHarte CPU tests

78 views Asked by At

I am currently testing my 6510 and I decided to use the TomHarte tests for better accuracy. I have a couple of questions regarding this topic;

  1. Do we need to read the binaries of the .json files?
  2. If we were to do that how will the function reading it look like? Will it be similar to something like AllSuiteA (which checks for the PC value and 0x0210 for 0xFF to determine if the emulator passed).
  3. Do we need to do each and every test individually in the .json files? Or is there a way where we can do everything all together at once.

This is the repo

1

There are 1 answers

0
Emir Akaydın On

There is a nice explanation here about the JSON format.

https://github.com/TomHarte/ProcessorTests/blob/main/6502/README.md

  1. What you should do is to parse JSON as a standard JSON file, initialize your CPU with the register & flags from initial key's child values (PC, s, a, x, y, p). And then write all memory values to given locations in ram array. And then execute the code. PC value is already given in initial key.
  2. When execution is finished, you need to compare your actual CPU registers & flags and memory locations with final key. This is how you determine if the test is passed.
  3. All tests needs to be individual. You need to reset the CPU & memory and do the test to make sure nothing from the previous test somehow affects the tests which is unlikely but possible.