2010-08-09 13:28:56 +00:00
|
|
|
//ROM / RAM access from the S-CPU
|
|
|
|
|
2015-12-14 09:41:06 +00:00
|
|
|
auto SuperFX::CPUROM::size() const -> uint {
|
2012-07-09 11:40:23 +00:00
|
|
|
return superfx.rom.size();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-12-14 09:41:06 +00:00
|
|
|
auto SuperFX::CPUROM::read(uint addr, uint8 data) -> uint8 {
|
2010-08-09 13:28:56 +00:00
|
|
|
if(superfx.regs.sfr.g && superfx.regs.scmr.ron) {
|
2015-12-14 09:41:06 +00:00
|
|
|
static const uint8 vector[16] = {
|
2010-08-09 13:28:56 +00:00
|
|
|
0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01,
|
|
|
|
0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01,
|
|
|
|
};
|
2015-12-14 09:41:06 +00:00
|
|
|
return vector[addr & 15];
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
2015-12-14 09:41:06 +00:00
|
|
|
return superfx.rom.read(addr, data);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-12-14 09:41:06 +00:00
|
|
|
auto SuperFX::CPUROM::write(uint addr, uint8 data) -> void {
|
2012-07-09 11:40:23 +00:00
|
|
|
superfx.rom.write(addr, data);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-12-14 09:41:06 +00:00
|
|
|
auto SuperFX::CPURAM::size() const -> uint {
|
2012-07-09 11:40:23 +00:00
|
|
|
return superfx.ram.size();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-12-14 09:41:06 +00:00
|
|
|
auto SuperFX::CPURAM::read(uint addr, uint8 data) -> uint8 {
|
|
|
|
if(superfx.regs.sfr.g && superfx.regs.scmr.ran) return data;
|
|
|
|
return superfx.ram.read(addr, data);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-12-14 09:41:06 +00:00
|
|
|
auto SuperFX::CPURAM::write(uint addr, uint8 data) -> void {
|
2012-07-09 11:40:23 +00:00
|
|
|
superfx.ram.write(addr, data);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|