From f91aa29f2bbf07070077679d12187625eba8f4c9 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sun, 7 Jul 2013 19:19:59 +0000 Subject: [PATCH] Fixed and simplified DMA timer value calculation --- bochs/iodev/sound/sb16.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bochs/iodev/sound/sb16.cc b/bochs/iodev/sound/sb16.cc index 409c4f402..fafe04974 100644 --- a/bochs/iodev/sound/sb16.cc +++ b/bochs/iodev/sound/sb16.cc @@ -1248,11 +1248,10 @@ void bx_sb16_c::dsp_dma(Bit8u command, Bit8u mode, Bit16u length, Bit8u comp) Bit32u sampledatarate = (Bit32u) DSP.dma.samplerate * (Bit32u) DSP.dma.bps; if ((DSP.dma.bits == 16) && (BX_SB16_DMAH != 0)) { DSP.dma.count = (DSP.dma.blocklength + 1) * (DSP.dma.bps / 2) - 1; - DSP.dma.timer = BX_SB16_THIS dmatimer / (sampledatarate / 2) * BX_DMA_BUFFER_SIZE; } else { DSP.dma.count = (DSP.dma.blocklength + 1) * DSP.dma.bps - 1; - DSP.dma.timer = BX_SB16_THIS dmatimer / sampledatarate * BX_DMA_BUFFER_SIZE; } + DSP.dma.timer = BX_SB16_THIS dmatimer * BX_DMA_BUFFER_SIZE / sampledatarate; writelog(WAVELOG(5), "DMA is %db, %dHz, %s, %s, mode %d, %s, %s, %d bps, %d usec/DMA", DSP.dma.bits, DSP.dma.samplerate, (DSP.dma.stereo != 0)?"stereo":"mono",