52 , ay8910(
"PSG", *
this, config, getCurrentTime())
54 reset(getCurrentTime());
85 switch (port & 0x07) {
87 registerLatch = value & 0x0F;
97byte SVIPSG::readA(EmuTime::param time)
99 return byte(((ports[1]->read(time) & 0x0F) << 4) |
100 ((ports[0]->read(time) & 0x0F) << 0));
103void SVIPSG::writeB(
byte value, EmuTime::param )
109 switch (~value & 0x14) {
117 switch (~value & 0x0B) {
119 if ((~value & 0x80) || (~value & 0x40)) {
137template<
typename Archive>
140 ar.template serializeBase<MSXDevice>(*
this);
141 ar.serialize(
"ay8910", ay8910,
142 "registerLatch", registerLatch);
144 ar.serialize(
"portB", portB);
145 if constexpr (Archive::IS_LOADER) {
#define REGISTER_MSXDEVICE(CLASS, NAME)
uint8_t readRegister(unsigned reg, EmuTime::param time)
void reset(EmuTime::param time)
void writeRegister(unsigned reg, uint8_t value, EmuTime::param time)
uint8_t peekRegister(unsigned reg, EmuTime::param time) const
void setLed(Led led, bool status)
void setPrimarySlots(byte value)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
MSXMotherBoard & getMotherBoard() const
Get the mother board this device belongs to.
EmuTime::param getCurrentTime() const
MSXCPUInterface & getCPUInterface()
LedStatus & getLedStatus()
JoystickPortIf & getJoystickPort(unsigned port)
void powerDown(EmuTime::param time) override
This method is called when MSX is powered down.
SVIPSG(const DeviceConfig &config)
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
void serialize(Archive &ar, unsigned version)
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
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.
This file implemented 3 utility functions:
uint8_t byte
8 bit unsigned integer
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)