21 #ifndef EXTRASIDBANK_H
22 #define EXTRASIDBANK_H
28 #include "c64/c64sid.h"
32 namespace libsidplayfp
41 typedef std::vector<c64sid*> sids_t;
48 static const int MAPPER_SIZE = 8;
56 Bank *mapper[MAPPER_SIZE];
61 static void resetSID(sids_t::value_type &e) { e->reset(0xf); }
63 static unsigned int mapperIndex(
int address) {
return address >> 5 & (MAPPER_SIZE - 1); }
70 std::for_each(sids.begin(), sids.end(), resetSID);
73 void resetSIDMapper(
Bank *bank)
75 for (
int i = 0; i < MAPPER_SIZE; i++)
79 uint8_t
peek(uint_least16_t addr)
override
81 return mapper[mapperIndex(addr)]->
peek(addr);
84 void poke(uint_least16_t addr, uint8_t data)
override
86 mapper[mapperIndex(addr)]->
poke(addr, data);
98 mapper[mapperIndex(address)] = s;