From 99cae5a5a37f41f878a84857361eda47910303ba Mon Sep 17 00:00:00 2001 From: crecher Date: Tue, 13 Oct 2026 01:13:13 +0200 Subject: sprites!!!!!! --- nes/nes.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'nes/nes.go') diff --git a/nes/nes.go b/nes/nes.go index 79580b6..5d96e8f 100644 --- a/nes/nes.go +++ b/nes/nes.go @@ -11,7 +11,10 @@ type Console struct { PPU *ppu.PPU Cart *cart.Cartridge RAM [0x800]uint8 - // APU, controllers once they exist + + controllers [2]controller + dmaPending bool + // APU once it exists cycles uint64 } @@ -25,6 +28,12 @@ func New(c *cart.Cartridge) *Console { func (n *Console) Step() int { cycles := n.CPU.Step() + if n.dmaPending { + n.dmaPending = false + stall := n.dmaStallCycles() + n.CPU.Stall(stall) + cycles += stall + } n.cycles += uint64(cycles) for i := 0; i < cycles*3; i++ { n.PPU.Tick() -- cgit v1.2.3