instr_timing test output help

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
instr_timing test output help
by on (#124391)
I have an NSF emulator that passes the nestest.nes test. I've moved on to the instr_timing test. As this emulates NSFs, it has no PPU, so I'm reading memory at $6004 and up to see what's going on. The test quickly eats up $6004 to $8000 writing some kind of status, so I suspect it's in a loop somewhere.

Printing $6004 up to $00 is a bit confusing. I get two '1' characters ($31), then about 40 $07 (ascii bel), then a '0', and some others ($eb, $89, $05, etc.). What does this status output mean? Where should I look for bugs?
Re: instr_timing test output help
by on (#124397)
That sounds like the test has crashed. The text output should be plain readable text.

You may have incorrectly implemented some instruction, or perhaps there is a problem with memory mapping? The timing test isn't going to be useful until it can execute in a functionally correct manner.

You can read the source code for the timing tests to see what's going on, but at this point you should probably make a trace log from another emulator and compare line by line with a trace from your own to see where they diverge.
Re: instr_timing test output help
by on (#124402)
Since I pass the nestest.nes fully, I assume the instructions are correct. I have essentially zero memory mapping (which I think is NROM-ish), so it could be related to that. Comparing to another emulator is a great idea, will try.
Re: instr_timing test output help
by on (#124404)
Here are NSF builds of those (they pass in my NSF player, and the ROM builds pass on a NES). I'll post source once I get the build process cleaned up.

nes-instr-timing-nsf.zip

They report failing instructions through sound, so you don't need anything special. The opcode(s) of failed instructions are listed, then the final result code: 2 = official instructions failed, 3 = no official, only unofficial NOPs and alternate SBC, 3 = none of the above, only unofficial instructions failed.

Low beep = 0, high beep = 1. So if opcode $19 failed, you'd get 011001 and then a pause while it continues testing, and then 010 at the end (code 2 = official failed).