summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/tms5110.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/tms5110.cpp')
-rw-r--r--src/devices/sound/tms5110.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/devices/sound/tms5110.cpp b/src/devices/sound/tms5110.cpp
index 73f5244738e..5782aa905af 100644
--- a/src/devices/sound/tms5110.cpp
+++ b/src/devices/sound/tms5110.cpp
@@ -1048,7 +1048,7 @@ void tms5110_device::device_start()
m_data_cb.resolve();
/* initialize a stream */
- m_stream = stream_alloc_legacy(0, 1, clock() / 80);
+ m_stream = stream_alloc(0, 1, clock() / 80);
m_state = CTL_STATE_INPUT; /* most probably not defined */
m_romclk_hack_timer = timer_alloc(0);
@@ -1220,27 +1220,25 @@ int tms5110_device::romclk_hack_r()
******************************************************************************/
//-------------------------------------------------
-// sound_stream_update_legacy - handle a stream update
+// sound_stream_update - handle a stream update
//-------------------------------------------------
-void tms5110_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
+void tms5110_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
int16_t sample_data[MAX_SAMPLE_CHUNK];
- stream_sample_t *buffer = outputs[0];
+ auto &buffer = outputs[0];
/* loop while we still have samples to generate */
- while (samples)
+ for (int sampindex = 0; sampindex < buffer.samples(); )
{
- int length = (samples > MAX_SAMPLE_CHUNK) ? MAX_SAMPLE_CHUNK : samples;
- int index;
+ int length = buffer.samples() - sampindex;
+ if (length > MAX_SAMPLE_CHUNK)
+ length = MAX_SAMPLE_CHUNK;
/* generate the samples and copy to the target buffer */
process(sample_data, length);
- for (index = 0; index < length; index++)
- *buffer++ = sample_data[index];
-
- /* account for the samples */
- samples -= length;
+ for (int index = 0; index < length; index++)
+ buffer.put_int(sampindex++, sample_data[index], 32768);
}
}