12 class AY8910Periphery;
26 [[nodiscard]]
byte readRegister(
unsigned reg, EmuTime::param time);
27 [[nodiscard]]
byte peekRegister(
unsigned reg, EmuTime::param time)
const;
28 void writeRegister(
unsigned reg,
byte value, EmuTime::param time);
29 void reset(EmuTime::param time);
31 template<
typename Archive>
32 void serialize(Archive& ar,
unsigned version);
37 inline void setPeriod(
int value);
38 [[nodiscard]]
inline unsigned getNextEventTime()
const;
39 inline void advanceFast(
unsigned duration);
41 template<
typename Archive>
42 void serialize(Archive& ar,
unsigned version);
45 Generator() =
default;
61 class ToneGenerator :
public Generator {
70 inline void advance(
int duration);
72 inline void doNextEvent(
AY8910& ay8910);
76 [[nodiscard]]
bool getOutput()
const {
return output; }
78 template<
typename Archive>
79 void serialize(Archive& ar,
unsigned version);
82 [[nodiscard]]
int getDetune(
AY8910& ay8910);
87 unsigned vibratoCount = 0;
88 unsigned detuneCount = 0;
95 class NoiseGenerator :
public Generator {
103 inline void advance(
int duration);
105 inline void doNextEvent();
109 [[nodiscard]]
bool getOutput()
const {
return random & 1; }
111 template<
typename Archive>
112 void serialize(Archive& ar,
unsigned version);
121 [[nodiscard]]
const float* getEnvVolTable()
const;
122 [[nodiscard]]
inline float getVolume(
unsigned chan)
const;
123 inline void setChannelVolume(
unsigned chan,
unsigned value);
124 [[nodiscard]]
inline bool followsEnvelope(
unsigned chan)
const;
127 const float* envVolTable;
135 explicit inline Envelope(
const float* envVolTable);
137 inline void setPeriod(
int value);
138 inline void setShape(
unsigned shape);
139 [[nodiscard]]
inline bool isChanging()
const;
140 inline void advance(
int duration);
141 [[nodiscard]]
inline float getVolume()
const;
143 [[nodiscard]]
inline unsigned getNextEventTime()
const;
144 inline void advanceFast(
unsigned duration);
145 inline void doNextEvent();
147 template<
typename Archive>
148 void serialize(Archive& ar,
unsigned version);
151 inline void doSteps(
int steps);
154 const float* envVolTable;
159 bool hold, alternate, holding;
163 void generateChannels(
float** bufs,
unsigned num)
override;
164 [[nodiscard]]
float getAmplificationFactorImpl()
const override;
169 void wrtReg(
unsigned reg,
byte value, EmuTime::param time);
176 [[nodiscard]]
byte read(
unsigned address, EmuTime::param time)
override;
177 void write(
unsigned address,
byte value, EmuTime::param time)
override;
185 ToneGenerator tone[3];
186 NoiseGenerator noise;
191 const bool ignorePortDirections;
193 bool detuneInitialized;
Models the general purpose I/O ports of the AY8910.
This class implements the AY-3-8910 sound chip.
AY8910(const std::string &name, AY8910Periphery &periphery, const DeviceConfig &config, EmuTime::param time)
void reset(EmuTime::param time)
byte readRegister(unsigned reg, EmuTime::param time)
byte peekRegister(unsigned reg, EmuTime::param time) const
void serialize(Archive &ar, unsigned version)
void writeRegister(unsigned reg, byte value, EmuTime::param time)
A Setting with a floating point value.
ALWAYS_INLINE unsigned count(const uint8_t *pIn, const uint8_t *pMatch, const uint8_t *pInLimit)
This file implemented 3 utility functions:
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
void advance(octet_iterator &it, distance_type n, octet_iterator end)