2010-08-09 13:28:56 +00:00
|
|
|
#ifdef SUPERFX_CPP
|
|
|
|
|
|
|
|
//ROM / RAM access from the S-CPU
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::CPUROM::size() const -> unsigned {
|
2012-07-09 11:40:23 +00:00
|
|
|
return superfx.rom.size();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::CPUROM::read(unsigned addr) -> uint8 {
|
2010-08-09 13:28:56 +00:00
|
|
|
if(superfx.regs.sfr.g && superfx.regs.scmr.ron) {
|
|
|
|
static const uint8_t data[16] = {
|
|
|
|
0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01,
|
|
|
|
0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01,
|
|
|
|
};
|
|
|
|
return data[addr & 15];
|
|
|
|
}
|
2012-07-09 11:40:23 +00:00
|
|
|
return superfx.rom.read(addr);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::CPUROM::write(unsigned 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-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::CPURAM::size() const -> unsigned {
|
2012-07-09 11:40:23 +00:00
|
|
|
return superfx.ram.size();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::CPURAM::read(unsigned addr) -> uint8 {
|
2010-08-09 13:28:56 +00:00
|
|
|
if(superfx.regs.sfr.g && superfx.regs.scmr.ran) return cpu.regs.mdr;
|
2012-07-09 11:40:23 +00:00
|
|
|
return superfx.ram.read(addr);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::CPURAM::write(unsigned 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
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|