clipping distortion fix for Scramble and Super Cobra

This commit is contained in:
dinkc64 2014-03-31 04:10:36 +00:00
parent bda424ad3e
commit 128e049b5d
1 changed files with 6 additions and 4 deletions

View File

@ -62,8 +62,9 @@ void filter_rc_update(INT32 num, INT16 *src, INT16 *pSoundBuf, INT32 length)
nRightSample = BURN_SND_CLIP(nRightSample);
if (ptr->add_signal) {
pSoundBuf[0] += nLeftSample;
pSoundBuf[1] += nRightSample;
// March 28, 2014: Clipping is still possible when using pSoundBuf[x] += n[l/r]Sample; - dink
pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample);
pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample);
} else {
pSoundBuf[0] = nLeftSample;
pSoundBuf[1] = nRightSample;
@ -92,8 +93,9 @@ void filter_rc_update(INT32 num, INT16 *src, INT16 *pSoundBuf, INT32 length)
nRightSample = BURN_SND_CLIP(nRightSample);
if (ptr->add_signal) {
pSoundBuf[0] += nLeftSample;
pSoundBuf[1] += nRightSample;
// March 28, 2014: Clipping is still possible when using pSoundBuf[x] += n[l/r]Sample; - dink
pSoundBuf[0] = BURN_SND_CLIP(pSoundBuf[0] + nLeftSample);
pSoundBuf[1] = BURN_SND_CLIP(pSoundBuf[1] + nRightSample);
} else {
pSoundBuf[0] = nLeftSample;
pSoundBuf[1] = nRightSample;