It is currently Sat Oct 21, 2017 10:01 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Dec 15, 2015 12:52 pm 
Offline

Joined: Tue Dec 15, 2015 3:50 am
Posts: 10
Hello.

Does anyone have precise information on how turning rendering on/off midframe affects the output picture?

(I don't have any hardware to test anything. Please don't direct me to the Visual 2C02; it is enigmatic.)


Top
 Profile  
 
PostPosted: Tue Dec 15, 2015 1:23 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5730
Location: Canada
When you disable rendering, the screen will output the palette 0 (i.e. background) colour.

If the PPU address is changed to the $3F00 region while rendering is off, it will instead output whatever colour appears in the palette at the current address.

Finally, turning rendering off at some points during an active scanline can corrupt sprite evaluation on the next frame, I think? (I don't know the precise details, never tried it personally.)

Rendering is only "off" if both nametable and sprites are off, otherwise all the internal updates and fetching still happens, just one of them is masked. When both of them are off, rendering truly stops. (So turning off just sprites mid-scanline is completely fine. It's only turning the whole thing off that can corrupt sprite evaluation, AFAIK.)


Top
 Profile  
 
PostPosted: Tue Dec 15, 2015 1:46 pm 
Offline

Joined: Tue Dec 15, 2015 3:50 am
Posts: 10
Thank you for the reply.

I need information about what exactly is output after rendering turned off and on again.


Top
 Profile  
 
PostPosted: Tue Dec 15, 2015 2:55 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3943
You turn off rendering, and you get the background color. If you have the PPU Address pointing into palette memory, you get that color instead.
You turn rendering on between dots 256 and 320, and the next scanline displays correctly, but without sprites for that scanline. (possibly stray secondary OAM garbage instead of proper sprites?)
You turn rendering on in the middle of a displayed scanline, and you get up to 16 stale background pixels, then proper pixels from that scanline but incorrectly scrolled horizontally, then the following scanlines are scrolled properly. The sprites for that line might be either nothing, or stray values from the secondary OAM. The sprites won't be correct until two scanlines after you turned rendering on. Since turning off rendering can possibly corrupt the OAM address, it might possibly even use the wrong OAM address and have corrupt sprites for the whole frame.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Tue Dec 15, 2015 3:48 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1784
Location: DIGDUG
What about turning Sprites on and/or off midframe?

(With rendering remaining on)

Would you get a section of screen where sprites disappear into (like an upward doorway).

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Tue Dec 15, 2015 4:00 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10066
Location: Rio de Janeiro - Brazil
Disabling one or the other (sprites or background) simply hides that layer's pixels, without affecting data fetching or sprite evaluation in any way, so it's perfectly safe to do at any time.

If you disable sprites only, all sprites will disappear until you turn them back on. Using this for doorways would be overkill though, since masking with transparent high priority sprites is generally simpler than timing raster effects, specially if you don't have an scanline counter at your disposal.

Disabling sprites is a good way to keep sprites from overlapping status bars, though.


Top
 Profile  
 
PostPosted: Tue Dec 15, 2015 4:12 pm 
Offline

Joined: Tue Dec 15, 2015 3:50 am
Posts: 10
Dwedit, thank you.

Quote:
up to 16 stale background pixels

This depends on the fine X, right?

So, with rendering off, the PPU just "skips everything" (i. e. the shifts, tile loads are not performed)? Then, does the offset of the fetch pattern change when rendering is back on (do the four fetches begin occuring on m+8n cycles instead of 1+8n from then on)? Or is the fetch pattern unchanged?


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

All times are UTC - 7 hours


Who is online

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