From dfe7247a7b036201659efe1568f04352f1f2601b Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 25 Apr 2005 09:23:54 +0000 Subject: [PATCH] other mixer changes. ("reversing" the old ones) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2192 --- src/hardware/mixer.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/hardware/mixer.cpp b/src/hardware/mixer.cpp index d0d6778a..71041df1 100644 --- a/src/hardware/mixer.cpp +++ b/src/hardware/mixer.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mixer.cpp,v 1.31 2005-03-25 10:12:05 qbix79 Exp $ */ +/* $Id: mixer.cpp,v 1.32 2005-04-25 09:23:54 qbix79 Exp $ */ /* Remove the sdl code from here and have it handeld in the sdlmain. @@ -56,12 +56,13 @@ #define MIXER_WAVESIZE MIXER_BUFSIZE #define MIXER_VOLSHIFT 13 -// #define MIXER_CLIP(SAMP) (SAMP>MAX_AUDIO) ? (Bit16s)MAX_AUDIO : (SAMPMAX_AUDIO)|(SAMPMIN_AUDIO) { + if (SAMP> MIXER_VOLSHIFT; - INIT_CLIP(sample); mixer.wave.buf[mixer.wave.used][0]=MIXER_CLIP(sample); sample=mixer.work[readpos][1] >> MIXER_VOLSHIFT; - INIT_CLIP(sample); mixer.wave.buf[mixer.wave.used][1]=MIXER_CLIP(sample); readpos=(readpos+1)&MIXER_BUFMASK; if (++mixer.wave.used==MIXER_WAVESIZE) { @@ -369,11 +368,9 @@ static void MIXER_CallBack(void * userdata, Uint8 *stream, int len) { Bits sample; while (need--) { sample=mixer.work[mixer.pos][0]>>MIXER_VOLSHIFT; - INIT_CLIP(sample); *output++=MIXER_CLIP(sample); mixer.work[mixer.pos][0]=0; sample=mixer.work[mixer.pos][1]>>MIXER_VOLSHIFT; - INIT_CLIP(sample); *output++=MIXER_CLIP(sample); mixer.work[mixer.pos][1]=0; mixer.pos=(mixer.pos+1)&MIXER_BUFMASK;