nesdev.com
http://forums.nesdev.com/

Sprite evaluation timing clarification
http://forums.nesdev.com/viewtopic.php?f=3&t=15770
Page 1 of 1

Author:  wbrian [ Thu Apr 06, 2017 10:17 pm ]
Post subject:  Sprite evaluation timing clarification

I'm reading the wiki page on sprite timing here, and just wanted to clarify something quickly.

Quote:
Cycles 65-256: Sprite evaluation
On odd cycles, data is read from (primary) OAM
On even cycles, data is written to secondary OAM (unless secondary OAM is full, in which case it will read the value in secondary OAM instead)


Taking into consideration the note about odd/even cycles...

Quote:
1a. If Y-coordinate is in range, copy remaining bytes of sprite data (OAM[n][1] thru OAM[n][3]) into secondary OAM.


Am I correct in interpreting this step as taking 6 PPU cycles, one for each read from primary oam and one for each write to secondary OAM?

More generally, all reads and all writes from primary OAM to secondary OAM occur on separate cycles during sprite evaluation?

Author:  Quietust [ Fri Apr 07, 2017 5:05 am ]
Post subject:  Re: Sprite evaluation timing clarification

wbrian wrote:
Quote:
1a. If Y-coordinate is in range, copy remaining bytes of sprite data (OAM[n][1] thru OAM[n][3]) into secondary OAM.


Am I correct in interpreting this step as taking 6 PPU cycles, one for each read from primary oam and one for each write to secondary OAM?

More generally, all reads and all writes from primary OAM to secondary OAM occur on separate cycles during sprite evaluation?


Yes, to both questions.

Author:  wbrian [ Sun Apr 09, 2017 10:05 am ]
Post subject:  Re: Sprite evaluation timing clarification

Much appreciated! One more thing I could use clarification on:

Quote:
if eight in-range sprites have been found so far, the sprite evaluation logic continues to scan the primary OAM looking for one more in-range sprite to determine whether to set the sprite overflow flag.


Does this imply that once sprite overflow logic finds another sprite on the scanline, overflow evaluation stops and we continue to step 4 of sprite evaluation? For reference, step 4 is "Attempt (and fail) to copy OAM[n][0] into the next free slot in secondary OAM, and increment n (repeat until HBLANK is reached)."

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/