(address uint16, value byte)
| 75 | } |
| 76 | |
| 77 | func (m *Mapper1) Write(address uint16, value byte) { |
| 78 | switch { |
| 79 | case address < 0x2000: |
| 80 | bank := address / 0x1000 |
| 81 | offset := address % 0x1000 |
| 82 | m.CHR[m.chrOffsets[bank]+int(offset)] = value |
| 83 | case address >= 0x8000: |
| 84 | m.loadRegister(address, value) |
| 85 | case address >= 0x6000: |
| 86 | m.SRAM[int(address)-0x6000] = value |
| 87 | default: |
| 88 | log.Fatalf("unhandled mapper1 write at address: 0x%04X", address) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func (m *Mapper1) loadRegister(address uint16, value byte) { |
| 93 | if value&0x80 == 0x80 { |
nothing calls this directly
no test coverage detected