I can't remember where, but I read somewhere that secondary OAM is only 32 bytes in size. If that is correct then I don't understand how more than 8 sprites are evaluated per scanline. In step 1 we are copying the Y coordinate to secondary OAM even if it is not in range. I am also assuming that we skip the next 3 bytes when doing so. If this is the case then the secondary OAM will fill up after 8 sprites and will never look at the remaining 56 sprites. Which part do I have wrong?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)
1. Starting at n = 0, read a sprite's Y-coordinate (OAM[n][0], copying it to the next open slot in secondary OAM (unless 8 sprites have been found, in which case the write is ignored).
1a. If Y-coordinate is in range, copy remaining bytes of sprite data (OAM[n][1] thru OAM[n][3]) into secondary OAM.
2. Increment n
2a. If n has overflowed back to zero (all 64 sprites evaluated), go to 4
....
Also I noticed in some other Emulators that the sprite evaluation is all done at cycle 256 and not over the whole visible scanline. Will this cause problems with some games, do they do mid scanline sprite magic ?