PPU race condition - $2006 vs Y-increment

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

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

PPU race condition - $2006 vs Y-increment

Post by Zepper » Tue Jun 21, 2016 5:10 pm

The "PPU race condition" occurs when a Y-increment triggers after a $2006 (second) write, which should win. Games that are affected by this thing are Mega Man 5, The Simpsons - Bart vs Space Mutants, Kick Master, among others.

A way of fixing it is to put a flag that indicates a $2006 2nd write. If this flag is raised on Y-increment, the increment won't occur after PPU cycle 254 (or 255 depending of how you're counting cycles).

I wonder if this is a real condition... or an obscure timing bug in emulators.

User avatar
zeroone
Posts: 932
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Re: PPU race condition - $2006 vs Y-increment

Post by zeroone » Tue Jun 21, 2016 5:35 pm

With the flag does it still pass all the test ROMs in addition to fixing all the games?

x0000
Posts: 43
Joined: Thu Feb 28, 2013 11:14 am
Contact:

Re: PPU race condition - $2006 vs Y-increment

Post by x0000 » Wed Jun 22, 2016 3:48 am

Should be quite easy to write a test rom for this, someone should definitely make it and test on a real console.

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

Re: PPU race condition - $2006 vs Y-increment

Post by Zepper » Wed Jun 22, 2016 7:01 pm

No problems. Sprite zero tests are OK, including overflow bit and MMC3 IRQs.

Post Reply