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
11namespace openmsx {
12
13class YM2413Core;
14
15class YM2413 final : public ResampledSoundDevice
16{
17public:
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
28private:
29 // SoundDevice
30 void setOutputRate(unsigned hostSampleRate, double speed) override;
31 void generateChannels(std::span<float*> bufs, unsigned num) override;
32 [[nodiscard]] float getAmplificationFactorImpl() const override;
33
34private:
35 const std::unique_ptr<YM2413Core> core;
36
37 struct Debuggable final : SimpleDebuggable {
38 Debuggable(MSXMotherBoard& motherBoard, const std::string& name);
39 [[nodiscard]] byte read(unsigned address) override;
40 void write(unsigned address, byte value, EmuTime::param time) override;
41 } debuggable;
42};
43
44} // namespace openmsx
45
46#endif
void pokeReg(byte reg, byte value, EmuTime::param time)
Definition YM2413.cc:99
void writePort(bool port, byte value, EmuTime::param time)
Definition YM2413.cc:86
void serialize(Archive &ar, unsigned version)
Definition YM2413.cc:124
void reset(EmuTime::param time)
Definition YM2413.cc:80
This file implemented 3 utility functions:
Definition Autofire.cc:11