1#ifndef __LIBDRAGON_AY8910_H
2#define __LIBDRAGON_AY8910_H
22#define AY8910_DECIMATE 3
30#define AY8910_OUTPUT_STEREO 1
37#define AY8910_VOLUME_ATTENUATE 0.8
52#define AY8910_CENTER_SILENCE 1
101 uint8_t (*PortRead)(
int idx);
102 void (*PortWrite)(
int idx, uint8_t val);
111void ay8910_reset(
AY8910 *ay);
114void ay8910_set_ports(
AY8910 *ay, uint8_t (*PortRead)(
int),
void (*PortWrite)(
int, uint8_t));
117void ay8910_write_addr(
AY8910 *ay, uint8_t addr);
120void ay8910_write_data(
AY8910 *ay, uint8_t val);
123uint8_t ay8910_read_data(
AY8910 *ay);
126bool ay8910_is_mute(
AY8910 *ay);
133int ay8910_gen(
AY8910 *ay, int16_t *out,
int nsamples);
A AY-3-8910 emulator.
Definition ay8910.h:100
AYNoise ns
Configuration and state of the noise.
Definition ay8910.h:106
uint8_t addr
Current value on the address line.
Definition ay8910.h:103
AYEnvelope env
Configuration and state of the envelope.
Definition ay8910.h:107
A AY-3-8910 channel.
Definition ay8910.h:55
uint8_t out
Current output value for this channel.
Definition ay8910.h:62
uint16_t tone_period
Period (in ticks) of the current tone.
Definition ay8910.h:56
uint8_t tone_en
Enable flag of the tone (0 is enabled)
Definition ay8910.h:58
uint8_t tone_vol
Volume of the tone (0x10 -> use envelope)
Definition ay8910.h:57
uint16_t count
Current tick count for the period.
Definition ay8910.h:61
uint8_t noise_en
Enable flag of the noise for this channel (0 is enabled)
Definition ay8910.h:59
Envelope of AY-3-8910.
Definition ay8910.h:66
uint8_t holding
True if the envelope is currently holding.
Definition ay8910.h:77
uint8_t shape
Shape of the envelope (jigsaw, etc.)
Definition ay8910.h:68
uint16_t count
Current tick count for the period.
Definition ay8910.h:74
uint8_t alternate
True if attack and release alternate (jigsaw)
Definition ay8910.h:71
uint16_t period
Period (in ticks) of the envelope.
Definition ay8910.h:67
int16_t step
Current step of the envelope.
Definition ay8910.h:75
uint8_t vol
Current output volume.
Definition ay8910.h:76
uint8_t attack
0x0 if in attack, 0xF if in the release
Definition ay8910.h:70
uint8_t hold
True if the envelope holds after attack.
Definition ay8910.h:72
Noise of AY-3-8910.
Definition ay8910.h:81
uint32_t out
Current output value.
Definition ay8910.h:85
uint8_t count
Current tick count for the period.
Definition ay8910.h:84
uint8_t period
Period (in ticks) of the noise.
Definition ay8910.h:82