MCPcopy Index your code
hub / github.com/fogleman/nes / Write

Method Write

nes/mapper4.go:101–114  ·  view source on GitHub ↗
(address uint16, value byte)

Source from the content-addressed store, hash-verified

99}
100
101func (m *Mapper4) Write(address uint16, value byte) {
102 switch {
103 case address < 0x2000:
104 bank := address / 0x0400
105 offset := address % 0x0400
106 m.CHR[m.chrOffsets[bank]+int(offset)] = value
107 case address >= 0x8000:
108 m.writeRegister(address, value)
109 case address >= 0x6000:
110 m.SRAM[int(address)-0x6000] = value
111 default:
112 log.Fatalf("unhandled mapper4 write at address: 0x%04X", address)
113 }
114}
115
116func (m *Mapper4) writeRegister(address uint16, value byte) {
117 switch {

Callers

nothing calls this directly

Calls 1

writeRegisterMethod · 0.95

Tested by

no test coverage detected