From 3b2adeccbf29bdd92019a0e82e0f7f0195e91d2f Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Tue, 19 Nov 2013 13:43:40 +0000 Subject: [PATCH] The SB DMA callback ignores previously selected, but not currently selected, DMA channels. Fixes Visual Player 2 with SB16. Bits 0 and 4 of the SBPro mixer volume registers are always set. Fixes SBPro detection in Wolfenstein 3D, Alone in the Dark (European versions), Visual Player 2, and possibly others. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3850 --- src/hardware/sblaster.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hardware/sblaster.cpp b/src/hardware/sblaster.cpp index b3104696..daf8c0cc 100644 --- a/src/hardware/sblaster.cpp +++ b/src/hardware/sblaster.cpp @@ -274,7 +274,7 @@ static INLINE void DSP_FlushData(void) { } static void DSP_DMA_CallBack(DmaChannel * chan, DMAEvent event) { - if (event==DMA_REACHED_TC) return; + if (chan!=sb.dma.chan || event==DMA_REACHED_TC) return; else if (event==DMA_MASKED) { if (sb.mode==MODE_DMA) { GenerateDMASound(sb.dma.min); @@ -1123,8 +1123,9 @@ static void CTMIXER_Reset(void) { _WHICH_[0]= ((((_VAL_) & 0xf0) >> 3)|(sb.type==SBT_16 ? 1:3)); \ _WHICH_[1]= ((((_VAL_) & 0x0f) << 1)|(sb.type==SBT_16 ? 1:3)); \ -#define MAKEPROVOL(_WHICH_) \ - ((((_WHICH_[0] & 0x1e) << 3) | ((_WHICH_[1] & 0x1e) >> 1)) & (sb.type==SBT_16 ? 0xff:0xee)) +#define MAKEPROVOL(_WHICH_) \ + ((((_WHICH_[0] & 0x1e) << 3) | ((_WHICH_[1] & 0x1e) >> 1)) | \ + ((sb.type==SBT_PRO1 || sb.type==SBT_PRO2) ? 0x11:0)) static void DSP_ChangeStereo(bool stereo) { if (!sb.dma.stereo && stereo) {