7static constexpr const char*
const PAC_Header =
"PAC2 BACKUP DATA";
11 , sram(getName() +
" SRAM", 0x1FFE, config, PAC_Header)
12 , romBlockDebug(*this,
std::span{&bank, 1}, 0x4000, 0x4000, 14)
44 if (address < 0x1FFE) {
46 }
else if (address == 0x1FFE) {
48 }
else if (address == 0x1FFF) {
54 return rom[bank * 0x4000 + address];
67 return &sram[address];
74 return &
rom[bank * 0x4000 + address];
85 if (!(enable & 0x10)) {
91 if (!(enable & 0x10)) {
101 enable = value & 0x11;
108 if (
byte newBank = value & 0x03; bank != newBank) {
115 if (sramEnabled && (address < 0x1FFE)) {
116 sram.
write(address, value);
130 if (sramEnabled && (address < 0x1FFE)) {
137void MSXFmPac::checkSramEnable()
139 bool newEnabled = (r1ffe == 0x4D) && (r1fff == 0x69);
140 if (sramEnabled != newEnabled) {
141 sramEnabled = newEnabled;
147template<
typename Archive>
150 ar.template serializeInlinedBase<MSXMusicBase>(*
this, version);
151 ar.serialize(
"sram", sram,
156 if constexpr (Archive::IS_LOADER) {
#define REGISTER_MSXDEVICE(CLASS, NAME)
void invalidateDeviceRCache()
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...
EmuTime::param getCurrentTime() const
byte * getWriteCacheLine(word address) override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
MSXFmPac(const DeviceConfig &config)
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.
void reset(EmuTime::param time) override
This method is called on reset.
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
void serialize(Archive &ar, unsigned version)
const byte * getReadCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
void writeIO(word port, byte value, EmuTime::param time) override
Write a byte to a given IO port at a certain time to this device.
void reset(EmuTime::param time) override
This method is called on reset.
void writePort(bool port, byte value, EmuTime::param time)
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)