13 , rom(getName() +
" ROM",
"rom", config)
14 , ym2413(getName(), config)
16 if (!std::has_single_bit(
rom.
size())) {
17 throw MSXException(
"MSX-Music ROM-size must be a non-zero power of two");
55template<
typename Archive>
58 ar.template serializeBase<MSXDevice>(*
this);
60 if (ar.versionAtLeast(version, 2)) {
61 ar.serialize(
"ym2413",
ym2413);
79template<
typename Archive>
82 ar.template serializeInlinedBase<MSXMusicBase>(*
this, version);
117 if ((0x7FF0 <= address) && (address < 0x8000)) {
118 return control | 0xFC;
119 }
else if ((control & 1) == 0) {
135 }
else if ((control & 1) == 0) {
144 if ((0x7FF0 <= address) && (address < 0x8000)) {
159template<
typename Archive>
162 ar.template serializeInlinedBase<MSXMusicBase>(*
this, version);
163 ar.serialize(
"control", control);
#define REGISTER_MSXDEVICE(CLASS, NAME)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
void invalidateDeviceRCache()
static std::array< byte, 0x10000 > unmappedRead
static std::array< byte, 0x10000 > unmappedWrite
EmuTime::param getCurrentTime() const
const byte * getReadCacheLine(word start) 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)
byte readMem(word address, EmuTime::param time) override
Read a byte from a location at a certain time from this device.
void serialize(Archive &ar, unsigned version)
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
MSXMusicBase(const DeviceConfig &config)
MSXMusicWX(const DeviceConfig &config)
const byte * getReadCacheLine(word start) const override
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
byte peekMem(word address, EmuTime::param time) const override
Read a byte from a given memory location.
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 serialize(Archive &ar, unsigned version)
void reset(EmuTime::param time) override
This method is called on reset.
byte * getWriteCacheLine(word start) 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.
MSXMusic(const DeviceConfig &config)
void serialize(Archive &ar, unsigned version)
void writePort(bool port, byte value, EmuTime::param time)
void serialize(Archive &ar, unsigned version)
void reset(EmuTime::param time)
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)