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  [[nodiscard]] float getAmplificationFactorImpl() const override;
32 
33 private:
34  const std::unique_ptr<YM2413Core> core;
35 
36  struct Debuggable final : SimpleDebuggable {
37  Debuggable(MSXMotherBoard& motherBoard, const std::string& name);
38  [[nodiscard]] byte read(unsigned address) override;
39  void write(unsigned address, byte value, EmuTime::param time) override;
40  } debuggable;
41 };
42 
43 } // namespace openmsx
44 
45 #endif
YM2413(const std::string &name, const DeviceConfig &config)
Definition: YM2413.cc:66
void pokeReg(byte reg, byte value, EmuTime::param time)
Definition: YM2413.cc:97
void writePort(bool port, byte value, EmuTime::param time)
Definition: YM2413.cc:85
void serialize(Archive &ar, unsigned version)
Definition: YM2413.cc:115
void reset(EmuTime::param time)
Definition: YM2413.cc:79
This file implemented 3 utility functions:
Definition: Autofire.cc:9