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