I'm still rewriting my sprite evaluation logic, but I have a few notes. Hope it helps.
1. The sprite evaluation starts at PPU cycle 65. On odd cycles, data is read from primary OAM (sprite ram). On even cycles, the buffered data is written to the secondary OAM (32 bytes long).
2. Steps 1 and 2 refer to the normal evaluation. Step 3 is the weird evaluation, and step 4 is when less than 8 sprites are found in the current scanline.
3. 'n' scans through the primary OAM. If 'n'=64, then 'n' warps to 0. Go to step 4. It may be less than 8 sprites in the OAM secondary buffer though. No weird evaluation happens here.
4. If the secondary OAM is full, the weird evaluation starts! If 'n'=64, then 'n' warps to 0. Step 4 now takes place.
zzzz898 wrote:
Does 1 and 2 happen on the same cycle ?
Nope. Data must be read, then written to the secondary OAM. Next, it's checked if the buffer's full (8 sprites found).