diff options
Diffstat (limited to 'src/devices/bus/a2bus/a2mcms.cpp')
-rw-r--r-- | src/devices/bus/a2bus/a2mcms.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/devices/bus/a2bus/a2mcms.cpp b/src/devices/bus/a2bus/a2mcms.cpp index f9de57897f8..1ef164aff41 100644 --- a/src/devices/bus/a2bus/a2mcms.cpp +++ b/src/devices/bus/a2bus/a2mcms.cpp @@ -206,7 +206,7 @@ mcms_device::mcms_device(const machine_config &mconfig, const char *tag, device_ void mcms_device::device_start() { m_write_irq.resolve(); - m_stream = stream_alloc_legacy(0, 2, 31250); + m_stream = stream_alloc(0, 2, 31250); m_timer = timer_alloc(0, nullptr); m_clrtimer = timer_alloc(1, nullptr); m_enabled = false; @@ -252,20 +252,19 @@ void mcms_device::device_timer(emu_timer &timer, device_timer_id tid, int param, } } -void mcms_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) +void mcms_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { - stream_sample_t *outL, *outR; int i, v; uint16_t wptr; int8_t sample; int32_t mixL, mixR; - outL = outputs[1]; - outR = outputs[0]; + auto &outL = outputs[1]; + auto &outR = outputs[0]; if (m_enabled) { - for (i = 0; i < samples; i++) + for (i = 0; i < outL.samples(); i++) { mixL = mixR = 0; @@ -286,16 +285,14 @@ void mcms_device::sound_stream_update_legacy(sound_stream &stream, stream_sample } } - outL[i] = (mixL * m_mastervol)>>9; - outR[i] = (mixR * m_mastervol)>>9; + outL.put_int(i, mixL * m_mastervol, 32768 << 9); + outR.put_int(i, mixR * m_mastervol, 32768 << 9); } } else { - for (i = 0; i < samples; i++) - { - outL[i] = outR[i] = 0; - } + outL.fill(0); + outR.fill(0); } } |