2017-07-26 12:42:06 +00:00
|
|
|
auto Cartridge::MBC0::read(uint16 address) -> uint8 {
|
|
|
|
if((address & 0x8000) == 0x0000) { //$0000-7fff
|
|
|
|
return cartridge.rom.read(address.bits(0,14));
|
2011-01-04 10:42:27 +00:00
|
|
|
}
|
|
|
|
|
2017-07-26 12:42:06 +00:00
|
|
|
if((address & 0xe000) == 0xa000) { //$a000-bfff
|
|
|
|
return cartridge.ram.read(address.bits(0,12));
|
2011-01-04 10:42:27 +00:00
|
|
|
}
|
|
|
|
|
2016-01-08 09:23:46 +00:00
|
|
|
return 0xff;
|
2011-01-02 04:46:54 +00:00
|
|
|
}
|
|
|
|
|
2017-07-26 12:42:06 +00:00
|
|
|
auto Cartridge::MBC0::write(uint16 address, uint8 data) -> void {
|
|
|
|
if((address & 0xe000) == 0xa000) { //$a000-bfff
|
|
|
|
cartridge.ram.write(address.bits(0,12), data);
|
2011-01-04 10:42:27 +00:00
|
|
|
return;
|
|
|
|
}
|
2011-01-02 04:46:54 +00:00
|
|
|
}
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto Cartridge::MBC0::power() -> void {
|
2011-01-02 04:46:54 +00:00
|
|
|
}
|
2017-07-26 12:42:06 +00:00
|
|
|
|
|
|
|
auto Cartridge::MBC0::serialize(serializer& s) -> void {
|
|
|
|
}
|