nesdev.com
http://forums.nesdev.com/

turning rendering off?
http://forums.nesdev.com/viewtopic.php?f=2&t=15824
Page 1 of 1

Author:  gauauu [ Tue Apr 18, 2017 9:33 am ]
Post subject:  turning rendering off?

I just wanted to get some definite clarification about when people talk about turning off rendering (or what seems a worse description, "turning the PPU off")

Is my understand correct here?

Turning off the background and sprite rendering bits in $2001 just prevents those things from being drawn, but the PPU is still active, and is still pushing (blank) frames to the TV at the same framerate? So the TV frames are still being "drawn" normally (at whatever approx 60fps), with hblanks, vblanks, etc still happening but always just blank rendering? And so the the reason that it's "safe" to push a lot of data to the PPU at that point is that, without BG rendering, you don't get the weird address/scroll conflicts on the bus? (as well as not having to worry about half-finished frames rendering) So then it follows that the only timing that you'd care about working around is turning it back on (or off) during vblank to avoid a single messed up frame?

(and so it's not like you can do weird tricks or problems with non-standard framerates by turning off/on the rendering in weird ways, right? (in contrast to the Atari where you can futz with weird framerates by delaying vblank))

Thanks!

Edit: I guess this maybe should have been in newbie help center instead. Feel free to move it.

Author:  tepples [ Tue Apr 18, 2017 9:51 am ]
Post subject:  Re: turning rendering off?

gauauu wrote:
Turning off the background and sprite rendering bits in $2001 just prevents those things from being drawn, but the PPU is still active, and is still pushing (blank) frames to the TV

Correct. While rendering is off, the PPU displays the backdrop color over the whole picture. This is normally the color at $3F00 unless the current video memory address is $3F00-$3FFF, in which case it pushes that pixel instead.

gauauu wrote:
at the same framerate?

Yes.[1]

gauauu wrote:
And so the the reason that it's "safe" to push a lot of data to the PPU at that point is that, without BG rendering, you don't get the weird address/scroll conflicts on the bus? (as well as not having to worry about half-finished frames rendering) So then it follows that the only timing that you'd care about working around is turning it back on (or off) during vblank to avoid a single messed up frame?

That and you can transfer more data between pictures if you carefully turn rendering off early or turn it on late. But you have to enable or disable rendering at the far right side of active picture (preferably x=224-255) to keep the OAM scanning state machine from getting confused and corrupting DRAM.


[1] Pedant's corner: The 2C02's field rate during forced blanking is 60.0985 Hz, which is a few parts per million slower than its rendering field rate of 60.0988 Hz. When rendering is on, the dot between pre-render and the first picture line is skipped every other field, but it's not skipped during forced blanking.

Author:  tokumaru [ Tue Apr 18, 2017 9:56 am ]
Post subject:  Re: turning rendering off?

gauauu wrote:
Turning off the background and sprite rendering bits in $2001 just prevents those things from being drawn, but the PPU is still active, and is still pushing (blank) frames to the TV at the same framerate? So the TV frames are still being "drawn" normally (at whatever approx 60fps), with hblanks, vblanks, etc still happening but always just blank rendering?

Yes, the PPU always outputs a valid video signal, containing either color 0 or whatever color in palette RAM the PPU address register ("$2006") is pointing to. The PPU doesn't drive the address register and doesn't read from VRAM, so you can safely use $2006/$2007 when rendering is disabled. NMIs still happen normally.

This is the case when both the background and sprites are disabled. If only one of them is, the PPU will do everything it'd normally do, all VRAM fetches will still occur, but the pixels of the disabled layer simply won't show up.

Quote:
So then it follows that the only timing that you'd care about working around is turning it back on (or off) during vblank to avoid a single messed up frame?

Yes, that'd be a good idea.

Quote:
(and so it's not like you can do weird tricks or problems with non-standard framerates by turning off/on the rendering in weird ways, right? (in contrast to the Atari where you can futz with weird framerates by delaying vblank))

Correct. The only thing you can change about the video signal is the length of the pre-render scanline. When rendering is on, this scanline alternates between 340 and 341 PPU cycles, but when rendering is off it's always 341 cycles long.

Author:  gauauu [ Tue Apr 18, 2017 11:09 am ]
Post subject:  Re: turning rendering off?

Thanks guys!

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/