VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

When the DSP is given the DMA ADC(command 0x24), according to the documentation I found, returns the first sample in Direct Mode instead. Dosbox gives all samples using pure DMA transfers.

024h DMA ADC, 8-bit SB COMMAND->LENGTHLOBYTE->LENGTHHIBYTE […]
Show full quote

024h DMA ADC, 8-bit SB
COMMAND->LENGTHLOBYTE->LENGTHHIBYTE

DESCRIPTION
Initiates 8-bit DMA transfer (record).

PROCEDURE
a) Install IRQ handler (hook vector, update PIC mask)
b) Perform Set Time Constant command (040h), or otherwise set sample rate
c) Perform Enable Speaker command (0D1h)
d) Setup DMA controller (mode = 044h + channel)
e) Perform DMA ADC, 8-bit command (024h)
f) IRQ: Acknowledge IRQ (input from IRQ Acknowledge, 8-bit port - 02x0Eh;
perform Generic EOI (020h) to appropriate PICs)
g) Perform Disable Speaker command (0D3h)

LENGTH = SAMPLES - 1

NOTES
* SoundBlasters prior to SB16 return the first sample in direct mode.

SEE ALSO
0D0h Halt DMA Operation, 8-bit
0D4h Continue DMA Operation, 8-bit
-----------------------------------------------------
02Ch Auto-Initialize DMA ADC, 8-bit
098h Auto-Initialize DMA ADC, 8-bit (High Speed)
0Cxh Generic DAC/ADC DMA, 8-bit

http://the.earth.li/~tfm/oldpage/sb_dsp.html

Why doesn't Dosbox emulate this bug? Software actually built for the Sound Blaster prior to SB16 will expect the first sample to arrive by an IRQ followed by the first sample in the output buffer(from hardware perspective), with the others then being transferred and an IRQ being raised once again signalling the finish of all other samples(when the entire transfer of the other samples is finished, probably immediately otherwise(with only one sample being transferred, like the official Sound Blaster 2.0 drivers try to do)). Thus that software might malfunction?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io