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

Method Write

nes/mapper7.go:46–64  ·  view source on GitHub ↗
(address uint16, value byte)

Source from the content-addressed store, hash-verified

44}
45
46func (m *Mapper7) Write(address uint16, value byte) {
47 switch {
48 case address < 0x2000:
49 m.CHR[address] = value
50 case address >= 0x8000:
51 m.prgBank = int(value & 7)
52 switch value & 0x10 {
53 case 0x00:
54 m.Cartridge.Mirror = MirrorSingle0
55 case 0x10:
56 m.Cartridge.Mirror = MirrorSingle1
57 }
58 case address >= 0x6000:
59 index := int(address) - 0x6000
60 m.SRAM[index] = value
61 default:
62 log.Fatalf("unhandled mapper7 write at address: 0x%04X", address)
63 }
64}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected