| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#include "RomZemina126in1.hh" |
| 8 |
#include "CacheLine.hh" |
| 9 |
#include "serialize.hh" |
| 10 |
|
| 11 |
namespace openmsx { |
| 12 |
|
| 13 |
RomZemina126in1::RomZemina126in1( |
| 14 |
const DeviceConfig& config, Rom&& rom_) |
| 15 |
: Rom16kBBlocks(config, std::move(rom_)) |
| 16 |
{ |
| 17 |
reset(EmuTime::dummy()); |
| 18 |
} |
| 19 |
|
| 20 |
void RomZemina126in1::reset(EmuTime ) |
| 21 |
{ |
| 22 |
setUnmapped(0); |
| 23 |
setRom(1, 0); |
| 24 |
setRom(2, 1); |
| 25 |
setUnmapped(3); |
| 26 |
} |
| 27 |
|
| 28 |
void RomZemina126in1::writeMem(uint16_t address, byte value, EmuTime ) |
| 29 |
{ |
| 30 |
if (address == 0x4000) { |
| 31 |
setRom(1, value); |
| 32 |
} else if (address == 0x4001) { |
| 33 |
setRom(2, value); |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
byte* RomZemina126in1::getWriteCacheLine(uint16_t address) |
| 38 |
{ |
| 39 |
if (address == (0x4000 & CacheLine::HIGH)) { |
| 40 |
return nullptr; |
| 41 |
} else { |
| 42 |
return unmappedWrite.data(); |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
REGISTER_MSXDEVICE(RomZemina126in1, "RomZemina126in1"); |
| 47 |
|
| 48 |
} |