openMSX
MSXTurboRPCM.hh
Go to the documentation of this file.
1#ifndef MSXTURBORPCM_HH
2#define MSXTURBORPCM_HH
3
4#include "MSXDevice.hh"
6#include "DACSound8U.hh"
7#include "Clock.hh"
8
9namespace openmsx {
10
11class MSXMixer;
12
13class MSXTurboRPCM final : public MSXDevice
14{
15public:
16 explicit MSXTurboRPCM(const DeviceConfig& config);
17 ~MSXTurboRPCM() override;
18
19 void reset(EmuTime::param time) override;
20 [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
21 [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
22 void writeIO(word port, byte value, EmuTime::param time) override;
23
24 template<typename Archive>
25 void serialize(Archive& ar, unsigned version);
26
27private:
28 [[nodiscard]] byte getSample(EmuTime::param time) const;
29 [[nodiscard]] bool getComp(EmuTime::param time) const;
30 void hardwareMute(bool mute);
31
32private:
33 MSXMixer& mixer;
34 AudioInputConnector connector;
35 DACSound8U dac;
36 Clock<15750> reference;
37 byte DValue;
38 byte status;
39 byte hold;
40 bool hwMute = false;
41};
42
43} // namespace openmsx
44
45#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:36
MSXTurboRPCM(const DeviceConfig &config)
Definition: MSXTurboRPCM.cc:10
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.
Definition: MSXTurboRPCM.cc:66
byte readIO(word port, EmuTime::param time) override
Read a byte from an IO port at a certain time from this device.
Definition: MSXTurboRPCM.cc:35
byte peekIO(word port, EmuTime::param time) const override
Read a byte from a given IO port.
Definition: MSXTurboRPCM.cc:40
void serialize(Archive &ar, unsigned version)
~MSXTurboRPCM() override
Definition: MSXTurboRPCM.cc:20
void reset(EmuTime::param time) override
This method is called on reset.
Definition: MSXTurboRPCM.cc:25
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29