Register
PSG_SetRegister
void PSG_SetRegister(
u8 reg,
u8 value
)

Set the value of a given register

PSG_GetRegister
u8 PSG_GetRegister(
u8 reg
)

Get the value of a given register

Helper
PSG_SetTone
void PSG_SetTone(
u8 chan,
u16 period
)

Set the tone period of a given channel (tone generator control register)

PSG_SetNoise
void PSG_SetNoise(
u8 period
)

Set the noise period (noise generator control register)

PSG_SetMixer
void PSG_SetMixer(
u8 mix
)

Setup mixer by enabling tune and noise generators for each channel (mixer control enable register)

PSG_SetVolume
void PSG_SetVolume(
u8 chan,
u8 vol
)

Set the volume of a given channel (Amplitude control register)

PSG_SetEnvelope
void PSG_SetEnvelope(
u16 period
)

Set the envelope period (Envelope priod control register)

PSG_SetShape
void PSG_SetShape(
u8 shape
)

Set the envelope shape (Envelope shape control register)

PSG_EnableTone
void PSG_EnableTone(
u8 chan,
u8 val
)

Enable/disable tone on the given channel

PSG_EnableNoise
void PSG_EnableNoise(
u8 chan,
u8 val
)

Enable/disable noise on the given channel

PSG_EnableEnvelope
void PSG_EnableEnvelope(
u8 chan,
u8 val
)

Enable/disable envelope on the given channel

PSG_Mute
void PSG_Mute()

Silent the PSG (set according registers)

PSG_Resume
void PSG_Resume()

Resume PSG sound

Indirect
PSG_Apply
void PSG_Apply()

Send data to PSG registers #0 to #13