12 , mixer(getMotherBoard().getMSXMixer())
13 , connector(getPluggingController(),
"pcminput")
14 , dac(
"PCM",
"Turbo-R PCM", config)
15 , reference(getCurrentTime())
27 reference.
reset(time);
42 switch (port & 0x01) {
60 return (getComp(time) ? 0x80 : 0x00) | (status & 0x1F);
68 switch (port & 0x01) {
87 byte change = status ^ value;
90 if ((change & 0x01) && ((status & 0x01) == 0)) {
94 if ((change & 0x10) && (status & 0x10)) {
95 hold = getSample(time);
97 hardwareMute(!(status & 0x02));
102byte MSXTurboRPCM::getSample(EmuTime::param time)
const
104 return (status & 0x04)
105 ? narrow<byte>((connector.
readSample(time) / 256) + 0x80)
109bool MSXTurboRPCM::getComp(EmuTime::param time)
const
112 byte sample = (status & 0x10) ? hold : getSample(time);
113 return sample >= DValue;
116void MSXTurboRPCM::hardwareMute(
bool mute)
118 if (mute == hwMute)
return;
129template<
typename Archive>
132 ar.template serializeBase<MSXDevice>(*
this);
133 ar.serialize(
"audioConnector", connector,
134 "reference", reference,
140 hardwareMute(!(status & 0x02));
constexpr void reset(EmuTime::param e)
Reset the clock to start ticking at the given time.
constexpr void advance(EmuTime::param e)
Advance this clock in time until the last tick which is not past the given time.
constexpr unsigned getTicksTill(EmuTime::param e) const
Calculate the number of ticks for this clock until the given time.
void reset(EmuTime::param time)
void writeDAC(uint8_t value, EmuTime::param time)
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
EmuTime::param getCurrentTime() const
void mute()
TODO This methods (un)mute the sound.
MSXTurboRPCM(const DeviceConfig &config)
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.
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
void serialize(Archive &ar, unsigned version)
void reset(EmuTime::param time) override
This method is called on reset.
This file implemented 3 utility functions:
REGISTER_MSXDEVICE(ChakkariCopy, "ChakkariCopy")
uint16_t word
16 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)