openMSX
YM2413Core.hh
Go to the documentation of this file.
1#ifndef YM2413CORE_HH
2#define YM2413CORE_HH
3
4#include <cstdint>
5#include <span>
6
7namespace openmsx {
8
28{
29public:
41 static constexpr int CLOCK_FREQ = 3579545;
42
43 virtual ~YM2413Core() = default;
44
47 virtual void reset() = 0;
48
68 virtual void writePort(bool port, uint8_t value, int offset) = 0;
69
75 virtual void pokeReg(uint8_t reg, uint8_t value) = 0;
76
83 [[nodiscard]] virtual uint8_t peekReg(uint8_t reg) const = 0;
84
121 virtual void generateChannels(std::span<float*, 9 + 5> bufs, unsigned num) = 0;
122
133 [[nodiscard]] virtual float getAmplificationFactor() const = 0;
134
139 virtual void setSpeed(double /*speed*/) {}
140
141protected:
142 YM2413Core() = default;
143};
144
145} // namespace openmsx
146
147#endif
Abstract interface for the YM2413 core.
Definition YM2413Core.hh:28
virtual void setSpeed(double)
Sets real-time speed factor (aka the openMSX 'speed' setting).
virtual float getAmplificationFactor() const =0
Returns normalization factor.
virtual void pokeReg(uint8_t reg, uint8_t value)=0
Write to a YM2413 register (for debug).
virtual ~YM2413Core()=default
virtual void reset()=0
Reset this YM2413 core.
virtual uint8_t peekReg(uint8_t reg) const =0
Read from a YM2413 register (for debug).
virtual void generateChannels(std::span< float *, 9+5 > bufs, unsigned num)=0
Generate the sound output.
virtual void writePort(bool port, uint8_t value, int offset)=0
Write to the YM2413 register/data port.
static constexpr int CLOCK_FREQ
Input clock frequency.
Definition YM2413Core.hh:41
This file implemented 3 utility functions:
Definition Autofire.cc:11