5#ifndef __LIBDRAGON_AY8910_H
6#define __LIBDRAGON_AY8910_H
26#define AY8910_DECIMATE 3
34#define AY8910_OUTPUT_STEREO 1
41#define AY8910_VOLUME_ATTENUATE 0.8
56#define AY8910_CENTER_SILENCE 1
105 uint8_t (*PortRead)(
int idx);
106 void (*PortWrite)(
int idx, uint8_t val);
void ay8910_set_ports(AY8910 *ay, uint8_t(*PortRead)(int), void(*PortWrite)(int, uint8_t))
Configure the I/O port callbacks.
Definition ay8910.c:495
void ay8910_write_addr(AY8910 *ay, uint8_t addr)
Write to the AY8910 address line.
Definition ay8910.c:507
uint8_t holding
True if the envelope is currently holding.
Definition ay8910.h:81
uint32_t out
Current output value.
Definition ay8910.h:89
void ay8910_reset(AY8910 *ay)
Reset the AY8910 emulator.
Definition ay8910.c:479
bool ay8910_is_mute(AY8910 *ay)
Return true if ay8910 is currently muted (all channels disabled)
Definition ay8910.c:500
uint8_t shape
Shape of the envelope (jigsaw, etc.)
Definition ay8910.h:72
uint16_t count
Current tick count for the period.
Definition ay8910.h:78
int ay8910_gen(AY8910 *ay, int16_t *out, int nsamples)
Generate audio for the specified number of samples.
Definition ay8910.c:169
uint8_t alternate
True if attack and release alternate (jigsaw)
Definition ay8910.h:75
uint8_t out
Current output value for this channel.
Definition ay8910.h:66
uint16_t tone_period
Period (in ticks) of the current tone.
Definition ay8910.h:60
uint16_t period
Period (in ticks) of the envelope.
Definition ay8910.h:71
uint8_t tone_en
Enable flag of the tone (0 is enabled)
Definition ay8910.h:62
uint8_t ay8910_read_data(AY8910 *ay)
Read from the AY8910 data line.
Definition ay8910.c:511
int16_t step
Current step of the envelope.
Definition ay8910.h:79
uint8_t tone_vol
Volume of the tone (0x10 -> use envelope)
Definition ay8910.h:61
uint8_t vol
Current output volume.
Definition ay8910.h:80
uint8_t attack
0x0 if in attack, 0xF if in the release
Definition ay8910.h:74
uint8_t count
Current tick count for the period.
Definition ay8910.h:88
uint16_t count
Current tick count for the period.
Definition ay8910.h:65
uint8_t hold
True if the envelope holds after attack.
Definition ay8910.h:76
void ay8910_write_data(AY8910 *ay, uint8_t val)
Write to the AY8910 data line.
Definition ay8910.c:524
uint8_t noise_en
Enable flag of the noise for this channel (0 is enabled)
Definition ay8910.h:63
uint8_t period
Period (in ticks) of the noise.
Definition ay8910.h:86
A AY-3-8910 channel.
Definition ay8910.h:59
Envelope of AY-3-8910.
Definition ay8910.h:70
Noise of AY-3-8910.
Definition ay8910.h:85
A AY-3-8910 emulator.
Definition ay8910.h:104
AYNoise ns
Configuration and state of the noise.
Definition ay8910.h:110
uint8_t addr
Current value on the address line.
Definition ay8910.h:107
AYEnvelope env
Configuration and state of the envelope.
Definition ay8910.h:111