07-22-2020, 05:59 AM
Attached is a demo of my work in progress sound driver and C library for the NGPC.
In the demo, press A to pause and resume the BGM, and B to alternate between SFX1 and SFX2.
I heavily referenced the VGM drivers from @mic_ and the documentation on sound written Ivan Mackintosh. I also referenced documentation on the VGM standard, specifically with regards to SMS VGM data. This mostly consists of PSG data writes (which can be sent right to the sound registers on the Z80) and wait commands.
I have made the Z80 driver so it is synchronous with the T900 vblank. Each vblank, the T900 parses the VGM data, sends a frame of data to a couple of buffers in shared RAM, and pulses the Z80 so it will process the frame. It seems to be fast enough for my purposes, as I do not notice slowdown in the game I am working on.
BGM and SFX can be composed in Deflemask SMS mode.
I am still learning the intricacies of PSG data and the 2 PSG sound registers on the Z80. The driver and library still need refining, so I will wait to share the source until it's ready.
I have tested it successfully on real hardware.
In the demo, press A to pause and resume the BGM, and B to alternate between SFX1 and SFX2.
I heavily referenced the VGM drivers from @mic_ and the documentation on sound written Ivan Mackintosh. I also referenced documentation on the VGM standard, specifically with regards to SMS VGM data. This mostly consists of PSG data writes (which can be sent right to the sound registers on the Z80) and wait commands.
I have made the Z80 driver so it is synchronous with the T900 vblank. Each vblank, the T900 parses the VGM data, sends a frame of data to a couple of buffers in shared RAM, and pulses the Z80 so it will process the frame. It seems to be fast enough for my purposes, as I do not notice slowdown in the game I am working on.
BGM and SFX can be composed in Deflemask SMS mode.
I am still learning the intricacies of PSG data and the 2 PSG sound registers on the Z80. The driver and library still need refining, so I will wait to share the source until it's ready.
I have tested it successfully on real hardware.