mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 11:04:44 +00:00
CMS: Do proper clipping of the sound data on generation.
This fixes some overflows/underflows which resulted in crackling.
This commit is contained in:
parent
74560278b2
commit
b95bbb2ace
@ -244,8 +244,8 @@ void CMSEmulator::update(int chip, int16 *buffer, int length) {
|
||||
}
|
||||
}
|
||||
/* write sound data to the buffer */
|
||||
buffer[j*2] += output_l / 6;
|
||||
buffer[j*2+1] += output_r / 6;
|
||||
buffer[j*2+0] = CLIP<int>(buffer[j*2+0] + output_l / 6, -32768, 32767);
|
||||
buffer[j*2+1] = CLIP<int>(buffer[j*2+1] + output_r / 6, -32768, 32767);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user