package nes // im too lazy to write an explanation so heres the nesdev page // https://www.nesdev.org/wiki/DMA#OAM_DMA func (n *Console) oamDMA(page uint8) { base := uint16(page) << 8 for i := uint16(0); i < 256; i++ { n.PPU.WriteRegister(0x2004, n.Read(base+i)) } n.dmaPending = true } func (n *Console) dmaStallCycles() int { stall := 513 if n.CPU.Cycles&1 == 1 { stall++ } return stall }