$2002: PPUSTATUS
()
| 267 | |
| 268 | // $2002: PPUSTATUS |
| 269 | func (ppu *PPU) readStatus() byte { |
| 270 | result := ppu.register & 0x1F |
| 271 | result |= ppu.flagSpriteOverflow << 5 |
| 272 | result |= ppu.flagSpriteZeroHit << 6 |
| 273 | if ppu.nmiOccurred { |
| 274 | result |= 1 << 7 |
| 275 | } |
| 276 | ppu.nmiOccurred = false |
| 277 | ppu.nmiChange() |
| 278 | // w: = 0 |
| 279 | ppu.w = 0 |
| 280 | return result |
| 281 | } |
| 282 | |
| 283 | // $2003: OAMADDR |
| 284 | func (ppu *PPU) writeOAMAddress(value byte) { |