(address uint16, value byte)
| 99 | } |
| 100 | |
| 101 | func (m *Mapper4) Write(address uint16, value byte) { |
| 102 | switch { |
| 103 | case address < 0x2000: |
| 104 | bank := address / 0x0400 |
| 105 | offset := address % 0x0400 |
| 106 | m.CHR[m.chrOffsets[bank]+int(offset)] = value |
| 107 | case address >= 0x8000: |
| 108 | m.writeRegister(address, value) |
| 109 | case address >= 0x6000: |
| 110 | m.SRAM[int(address)-0x6000] = value |
| 111 | default: |
| 112 | log.Fatalf("unhandled mapper4 write at address: 0x%04X", address) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func (m *Mapper4) writeRegister(address uint16, value byte) { |
| 117 | switch { |
nothing calls this directly
no test coverage detected