2011-11-04 11:57:54 +00:00
|
|
|
struct KonamiVRC1 : Board {
|
2015-12-05 05:44:49 +00:00
|
|
|
KonamiVRC1(Markup::Node& document) : Board(document), vrc1(*this) {
|
|
|
|
}
|
|
|
|
|
2016-06-27 13:07:57 +00:00
|
|
|
auto readPRG(uint addr) -> uint8 {
|
|
|
|
if(addr & 0x8000) return prgrom.read(vrc1.addrPRG(addr));
|
2015-12-05 05:44:49 +00:00
|
|
|
return cpu.mdr();
|
|
|
|
}
|
|
|
|
|
2016-06-27 13:07:57 +00:00
|
|
|
auto writePRG(uint addr, uint8 data) -> void {
|
|
|
|
if(addr & 0x8000) return vrc1.writeIO(addr, data);
|
2015-12-05 05:44:49 +00:00
|
|
|
}
|
|
|
|
|
2016-06-27 13:07:57 +00:00
|
|
|
auto readCHR(uint addr) -> uint8 {
|
|
|
|
if(addr & 0x2000) return ppu.readCIRAM(vrc1.addrCIRAM(addr));
|
|
|
|
return Board::readCHR(vrc1.addrCHR(addr));
|
2015-12-05 05:44:49 +00:00
|
|
|
}
|
|
|
|
|
2016-06-27 13:07:57 +00:00
|
|
|
auto writeCHR(uint addr, uint8 data) -> void {
|
|
|
|
if(addr & 0x2000) return ppu.writeCIRAM(vrc1.addrCIRAM(addr), data);
|
|
|
|
return Board::writeCHR(vrc1.addrCHR(addr), data);
|
2015-12-05 05:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto power() -> void {
|
|
|
|
vrc1.power();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto reset() -> void {
|
|
|
|
vrc1.reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto serialize(serializer& s) -> void {
|
|
|
|
Board::serialize(s);
|
|
|
|
vrc1.serialize(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
VRC1 vrc1;
|
2011-11-04 11:57:54 +00:00
|
|
|
};
|