It is currently Wed Jul 18, 2018 9:21 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Jun 18, 2018 6:36 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3127
Location: Brazil
1. During cycles 65-256, it occurs the sprite evaluation for the next scanline, and on cycles 257-320 the tile data fetching for the next scanline. At the beginning of the following scanline, the PPU starts clearing the secondary OAM buffer. Here - when is the first sprite pixel drawn on the screen?

What I do is... On the next scanline, copy the entire secondary OAM buffer and start drawing sprites when the current PPU cycle matches a certain sprite X-position, but is this correct?

2. When the sprite zero hit flag (PPU status $40) is cleared?


Top
 Profile  
 
PostPosted: Mon Jun 18, 2018 8:08 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20263
Location: NE Indiana, USA (NTSC)
As I understand it: The X position of each of the frontmost 8 sprites on each line is copied from secondary OAM to a down counter when the sprite read out of secondary OAM during horizontal blanking. After that, the pattern shifter starts outputting pixels once the down counter expires.

All 3 status bits are cleared at the start of scanline -1, the pre-render scanline (NTSC/PAL-M: 261; PAL/Dendy: 311).


Top
 Profile  
 
PostPosted: Wed Jun 20, 2018 1:43 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3127
Location: Brazil
tepples wrote:
As I understand it: The X position of each of the frontmost 8 sprites on each line is copied from secondary OAM to a down counter when the sprite read out of secondary OAM during horizontal blanking. After that, the pattern shifter starts outputting pixels once the down counter expires.

Writes to the secondary OAM finish at cycle 320. "During horizontal blanking" of the same scanline OR the next scanline?


Top
 Profile  
 
PostPosted: Wed Jun 20, 2018 1:59 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20263
Location: NE Indiana, USA (NTSC)
Based on the OAM access pattern during horizontal blank, I imagine that the copy of the X coordinate from secondary OAM to the down counter associated with the sprite shifter happens during the horizontal blank between the scanline when a sprite is evaluated and determined to be in range and the following scanline when it is displayed. For example, if an 8x1-pixel portion of sprite is evaluated on scanline 64 and displayed on scanline 65, the happens in the horizontal blank between scanline 64 and scanline 65. The horizontal position of these reads is 263, 271, 279, 287, 295, 303, 311, and 319.

Could someone back this up with data from Visual 2C02?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group