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

Method Read

nes/mapper225.go:40–58  ·  view source on GitHub ↗
(address uint16)

Source from the content-addressed store, hash-verified

38}
39
40func (m *Mapper225) Read(address uint16) byte {
41 switch {
42 case address < 0x2000:
43 index := m.chrBank*0x2000 + int(address)
44 return m.CHR[index]
45 case address >= 0xC000:
46 index := m.prgBank2*0x4000 + int(address-0xC000)
47 return m.PRG[index]
48 case address >= 0x8000:
49 index := m.prgBank1*0x4000 + int(address-0x8000)
50 return m.PRG[index]
51 case address >= 0x6000:
52 index := int(address) - 0x6000
53 return m.SRAM[index]
54 default:
55 log.Fatalf("unhandled Mapper225 read at address: 0x%04X", address)
56 }
57 return 0
58}
59
60func (m *Mapper225) Write(address uint16, value byte) {
61 if (address < 0x8000) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected