Things in PPU that can change outside VBlank
-
mkwong98
- Posts: 319
- Joined: Mon May 30, 2011 9:01 pm
Things in PPU that can change outside VBlank
From what I've read, scrolling can be modified anytime, pattern table and name table(including attribute table?) can be modified during VBlank or when PPU is disabled. What about other memory addresses and registers? Thanks.
-
qbradq
- Posts: 972
- Joined: Wed Oct 15, 2008 11:50 am
You are over-simplifying things. Now I am no PPU expert so I won't go into specifics. You'll have to research that on your own.
The PPU has at least one address register that I know of that it uses while rendering the background. This address register is a combination of the name table selection bits and the scrolling bits.
The reason that writing to the PPU address space during rendering screws things up is that read / write access through $2006 / $2007 uses (parts of) the address register mentioned above.
It's really a threading issue at the hardware level. Kinda cool
Anyway, you should probably start out reading the PPU Reference on the Wiki, followed by The Skinny on NES Scrolling by loopy.
The PPU has at least one address register that I know of that it uses while rendering the background. This address register is a combination of the name table selection bits and the scrolling bits.
The reason that writing to the PPU address space during rendering screws things up is that read / write access through $2006 / $2007 uses (parts of) the address register mentioned above.
It's really a threading issue at the hardware level. Kinda cool
Anyway, you should probably start out reading the PPU Reference on the Wiki, followed by The Skinny on NES Scrolling by loopy.
-
mkwong98
- Posts: 319
- Joined: Mon May 30, 2011 9:01 pm
-
tokumaru
- Posts: 12673
- Joined: Sat Feb 12, 2005 9:43 pm
- Location: Rio de Janeiro - Brazil
Basically, you can do anything except memory accesses. Here's a list of registers that can be changed during rendering time:
$2000: YES;
$2001: YES;
$2003: NO;
$2004: NO;
$2005: YES;
$2006: YES, only for scrolling;
$2007: NO;
Whatever can be controlled by these registers can be changed during rendering. The only exception I can think of is the vertical scroll, that won't take effect until the next frame unless you use combined $2005/$2006 writes (a trick discovered by loopy a few years ago).
Anything that needs memory accesses (i.e. $2006 & $2007), like pattern tables, name tables, attribute tables and palettes can't be changed while rendering. Accesses to OAM (sprites) also screw things up.
$2000: YES;
$2001: YES;
$2003: NO;
$2004: NO;
$2005: YES;
$2006: YES, only for scrolling;
$2007: NO;
Whatever can be controlled by these registers can be changed during rendering. The only exception I can think of is the vertical scroll, that won't take effect until the next frame unless you use combined $2005/$2006 writes (a trick discovered by loopy a few years ago).
Anything that needs memory accesses (i.e. $2006 & $2007), like pattern tables, name tables, attribute tables and palettes can't be changed while rendering. Accesses to OAM (sprites) also screw things up.
-
mkwong98
- Posts: 319
- Joined: Mon May 30, 2011 9:01 pm
-
3gengames
- Formerly 65024U
- Posts: 2284
- Joined: Sat Mar 27, 2010 12:57 pm
-
tokumaru
- Posts: 12673
- Joined: Sat Feb 12, 2005 9:43 pm
- Location: Rio de Janeiro - Brazil
Yes, but you'll get no picture until it's enabled again. =)mkwong98 wrote:So does it mean I can do anything outside VBlank as long as I disable the PPU?
I believe part of the HBlank is spent on tasks related to rendering, such as fetching the sprite patterns for the next scanline and such. There may be a small window for memory accesses, but it's so little time you can't really do anything useful with it.And what about HBlank? Does it count as rendering?