PPU race condition - $2006 vs Y-increment

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
PPU race condition - $2006 vs Y-increment
by on (#173984)
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.
Re: PPU race condition - $2006 vs Y-increment
by on (#173986)
With the flag does it still pass all the test ROMs in addition to fixing all the games?
Re: PPU race condition - $2006 vs Y-increment
by on (#174005)
Should be quite easy to write a test rom for this, someone should definitely make it and test on a real console.
Re: PPU race condition - $2006 vs Y-increment
by on (#174071)
No problems. Sprite zero tests are OK, including overflow bit and MMC3 IRQs.