Skip to content

How to play a DAC SFX

Clownacy edited this page Apr 30, 2021 · 1 revision

Intro

DAC samples can be played on command, making them usable as sound effects (SFX). Unlike some other drivers, this driver features a two-channel DAC mixer, allowing DAC SFX to not override (or be overridden by) DAC samples played by music.

Precautions

DAC SFX will override each other, so make sure to only use them sparingly.

Additionally, while music currently cannot use both DAC channels, they may be able to in the future. In that case, DAC SFX will not be useable while a song that uses both channels is playing.

Another issue with music is that panning applied to one DAC channel will affect both: that means that if a song pans its DAC channel to the left speaker, then DAC SFX will be panned to the left speaker as well. To avoid this, either do not play DAC SFX while a song that pans its DAC channel is playing, or modify your songs to not perform DAC panning.

Finally, the playback quality of DAC samples really isn't great right now (they have the typical Mega Drive 'crunchiness'). Voice clips especially don't sound very good at all, so I wouldn't recommend using DAC SFX to play them. Hopefully this will improve in the future.

Playing DAC SFX

To play DAC SFX, use the SMPS_PlayDACSample subroutine. It takes a single byte in register d0 as a parameter, which defines the DAC sample to play. The value for each sample can be found in SMPS2ASM - DAC Sample Equates.asm.

Below is an example of using SMPS_PlayDACSample to play the 'come on' sample from Sonic 3:

	move.b	#dComeOn,d0
	jsr	(SMPS_PlayDACSample).l
Clone this wiki locally