MCPcopy
hub / github.com/fogleman/nes / prgBankOffset

Method prgBankOffset

nes/mapper4.go:177–187  ·  view source on GitHub ↗
(index int)

Source from the content-addressed store, hash-verified

175}
176
177func (m *Mapper4) prgBankOffset(index int) int {
178 if index >= 0x80 {
179 index -= 0x100
180 }
181 index %= len(m.PRG) / 0x2000
182 offset := index * 0x2000
183 if offset < 0 {
184 offset += len(m.PRG)
185 }
186 return offset
187}
188
189func (m *Mapper4) chrBankOffset(index int) int {
190 if index >= 0x80 {

Callers 2

NewMapper4Function · 0.95
updateOffsetsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected