summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/seibu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/audio/seibu.cpp')
-rw-r--r--src/mame/audio/seibu.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/mame/audio/seibu.cpp b/src/mame/audio/seibu.cpp
index 798338a29a6..57c6253fe9b 100644
--- a/src/mame/audio/seibu.cpp
+++ b/src/mame/audio/seibu.cpp
@@ -385,7 +385,7 @@ seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char
void seibu_adpcm_device::device_start()
{
m_playing = 0;
- m_stream = machine().sound().stream_alloc(*this, 0, 1, clock());
+ m_stream = stream_alloc(0, 1, clock());
m_adpcm.reset();
save_item(NAME(m_current));
@@ -446,11 +446,12 @@ void seibu_adpcm_device::ctl_w(u8 data)
// sound_stream_update - handle a stream update
//-------------------------------------------------
-void seibu_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+void seibu_adpcm_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
- stream_sample_t *dest = outputs[0];
+ auto &dest = outputs[0];
- while (m_playing && samples > 0)
+ int sampindex;
+ for (sampindex = 0; m_playing && sampindex < dest.samples(); sampindex++)
{
int val = (m_base[m_current] >> m_nibble) & 15;
@@ -462,12 +463,7 @@ void seibu_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample
m_playing = 0;
}
- *dest++ = m_adpcm.clock(val) << 4;
- samples--;
- }
- while (samples > 0)
- {
- *dest++ = 0;
- samples--;
+ dest.put_int(sampindex, m_adpcm.clock(val), 32768 >> 4);
}
+ dest.fill(0, sampindex);
}