It is currently Thu Aug 16, 2018 9:09 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 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: 3137
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: 20405
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: 3137
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: 20405
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 X copy 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  
 
PostPosted: Sun Aug 12, 2018 6:18 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3137
Location: Brazil
tepples wrote:
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?


bump


Top
 Profile  
 
PostPosted: Sun Aug 12, 2018 9:51 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10708
Location: Rio de Janeiro - Brazil
Zepper, I don't mean to be rude, but sometimes it looks like you're demanding answers from people when nobody really has them. Visual 2C02 is a public tool, so if these details about the workings of the NES are so important to you, maybe you should spend some time figuring it out so you can test these things yourself instead of asking others to do it for you.


Top
 Profile  
 
PostPosted: Sun Aug 12, 2018 10:02 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1421
For what it's worth, I investigated this a bit and confirmed that it is during the 5th "sprite fetch" cycle (i.e. 261/269/277/285/293/301/309/317) that the sprite's X coordinate is copied into the relevant sprite slot's countdown timer; the 4th cycle is when the attributes (palette+priority) are copied (and the X/Y flip are latched for the pattern fetches that happen during cycles 5-8).

I do agree, though, that Visual 2C02 is there so everyone can look at it and figure out how things work. The "teach a man to fish" adage is especially relevant here.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
PostPosted: Sun Aug 12, 2018 2:54 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3137
Location: Brazil
Thanks Q.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 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