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

Method writeDMA

nes/ppu.go:370–382  ·  view source on GitHub ↗

$4014: OAMDMA

(value byte)

Source from the content-addressed store, hash-verified

368
369// $4014: OAMDMA
370func (ppu *PPU) writeDMA(value byte) {
371 cpu := ppu.console.CPU
372 address := uint16(value) << 8
373 for i := 0; i < 256; i++ {
374 ppu.oamData[ppu.oamAddress] = cpu.Read(address)
375 ppu.oamAddress++
376 address++
377 }
378 cpu.stall += 513
379 if cpu.Cycles%2 == 1 {
380 cpu.stall++
381 }
382}
383
384// NTSC Timing Helper Functions
385

Callers 1

writeRegisterMethod · 0.95

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected