dp11 wrote: ↑Sat Aug 27, 2022 8:39 pm
Certainly, If there is a sensible way of running then as a test suite with beebjit to check I don't break things in the future that would be good too.
I attempted to script the test, with an eye to adding it to the functional tests.
Currently, the test itself appears to fail on the "RMB" / "SMB" instructions. It's unclear to me if these instructions leaked through to the 65c12 test from the 65c02 test, or if my 1-cycle NOP modeling for these is incorrect.
Here's a sample of scripting this test:
Code: Select all
./beebjit -master -0 ~/Downloads/65C12timing1M.ssd -debug -commands "b 49cf commands q;b 4a00 expr '(flags&2)==0' commands bail;c" -autoboot -headless -fast -accurate
(Needs the latest GitHub code for the new debug command "bail".)
It's fragile because it relies on exact PCs.
If execution arrives at $49CF, this is considered success because that is where "Done." is printed. I would have stopped later, at the final RTS, but the test turns on text output pagination, and the "Done." crosses the page threshold and makes the test pause. The script exits with a success code if this condition is hit.
If execution arrives at $4A00, and the Z flag is clear, this state indicates a timing mismatch. The script aborts if this condition is hit.
Similar to the discussion with Tom on another thread, one way to make the test reliably scriptable would to copy an RTS opcode to (e.g.) $6000 and $7000. If the test detects an error, throw in a JSR $6000. As the test is exiting, throw in a JSR $7000.
Cheers
Chris