diff options
Diffstat (limited to 'src/devices/sound/tms36xx.cpp')
-rw-r--r-- | src/devices/sound/tms36xx.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/devices/sound/tms36xx.cpp b/src/devices/sound/tms36xx.cpp index 73ec59b4121..08df1d03f51 100644 --- a/src/devices/sound/tms36xx.cpp +++ b/src/devices/sound/tms36xx.cpp @@ -355,7 +355,7 @@ void tms36xx_device::device_start() { int enable = 0; - m_channel = stream_alloc_legacy(0, 1, clock() * 64); + m_channel = stream_alloc(0, 1, clock() * 64); m_samplerate = clock() * 64; m_basefreq = clock(); @@ -394,23 +394,22 @@ void tms36xx_device::device_start() //------------------------------------------------- -// sound_stream_update_legacy - handle a stream update +// sound_stream_update - handle a stream update //------------------------------------------------- -void tms36xx_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) +void tms36xx_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { int samplerate = m_samplerate; - stream_sample_t *buffer = outputs[0]; + auto &buffer = outputs[0]; /* no tune played? */ if( !tunes[m_tune_num] || m_voices == 0 ) { - while (--samples >= 0) - buffer[samples] = 0; + buffer.fill(0); return; } - while( samples-- > 0 ) + for (int sampindex = 0; sampindex < buffer.samples(); sampindex++) { int sum = 0; @@ -444,7 +443,7 @@ void tms36xx_device::sound_stream_update_legacy(sound_stream &stream, stream_sam TONE( 0) TONE( 1) TONE( 2) TONE( 3) TONE( 4) TONE( 5) TONE( 6) TONE( 7) TONE( 8) TONE( 9) TONE(10) TONE(11) - *buffer++ = sum / m_voices; + buffer.put_int(sampindex, sum, 32768 * m_voices); } } |