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 writeReg(byte reg, byte value, EmuTime::param time);
23 
24  template<typename Archive>
25  void serialize(Archive& ar, unsigned version);
26 
27 private:
28  // SoundDevice
29  void generateChannels(float** bufs, unsigned num) override;
30  float getAmplificationFactorImpl() const override;
31 
32  const std::unique_ptr<YM2413Core> core;
33 
34  struct Debuggable final : SimpleDebuggable {
35  Debuggable(MSXMotherBoard& motherBoard, const std::string& name);
36  byte read(unsigned address) override;
37  void write(unsigned address, byte value, EmuTime::param time) override;
38  } debuggable;
39 };
40 
41 } // namespace openmsx
42 
43 #endif
void writeReg(byte reg, byte value, EmuTime::param time)
Definition: YM2413.cc:66
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void serialize(Archive &ar, unsigned version)
Definition: YM2413.cc:84
void reset(EmuTime::param time)
Definition: YM2413.cc:60
YM2413(const std::string &name, const DeviceConfig &config)
Definition: YM2413.cc:44