From 608ab6edc7ef837def7df7098ea64752a37eeafe Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sat, 9 Oct 2004 08:41:21 +0000 Subject: [PATCH] Allow changing of the timeconstant during autoinit transfers Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2018 --- src/hardware/sblaster.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hardware/sblaster.cpp b/src/hardware/sblaster.cpp index a89972e4..319f2b95 100644 --- a/src/hardware/sblaster.cpp +++ b/src/hardware/sblaster.cpp @@ -616,7 +616,7 @@ Bitu DEBUG_EnableDebugger(void); static void DSP_DoCommand(void) { // LOG_MSG("DSP Command %X",sb.dsp.cmd); switch (sb.dsp.cmd) { - case 0x04: /* DSP Statues SB 2.0/pro version */ + case 0x04: /* DSP Status SB 2.0/pro version */ DSP_FlushData(); DSP_AddData(0xff); //Everthing enabled break; @@ -642,6 +642,10 @@ static void DSP_DoCommand(void) { break; case 0x40: /* Set Timeconstant */ sb.freq=(1000000 / (256 - sb.dsp.in.data[0])); + /* Nasty kind of hack to allow runtime changing of frequency */ + if (sb.dma.mode != DSP_DMA_NONE && sb.dma.autoinit) { + DSP_PrepareDMA_Old(sb.dma.mode,sb.dma.autoinit); + } break; case 0x41: /* Set Output Samplerate */ case 0x42: /* Set Input Samplerate */