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

Method Read

nes/mapper7.go:30–44  ·  view source on GitHub ↗
(address uint16)

Source from the content-addressed store, hash-verified

28}
29
30func (m *Mapper7) Read(address uint16) byte {
31 switch {
32 case address < 0x2000:
33 return m.CHR[address]
34 case address >= 0x8000:
35 index := m.prgBank*0x8000 + int(address-0x8000)
36 return m.PRG[index]
37 case address >= 0x6000:
38 index := int(address) - 0x6000
39 return m.SRAM[index]
40 default:
41 log.Fatalf("unhandled mapper7 read at address: 0x%04X", address)
42 }
43 return 0
44}
45
46func (m *Mapper7) Write(address uint16, value byte) {
47 switch {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected