From bcc28f7229b327ab39c0b1656141d2358d4d2717 Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Fri, 7 Nov 2014 03:29:22 +0000 Subject: [PATCH] Fix dac popping & clicking when mixing two dac chips --- src/burn/snd/dac.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/burn/snd/dac.cpp b/src/burn/snd/dac.cpp index 71c4a471e..fadac93a7 100644 --- a/src/burn/snd/dac.cpp +++ b/src/burn/snd/dac.cpp @@ -55,15 +55,20 @@ static void UpdateStream(INT32 chip, INT32 length) if (rOut && lOut) { while (length--) { - *lbuf++ = BURN_SND_CLIP(*lbuf + lOut); - *rbuf++ = BURN_SND_CLIP(*rbuf + rOut); + *lbuf = BURN_SND_CLIP((INT32)(*lbuf + lOut)); + *rbuf = BURN_SND_CLIP((INT32)(*rbuf + rOut)); + lbuf++,rbuf++; } } else if (lOut) { - while (length--) - *lbuf++ = BURN_SND_CLIP(*lbuf + lOut); + while (length--) { + *lbuf = BURN_SND_CLIP((INT32)(*lbuf + lOut)); + lbuf++; + } } else if (rOut) { - while (length--) - *rbuf++ = BURN_SND_CLIP(*rbuf + rOut); + while (length--) { + *rbuf = BURN_SND_CLIP((INT32)(*rbuf + rOut)); + rbuf++; + } } }