Sprite overflow test [?]

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Sprite overflow test [?]
by on (#23511)
For the NTSC NES PPU Sprite Overflow Flag Test ROM 3.Timing.nes, my emu gets error 5 (too late for first scanline).

- What's the "first" scanline? The first visible frame line OR the first line of the VBlank period?

- Which PPU cycle is done the sprite evaluation?

by on (#23514)
It's referring to the first on-screen scanline (not the dummy line). Sprite evaluation does not occur during V-Blank, nor does it occur during the dummy scanline after V-Blank. On the first on-screen scanline, the PPU searches for sprites to be drawn on the second line (no sprites are ever drawn on the first line). If more than eight sprites are found, the overflow flag is set during this scanline (thus, if more than eight sprites are on, say, the 100th line, the overflow flag will be set on the 99th line).

The exact timing varies depending on which sprite # triggers the overflow condition. See the following link for a detailed look at sprite evaluation:

http://nesdevwiki.ath.cx/wiki/index.php ... evaluation

by on (#23518)
dvdmth wrote:
Sprite evaluation does not occur during V-Blank, nor does it occur during the dummy scanline after V-Blank.


Is it confirmed that sprite evaluation does not occur during the dummy scanline? The PPU seems to execute this scanline like all the other on screen scanlines except that no pixels are drawn and the scroll counter reload at cycle 304. I know that sprite evaluation is unnecessary on this scanline, but I was thinking of emulating reads from 2004 correctly when PPU is active.

A little off topic maybe, but I thought it was common around here to call the scanline after vblank the "pre scanline" and the scanline before vblank the "dummy scanline" or "dead scanline"? Contrary to the scanline before vblank the scanline after actually does something. :)

by on (#23519)
-deleted-

by on (#23520)
Tests 4 and 5 put the first 9 sprites at X=0 Y=0, then check the time that the overflow flag is first set on that frame.