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

Method readData

nes/ppu.go:340–357  ·  view source on GitHub ↗

$2007: PPUDATA (read)

()

Source from the content-addressed store, hash-verified

338
339// $2007: PPUDATA (read)
340func (ppu *PPU) readData() byte {
341 value := ppu.Read(ppu.v)
342 // emulate buffered reads
343 if ppu.v%0x4000 < 0x3F00 {
344 buffered := ppu.bufferedData
345 ppu.bufferedData = value
346 value = buffered
347 } else {
348 ppu.bufferedData = ppu.Read(ppu.v - 0x1000)
349 }
350 // increment address
351 if ppu.flagIncrement == 0 {
352 ppu.v += 1
353 } else {
354 ppu.v += 32
355 }
356 return value
357}
358
359// $2007: PPUDATA (write)
360func (ppu *PPU) writeData(value byte) {

Callers 1

readRegisterMethod · 0.95

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected