21 #ifndef EXTRASIDBANK_H 22 #define EXTRASIDBANK_H 25 #include "c64/c64sid.h" 36 typedef std::vector<c64sid*> sids_t;
41 void operator() (sids_t::value_type &e) { e->reset(0xf); }
49 static const int MAPPER_SIZE = 8;
57 Bank *mapper[MAPPER_SIZE];
62 static unsigned int mapperIndex(
int address) {
return address >> 5 & (MAPPER_SIZE - 1); }
69 std::for_each(sids.begin(), sids.end(), resetSID());
72 void resetSIDMapper(
Bank *bank)
74 for (
int i = 0; i < MAPPER_SIZE; i++)
78 uint8_t
peek(uint_least16_t addr)
80 return mapper[mapperIndex(addr)]->
peek(addr);
83 void poke(uint_least16_t addr, uint8_t data)
85 mapper[mapperIndex(addr)]->
poke(addr, data);
97 mapper[mapperIndex(address)] = s;
virtual uint8_t peek(uint_least16_t address)=0
virtual void poke(uint_least16_t address, uint8_t value)=0