From 0be10a289132f7ed9b42d5949db844227075e7ce Mon Sep 17 00:00:00 2001 From: crecher Date: Mon, 12 Oct 2026 16:30:32 +0200 Subject: ITS ALIVE (not rly no image yet) --- nes/bus.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nes/bus.go') diff --git a/nes/bus.go b/nes/bus.go index eeb96b0..af4f242 100644 --- a/nes/bus.go +++ b/nes/bus.go @@ -22,6 +22,8 @@ func (n *Console) Read(addr uint16) uint8 { switch { case addr < 0x2000: // internal RAM and mirrors return n.RAM[addr&0x7FF] + case addr < 0x4000: // PPU registers, mirrored every 8 bytes + return n.PPU.ReadRegister(addr) case addr >= 0x4020: // cartridge return n.Cart.Mapper.CPURead(addr) default: @@ -33,6 +35,8 @@ func (n *Console) Write(addr uint16, v uint8) { switch { case addr < 0x2000: n.RAM[addr&0x7FF] = v + case addr < 0x4000: + n.PPU.WriteRegister(addr, v) case addr >= 0x4020: n.Cart.Mapper.CPUWrite(addr, v) } -- cgit v1.2.3