From 2fb9f38b83270cac34428738313cd2eee79f421e Mon Sep 17 00:00:00 2001 From: arbee Date: Thu, 24 Sep 2020 08:49:38 -0400 Subject: es5503: use put_int for sample scaling, use fill_n for faster clear [R. Belmont] --- src/devices/sound/es5503.cpp | 14 ++++++++------ src/devices/sound/es5503.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp index 835305a3d80..ec176b2b369 100644 --- a/src/devices/sound/es5503.cpp +++ b/src/devices/sound/es5503.cpp @@ -129,14 +129,13 @@ void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int ress } void es5503_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { - static int32_t mix[(44100/60)*2*8]; int32_t *mixp; int osc, snum, i; uint32_t ramptr; int samples = outputs[0].samples(); assert(samples < (44100/60)*2); - memset(mix, 0, sizeof(mix)); + std::fill_n(&m_mix_buffer[0], samples*output_channels, 0); for (int chan = 0; chan < output_channels; chan++) { @@ -155,7 +154,7 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vectorresolution] - pOsc->wavetblsize; uint32_t sizemask = accmasks[pOsc->wavetblsize]; - mixp = &mix[0] + chan; + mixp = &m_mix_buffer[0] + chan; for (snum = 0; snum < samples; snum++) { @@ -197,11 +196,14 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vector m_mix_buffer; + + int32_t m_mix_buffer[(44100/60)*2*8]; void halt_osc(int onum, int type, uint32_t *accumulator, int resshift); }; -- cgit v1.2.3-70-g09d2