The Spectrum Next has 4 8-bit DAC ports which you can use for playing audio. Driving the DAC is done by outputting a byte of audio data to one of the ports below. The Next also supports slight improvements over the original SpecDrum which only had one output. SoundDrive is a term that means 4 8-bit DAC channels, 2 x Left 2 x Right and some Russian software supports this mode.
Data can be sent to the DACs either via NextRegs or OUTTING to a port.
|DAC B (left) mirror Register||$2C||Yes||Yes||DAC B mirror, read current I2S left MSB|
|DAC A+D (mono) mirror Register||$2D||Yes||Yes||SpecDrum port 0xDF / DAC A+D mirror, read current I2S LSB|
|DAC C (right) mirror Register||$2E||Yes||Yes||DAC C mirror, read current I2S right MSB|
|... further results|
The frequency that the DAC can play audio is based upon the rate at which audio data is sent to the port. For most purposes you will likely want to be running other code along with driving sound so a way to off-load feeding the DACs can be done with either the DMA, the COPPER or CTC interrupts. Depending on your base code the most suitable method will need to be analysed.
DMA play back is possibly the simplest method but this also requires exclusive use of the DMA and a section of memory for the DMA to play.
- Example of DMA audio playback https://github.com/em00k/zxnext-simple-dma
COPPER has the least CPU requirements but a more complicated to set up. The COPPER will need to be fed each frame.
- Example of COPPER audio playback TBC
CTC timers are a good mix of easy setup and drive leaving the DMA and COPPER free for other purposes.
- Example of settings up the CTC timers to playback audio https://github.com/em00k/playwav32