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 byte newBank = value & 0x03;
109 if (bank != newBank) {
116 if (sramEnabled && (address < 0x1FFE)) {
117 sram.
write(address, value);
131 if (sramEnabled && (address < 0x1FFE)) {
138void MSXFmPac::checkSramEnable()
140 bool newEnabled = (r1ffe == 0x4D) && (r1fff == 0x69);
141 if (sramEnabled != newEnabled) {
142 sramEnabled = newEnabled;
148template<
typename Archive>
151 ar.template serializeInlinedBase<MSXMusicBase>(*
this, version);
152 ar.serialize(
"sram", sram,
157 if constexpr (Archive::IS_LOADER) {
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
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.
byte * getWriteCacheLine(word address) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
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:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)