openMSX
YM2413.hh
Go to the documentation of this file.
1 #ifndef YM2413_HH
2 #define YM2413_HH
3 
5 #include "SimpleDebuggable.hh"
6 #include "EmuTime.hh"
7 #include "openmsx.hh"
8 #include <memory>
9 #include <string>
10 
11 namespace openmsx {
12 
13 class YM2413Core;
14 
15 class YM2413 final : public ResampledSoundDevice
16 {
17 public:
18  YM2413(const std::string& name, const DeviceConfig& config);
19  ~YM2413();
20 
21  void reset(EmuTime::param time);
22  void writePort(bool port, byte value, EmuTime::param time);
23  void pokeReg(byte reg, byte value, EmuTime::param time);
24 
25  template<typename Archive>
26  void serialize(Archive& ar, unsigned version);
27 
28 private:
29  // SoundDevice
30  void generateChannels(float** bufs, unsigned num) override;
31  float getAmplificationFactorImpl() const override;
32 
33  const std::unique_ptr<YM2413Core> core;
34 
35  struct Debuggable final : SimpleDebuggable {
36  Debuggable(MSXMotherBoard& motherBoard, const std::string& name);
37  byte read(unsigned address) override;
38  void write(unsigned address, byte value, EmuTime::param time) override;
39  } debuggable;
40 };
41 
42 } // namespace openmsx
43 
44 #endif
openmsx.hh
openmsx::ResampledSoundDevice
Definition: ResampledSoundDevice.hh:17
openmsx::YM2413::reset
void reset(EmuTime::param time)
Definition: YM2413.cc:79
openmsx::YM2413::pokeReg
void pokeReg(byte reg, byte value, EmuTime::param time)
Definition: YM2413.cc:97
openmsx::DeviceConfig
Definition: DeviceConfig.hh:20
openmsx::YM2413::~YM2413
~YM2413()
Definition: YM2413.cc:74
openmsx::SimpleDebuggable
Definition: SimpleDebuggable.hh:12
openmsx::YM2413::writePort
void writePort(bool port, byte value, EmuTime::param time)
Definition: YM2413.cc:85
openmsx::MSXMotherBoard
Definition: MSXMotherBoard.hh:61
openmsx::YM2413::YM2413
YM2413(const std::string &name, const DeviceConfig &config)
Definition: YM2413.cc:66
SimpleDebuggable.hh
openmsx::YM2413
Definition: YM2413.hh:16
EmuTime.hh
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::YM2413::serialize
void serialize(Archive &ar, unsigned version)
Definition: YM2413.cc:115
ResampledSoundDevice.hh