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