| 1 |
#include "RomWonderKid.hh" |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
namespace openmsx { |
| 29 |
|
| 30 |
RomWonderKid::RomWonderKid(const DeviceConfig& config, Rom&& rom_) |
| 31 |
: Rom16kBBlocks(config, std::move(rom_)) |
| 32 |
{ |
| 33 |
reset(EmuTime::dummy()); |
| 34 |
} |
| 35 |
|
| 36 |
void RomWonderKid::reset(EmuTime ) |
| 37 |
{ |
| 38 |
setRom(0, 0); |
| 39 |
setRom(1, 0); |
| 40 |
setRom(2, 2); |
| 41 |
setUnmapped(3); |
| 42 |
} |
| 43 |
|
| 44 |
byte RomWonderKid::peekMem(uint16_t address, EmuTime time) const |
| 45 |
{ |
| 46 |
if (address < 0xC000) { |
| 47 |
return Rom16kBBlocks::peekMem(address, time); |
| 48 |
} |
| 49 |
return 0xff; |
| 50 |
} |
| 51 |
|
| 52 |
byte RomWonderKid::readMem(uint16_t address, EmuTime time) |
| 53 |
{ |
| 54 |
return peekMem(address, time); |
| 55 |
} |
| 56 |
|
| 57 |
void RomWonderKid::writeMem(uint16_t address, byte value, EmuTime ) |
| 58 |
{ |
| 59 |
if ((0x8000 <= address) && (address < 0xC000)) { |
| 60 |
setRom(2, value); |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
byte* RomWonderKid::getWriteCacheLine(uint16_t address) |
| 65 |
{ |
| 66 |
if ((0x8000 <= address) && (address < 0xC000)) { |
| 67 |
return nullptr; |
| 68 |
} else { |
| 69 |
return unmappedWrite.data(); |
| 70 |
} |
| 71 |
} |
| 72 |
|
| 73 |
REGISTER_MSXDEVICE(RomWonderKid, "RomWonderKid"); |
| 74 |
|
| 75 |
} |