MCPcopy Create free account
hub / github.com/fogleman/nes / Write

Method Write

nes/mapper3.go:57–70  ·  view source on GitHub ↗
(address uint16, value byte)

Source from the content-addressed store, hash-verified

55}
56
57func (m *Mapper3) Write(address uint16, value byte) {
58 switch {
59 case address < 0x2000:
60 index := m.chrBank*0x2000 + int(address)
61 m.CHR[index] = value
62 case address >= 0x8000:
63 m.chrBank = int(value & 3)
64 case address >= 0x6000:
65 index := int(address) - 0x6000
66 m.SRAM[index] = value
67 default:
68 log.Fatalf("unhandled mapper3 write at address: 0x%04X", address)
69 }
70}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected