7static constexpr const char*
const PAC_Header =
"PAC2 BACKUP DATA";
11 , sram(getName() +
" SRAM", 0x1FFE, config, PAC_Header)
13 reset(EmuTime::dummy());
26 if (address < 0x1FFE) {
28 }
else if (address == 0x1FFE) {
30 }
else if (address == 0x1FFF) {
45 return &sram[address];
69 if (sramEnabled && (address < 0x1FFE)) {
70 sram.
write(address, value);
81 if (sramEnabled && (address < 0x1FFE)) {
88void MSXPac::checkSramEnable()
90 bool newEnabled = (r1ffe == 0x4D) && (r1fff == 0x69);
91 if (sramEnabled != newEnabled) {
92 sramEnabled = newEnabled;
97template<
typename Archive>
100 ar.template serializeBase<MSXDevice>(*
this);
101 ar.serialize(
"SRAM", sram,
104 if constexpr (Archive::IS_LOADER) {
#define REGISTER_MSXDEVICE(CLASS, NAME)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
static std::array< byte, 0x10000 > unmappedRead
static std::array< byte, 0x10000 > unmappedWrite
void invalidateDeviceRWCache()
Calls MSXCPUInterface::invalidateXXCache() for the specific (part of) the slot that this device is lo...
void reset(EmuTime::param time) override
This method is called on reset.
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.
MSXPac(const DeviceConfig &config)
void serialize(Archive &ar, unsigned version)
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void write(size_t addr, byte value)
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)