Page 1 of 1

Turning rendering on/off midframe effects on picture

Posted: Tue Dec 15, 2015 12:52 pm
by provably
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.)

Re: Turning rendering on/off midframe effects on picture

Posted: Tue Dec 15, 2015 1:23 pm
by rainwarrior
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.)

Re: Turning rendering on/off midframe effects on picture

Posted: Tue Dec 15, 2015 1:46 pm
by provably
Thank you for the reply.

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

Re: Turning rendering on/off midframe effects on picture

Posted: Tue Dec 15, 2015 2:55 pm
by Dwedit
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.

Re: Turning rendering on/off midframe effects on picture

Posted: Tue Dec 15, 2015 3:48 pm
by dougeff
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).

Re: Turning rendering on/off midframe effects on picture

Posted: Tue Dec 15, 2015 4:00 pm
by tokumaru
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.

Re: Turning rendering on/off midframe effects on picture

Posted: Tue Dec 15, 2015 4:12 pm
by provably
Dwedit, thank you.
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?