Is there a test rom for CPU timing (ie extra branch cycles)

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
albailey
Posts: 177
Joined: Thu Jul 13, 2006 3:15 pm

Is there a test rom for CPU timing (ie extra branch cycles)

Post by albailey » Tue Aug 18, 2009 5:36 pm

I have nestest running and all the tests are passing.
I've been working on my PPU and wanted to start to run some of those test ROMS, but I've discovered I'm not going to be able to pass many of the PPU timing tests since my CPU instructions are not actually timed properly.

For example, I was forgetting to add an extra cycle when a branch was taken.

I am now in the process of making sure that for instructions add another cycle if a page boundary is crossed.

Is there currently a test rom that I can run to see if I am properly handling those extra cycles (page crossed, branch taken, etc..)
Perhaps this is a chicken and the egg scenario, where testing the number of cycles cannot be done without PPU timing, and vica versa.

Al

User avatar
Dwedit
Posts: 4435
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Wed Aug 19, 2009 6:25 am

Use Battletoads to test that (Status Bar or Turbo Tunnel will shake if you aren't emulating branch timing correctly), or use Blargg's test for that.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

albailey
Posts: 177
Joined: Thu Jul 13, 2006 3:15 pm

Post by albailey » Wed Aug 19, 2009 7:30 am

Thanks. Using the one by Blargg I can now see I still have more errors to fix.

Is there anything that isolates page boundary crossed opcode timing
(ex: adding a cycle when certain instructions like ADC Absolute,X crosses a page boundary)

Al

User avatar
koitsu
Posts: 4218
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Post by koitsu » Wed Aug 19, 2009 9:22 am

What do you mean by "isolates"? Are you asking what the conditions are for adding a cycle when crossing a page boundary?

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

Post by Zepper » Wed Aug 19, 2009 2:31 pm

Oh language barrier... ^_^;; but okay, I can "translate it".

isolate: to make a certain test code for a specific branching case.

User avatar
Dwedit
Posts: 4435
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Wed Aug 19, 2009 4:35 pm

Look elsewhere in that folder
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

albailey
Posts: 177
Joined: Thu Jul 13, 2006 3:15 pm

Post by albailey » Wed Aug 19, 2009 6:20 pm

Wow. That folder has all sorts of goodies. Thanks (and Thanks to Blargg as well)

And yes, by isolate I meant "unit test" individual instructions.
It turns out I'm not as close to completing the CPU as I thought.

Al

Post Reply