Hi people, I'm trying to make PSG sounds using normal BIOS functions. As far as I know, to make PSG sounds you simply needs to load in register correct values. To make tests, I've used a ayfx file that has this format:
Every frame is encoded with the flag byte and a number of bytes that vary depending from value changes.
bit0..3 Volume
bit4 Disable T
bit5 Change Tone
bit6 Change Noise
bit7 Disable N
When bit5 is set, two bytes with tone period are follow; when bit6 is set, a single byte with noise period follow; when both bits are set, first two bytes of tone period, then single byte with noise period follow. When none of the bits are set, next flags byte follow.
Considering channel A, for example:
bit0..3 Volume -> R10 of PSG (Amplitude Register)
bit4 Disable T -> Bit 0 of R7 (Mixer Register)
bit5 Change Tone -> Loads the 2 bytes to R0 and R1. (Tone generators registers)
bit6 Change Noise -> Load byte to R6 (Noise register)
bit7 Disable N -> Bit3 of R7 (Mixer Register)
I've made a loop that reads the content of ayfx file and in every frame sets PSG registers with the loaded values. However no sound is generated, only sounds the GICINI routine that sounds like a key click.
Is needed something more to play the sound? Thanks.