21 #ifndef EXTRASIDBANK_H
22 #define EXTRASIDBANK_H
25 #include "sidplayfp/c64/c64sid.h"
39 static const int MAPPER_SIZE = 8;
47 Bank *mapper[MAPPER_SIZE];
52 static unsigned int mapperIndex(
int address) {
return address >> 5 & (MAPPER_SIZE - 1); }
64 void resetSIDMapper(
Bank *bank)
66 for (
int i = 0; i < MAPPER_SIZE; i++)
77 mapper[mapperIndex(address)] = sid;
80 uint8_t
peek(uint_least16_t addr)
82 return mapper[mapperIndex(addr)]->
peek(addr);
85 void poke(uint_least16_t addr, uint8_t data)
87 mapper[mapperIndex(addr)]->
poke(addr, data);