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