nestest test failure

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
nestest test failure
by on (#93408)
Hi ,

I'm trying to write a nes emulator and want to test my cpu implementation so i passed nestest. Everything seems to be ok except one test which gives me the result 59. I don't what these result means (except that there is a test failure) as i did not find the nestest sources.
I have looked if it was the opcode of the instruction having the problem but it is not the case, the failed test is : (indirect, X) test

Can someone helps me ?? thanks

by on (#93409)
You can run the actual tests without implementing the APU and PPU by doing JSR $C000. For a 6502 simulator written in Python, I made a parser for nestest.log (a Nintendulator log of JSR $C000) that would save the expected value of A, X, Y, P, S, PC, and the cycle counter before each instruction. Then I'd run the CPU an instruction at a time, comparing all of its registers to the expected values. That way, I'd know exactly which instruction failed.