39 sram = std::make_unique<SRAM>(
getName() +
" SRAM", 0x4000, config);
40 reset(EmuTime::dummy());
50 if ((0x4000 <= address) && (address < 0x8000)) {
51 byte result =
rom[address & 0x1fff];
53 bool tmp = (result & 0x44) == 0x44;
54 shiftValue = narrow_cast<byte>((shiftValue << 1) |
byte(tmp));
57 }
else if ((0x8000 <= address) && (address < 0xC000)) {
58 return (*sram)[address & 0x3fff];
66 if ((0x4000 <= address) && (address < 0x8000)) {
67 return rom[address & 0x1fff];
68 }
else if ((0x8000 <= address) && (address < 0xC000)) {
69 return (*sram)[address & 0x3fff];
77 if ((0x4000 <= address) && (address < 0x8000)) {
80 }
else if ((0x8000 <= address) && (address < 0xC000)) {
81 return &(*sram)[address & 0x3fff];
89 if ((0x8000 <= address) && (address < 0xC000) &&
90 ((shiftValue & 0x31) == 0x11)) {
91 sram->write(address & 0x3fff, value);
97 if ((0x8000 <= address) && (address < 0xC000)) {
105template<
typename Archive>
109 ar.template serializeBase<MSXDevice>(*
this);
110 ar.serialize(
"shiftValue", shiftValue);
#define REGISTER_MSXDEVICE(CLASS, NAME)
bool isM1Cycle(unsigned address) const
Should only be used from within a MSXDevice::readMem() method.
static std::array< byte, 0x10000 > unmappedRead
virtual const std::string & getName() const
Returns a human-readable name for this device.
static std::array< byte, 0x10000 > unmappedWrite
void reset(EmuTime::param time) override
This method is called on reset.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void serialize(Archive &ar, unsigned version)
RomRamFile(const DeviceConfig &config, Rom &&rom)
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
void writeMem(word address, byte value, EmuTime::param time) override
Write a given byte to a given location at a certain time to this device.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)