35 :
MSXRom(config, std::move(rom_))
38 sram = std::make_unique<SRAM>(
getName() +
" SRAM", 0x4000, config);
39 reset(EmuTime::dummy());
49 if ((0x4000 <= address) && (address < 0x8000)) {
50 byte result =
rom[address & 0x1fff];
52 bool tmp = (result & 0x44) == 0x44;
53 shiftValue = (shiftValue << 1) |
byte(tmp);
56 }
else if ((0x8000 <= address) && (address < 0xC000)) {
57 return (*sram)[address & 0x3fff];
65 if ((0x4000 <= address) && (address < 0x8000)) {
66 return rom[address & 0x1fff];
67 }
else if ((0x8000 <= address) && (address < 0xC000)) {
68 return (*sram)[address & 0x3fff];
76 if ((0x4000 <= address) && (address < 0x8000)) {
79 }
else if ((0x8000 <= address) && (address < 0xC000)) {
80 return &(*sram)[address & 0x3fff];
88 if ((0x8000 <= address) && (address < 0xC000) &&
89 ((shiftValue & 0x31) == 0x11)) {
90 sram->write(address & 0x3fff, value);
96 if ((0x8000 <= address) && (address < 0xC000)) {
104 template<
typename Archive>
108 ar.template serializeBase<MSXDevice>(*
this);
109 ar.serialize(
"shiftValue", shiftValue);
bool isM1Cycle(unsigned address) const
Should only be used from within a MSXDevice::readMem() method.
virtual const std::string & getName() const
Returns a human-readable name for this device.
static byte unmappedRead[0x10000]
static byte unmappedWrite[0x10000]
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)
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
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.
This file implemented 3 utility functions:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)