I'm having problems understanding the full cycle of sprite evaluation from here https://www.nesdev.org/wiki/PPU_sprite_evaluation.
The point that confuses me is the first step, clearing the secondary OAM.
It says:
How is this initialization happennig?Cycles 1-64: Secondary OAM (32-byte buffer for current sprites on scanline) is initialized to $FF
Should I clear all 32 bytes every cycle? Or one byte every two cycles?
What also confuses me is, if each scanline we are looking for the sprites to be rendered on the next scanline, how are we clearing the secondary oam just at the beginning of each scanline?
Doesn't this initialization destroy the information I need to render the sprite pixels on the current scanline?
I know there's also the pattern shifters for the sprites, but those does not contain coordinates nor attribute information... Does this means my emulator should keep a copy of secondary OAM for the current scanline?