I'm in the middle of my PPU development, and I would like to clear up a few things about the PPUSTATUS register. Most of the sources of information that I have checked so far more or less agree with what is said in the wiki:
However, the Nestech document provides this information:
So here are the things I would like cleared up for me:
1. How many bits are written to PPUSTATUS as a result of data being written into a PPU register - 4 bits or 5 bits?
2. Is bit 4 actually a VRAM write flag?
3. Is bit 7 cleared after a read from PPUSTATUS, or a read from any PPU register?
4. Similarly, are PPUSCROLL and PPUADDR cleared after a read from PPUSTATUS, or a read from any PPU register?
Like I said, the Nestech document seems to have different information than most of my sources on this register, so I would like to know how accurate this information is. Any help would be appreciated!
Code:
76543210
||||||||
|||+++++- Least significant bits previously written into a PPU register
||| (due to register not being updated for this address)
||+------ Sprite overflow. The PPU can handle only eight sprites on one
|| scanline and sets this bit if it starts dropping sprites.
|| Normally, this triggers when there are 9 sprites on a scanline,
|| but the actual behavior is significantly more complicated.
|+------- Sprite 0 Hit. Set when a nonzero pixel of sprite 0 'hits'
| a nonzero background pixel. Used for raster timing.
+-------- Vertical blank has started (0: not in VBLANK; 1: in VBLANK)
||||||||
|||+++++- Least significant bits previously written into a PPU register
||| (due to register not being updated for this address)
||+------ Sprite overflow. The PPU can handle only eight sprites on one
|| scanline and sets this bit if it starts dropping sprites.
|| Normally, this triggers when there are 9 sprites on a scanline,
|| but the actual behavior is significantly more complicated.
|+------- Sprite 0 Hit. Set when a nonzero pixel of sprite 0 'hits'
| a nonzero background pixel. Used for raster timing.
+-------- Vertical blank has started (0: not in VBLANK; 1: in VBLANK)
However, the Nestech document provides this information:
Code:
+---------+----------------------------------------------------------+
| $2002 | PPU Status Register (R) |
| | |
| | D7: VBlank Occurance |
| | 0 = Not occuring |
| | 1 = In VBlank |
| | D6: Sprite #0 Occurance |
| | 0 = Sprite #0 not found |
| | 1 = PPU has hit Sprite #0 |
| | D5: Scanline Sprite Count |
| | 0 = Eight (8) sprites or less on current scan- |
| | line |
| | 1 = More than 8 sprites on current scanline |
| | D4: VRAM Write Flag |
| | 0 = Writes to VRAM are respected |
| | 1 = Writes to VRAM are ignored |
| | |
| | NOTE: D7 is set to 0 after read occurs. |
| | NOTE: After a read occurs, $2005 is reset, hence the |
| | next write to $2005 will be Horizontal. |
| | NOTE: After a read occurs, $2006 is reset, hence the |
| | next write to $2006 will be the high byte portion. |
+---------+----------------------------------------------------------+
| $2002 | PPU Status Register (R) |
| | |
| | D7: VBlank Occurance |
| | 0 = Not occuring |
| | 1 = In VBlank |
| | D6: Sprite #0 Occurance |
| | 0 = Sprite #0 not found |
| | 1 = PPU has hit Sprite #0 |
| | D5: Scanline Sprite Count |
| | 0 = Eight (8) sprites or less on current scan- |
| | line |
| | 1 = More than 8 sprites on current scanline |
| | D4: VRAM Write Flag |
| | 0 = Writes to VRAM are respected |
| | 1 = Writes to VRAM are ignored |
| | |
| | NOTE: D7 is set to 0 after read occurs. |
| | NOTE: After a read occurs, $2005 is reset, hence the |
| | next write to $2005 will be Horizontal. |
| | NOTE: After a read occurs, $2006 is reset, hence the |
| | next write to $2006 will be the high byte portion. |
+---------+----------------------------------------------------------+
So here are the things I would like cleared up for me:
1. How many bits are written to PPUSTATUS as a result of data being written into a PPU register - 4 bits or 5 bits?
2. Is bit 4 actually a VRAM write flag?
3. Is bit 7 cleared after a read from PPUSTATUS, or a read from any PPU register?
4. Similarly, are PPUSCROLL and PPUADDR cleared after a read from PPUSTATUS, or a read from any PPU register?
Like I said, the Nestech document seems to have different information than most of my sources on this register, so I would like to know how accurate this information is. Any help would be appreciated!