(address uint16)
| 41 | } |
| 42 | |
| 43 | func (m *Mapper40) Read(address uint16) byte { |
| 44 | switch { |
| 45 | case address < 0x2000: |
| 46 | return m.CHR[address] |
| 47 | case address >= 0x6000 && address < 0x8000: |
| 48 | return m.PRG[address-0x6000+0x2000*6] |
| 49 | case address >= 0x8000 && address < 0xa000: |
| 50 | return m.PRG[address-0x8000+0x2000*4] |
| 51 | case address >= 0xa000 && address < 0xc000: |
| 52 | return m.PRG[address-0xa000+0x2000*5] |
| 53 | case address >= 0xc000 && address < 0xe000: |
| 54 | return m.PRG[address-0xc000+0x2000*uint16(m.bank)] |
| 55 | case address >= 0xe000: |
| 56 | return m.PRG[address-0xe000+0x2000*7] |
| 57 | default: |
| 58 | log.Fatalf("unhandled mapper40 read at address: 0x%04X", address) |
| 59 | } |
| 60 | return 0 |
| 61 | } |
| 62 | |
| 63 | func (m *Mapper40) Write(address uint16, value byte) { |
| 64 | switch { |
nothing calls this directly
no outgoing calls
no test coverage detected