diff options
| author | crecher <crecher@crecher.net> | 2026-10-13 01:13:13 +0200 |
|---|---|---|
| committer | crecher <crecher@crecher.net> | 2026-10-13 01:13:13 +0200 |
| commit | 99cae5a5a37f41f878a84857361eda47910303ba (patch) | |
| tree | 31c8665ca991f95e09e93bb2e6ec91d81d2427ff /nes/nes.go | |
| parent | 96ff6d8eda2ba434682909f4ff4ce350d78b2273 (diff) | |
| download | gones-99cae5a5a37f41f878a84857361eda47910303ba.tar.gz gones-99cae5a5a37f41f878a84857361eda47910303ba.zip | |
sprites!!!!!!
Diffstat (limited to 'nes/nes.go')
| -rw-r--r-- | nes/nes.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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() |