New CPU test ROM

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
ulfalizer
Posts: 349
Joined: Fri Mar 08, 2013 9:55 pm
Location: Linköping, Sweden

Re:

Post by ulfalizer » Sun Jun 16, 2013 4:58 am

blargg wrote:I just tested and 9C and 9E are screwey. I need to take them off the test. Depending on X and Y they sometimes write to $700, among other things. Maybe someone else can figure them out properly.
Stumbled upon this thread after noticing that those fail in my emu ("9C SYA abs,X", "9E SXA abs,Y").

My guess is that the "AND addr_high + 1" behavior comes from always calculating addr_high + 1, regardless of whether its needed to correct the address. In that case, maybe the screwy behavior occurs when the value is actually used, i.e. when "addr + x" or "addr + y" crosses into a new page.

Maybe it affects AXA and TAS in addition to SYA and SXA in that case.

User avatar
ulfalizer
Posts: 349
Joined: Fri Mar 08, 2013 9:55 pm
Location: Linköping, Sweden

Re: New CPU test ROM

Post by ulfalizer » Sun Jun 16, 2013 5:26 am

Implementing it like that does make the tests pass. :)

If we cross over into a new page, then the calculated addr_high + 1 gets used, but for these opcodes addr_high + 1 is corrupted (prolly due to the result being put on the same bus as x/y), and the target address for e.g. SYA becomes ((y & (addr_high + 1)) << 8) | addr_low instead of the normal ((addr_high + 1) << 8) | addr_low. If we don't wrap to a new page, then the corrupted value doesn't get used for the address, so nothing special happens.

I'm guessing it works like that for all the instructions where the value is influenced by addr_high + 1, but confirmation would be nice.

HastatusXXI
Posts: 40
Joined: Sat Aug 25, 2018 7:21 am

Re: New CPU test ROM

Post by HastatusXXI » Thu Aug 30, 2018 11:05 am

blargg wrote:I've been working on a new test framework that can run multiple groups of tests and give better feedback. As a first use of it, here's a set of CPU tests that do most instructions, testing several edge cases. If it fails, it prints the opcode and instruction name. It only tests official instructions right now.

blargg_nes_cpu_test5.zip

These tests work like zexall, trying each instruction with all interesting combinations of inputs and checksumming the registers afterwards. After all the different combinations have been fed to a particular instruction, the checksum is compared with the correct one to determine pass/fail.

EDIT: Replaced with version that doesn't stop on failure, so you get a list of all the instructions that failed.
The link is down. Could you reupload it, please?

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: New CPU test ROM

Post by Zepper » Thu Aug 30, 2018 12:52 pm

Version 6. 8-)
Attachments
cpu_timing_test6.zip
(10.38 KiB) Downloaded 367 times

HastatusXXI
Posts: 40
Joined: Sat Aug 25, 2018 7:21 am

Re: New CPU test ROM

Post by HastatusXXI » Thu Aug 30, 2018 2:25 pm

Zepper wrote:Version 6. 8-)
Thank you, man.

Post Reply