64 void reset(EmuTime::param time);
65 void writeReg(uint8_t r, uint8_t v, EmuTime::param time);
68 template<
typename Archive>
69 void serialize(Archive& ar,
unsigned version);
73 struct YM2151Operator {
74 template<
typename Archive>
75 void serialize(Archive& ar,
unsigned version);
128 void setConnect(std::span<YM2151Operator, 4> o,
int cha,
int v);
131 void generateChannels(std::span<float*> bufs,
unsigned num)
override;
133 void callback(uint8_t flag)
override;
134 void setStatus(uint8_t flags);
135 void resetStatus(uint8_t flags);
138 void envelopeKONKOFF(std::span<YM2151Operator, 4> op,
int v)
const;
139 static void refreshEG(std::span<YM2151Operator, 4> op);
140 [[nodiscard]]
int opCalc(
const YM2151Operator& op,
unsigned env,
int pm)
const;
141 [[nodiscard]]
int opCalc1(
const YM2151Operator& op,
unsigned env,
int pm)
const;
142 [[nodiscard]]
inline unsigned volumeCalc(
const YM2151Operator& op,
unsigned AM)
const;
143 inline void keyOn(YM2151Operator& op,
unsigned keySet)
const;
144 inline void keyOff(YM2151Operator& op,
unsigned keyClear)
const;
147 void chanCalc(
unsigned chan);
153 [[nodiscard]]
bool checkMuteHelper();
158 const std::unique_ptr<EmuTimer> timer1;
159 const std::unique_ptr<EmuTimer> timer2;
161 std::array<YM2151Operator, 32> oper;
163 std::array<unsigned, 16> pan;
170 unsigned lfo_overflow;
172 unsigned lfo_counter;
173 unsigned lfo_counter_add;
190 std::array<int, 8> chanOut;
194 uint16_t timer_A_val{0};
204 std::array<uint8_t, 256> regs = {};