MCPcopy
hub / github.com/fogleman/nes / readStatus

Method readStatus

nes/ppu.go:269–281  ·  view source on GitHub ↗

$2002: PPUSTATUS

()

Source from the content-addressed store, hash-verified

267
268// $2002: PPUSTATUS
269func (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
284func (ppu *PPU) writeOAMAddress(value byte) {

Callers 1

readRegisterMethod · 0.95

Calls 1

nmiChangeMethod · 0.95

Tested by

no test coverage detected