diff options
Diffstat (limited to 'src/mame/drivers/pv1000.cpp')
-rw-r--r-- | src/mame/drivers/pv1000.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mame/drivers/pv1000.cpp b/src/mame/drivers/pv1000.cpp index a78004c2ad4..63b19c16975 100644 --- a/src/mame/drivers/pv1000.cpp +++ b/src/mame/drivers/pv1000.cpp @@ -31,7 +31,7 @@ protected: virtual void device_start() override; // sound stream update overrides - virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override; + virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; private: @@ -60,7 +60,7 @@ pv1000_sound_device::pv1000_sound_device(const machine_config &mconfig, const ch void pv1000_sound_device::device_start() { - m_sh_channel = stream_alloc_legacy(0, 1, clock() / 1024); + m_sh_channel = stream_alloc(0, 1, clock() / 1024); save_item(NAME(m_voice[0].count)); save_item(NAME(m_voice[0].period)); @@ -84,7 +84,7 @@ void pv1000_sound_device::voice_w(offs_t offset, uint8_t data) } //------------------------------------------------- -// sound_stream_update_legacy - handle a stream update +// sound_stream_update - handle a stream update //------------------------------------------------- @@ -98,20 +98,20 @@ void pv1000_sound_device::voice_w(offs_t offset, uint8_t data) Note: the register periods are inverted. */ -void pv1000_sound_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) +void pv1000_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { - stream_sample_t *buffer = outputs[0]; + auto &buffer = outputs[0]; - while (samples > 0) + for (int sampindex = 0; sampindex < buffer.samples(); sampindex++) { - *buffer=0; + s32 sum = 0; for (int i = 0; i < 3; i++) { uint32_t per = (0x3f - (m_voice[i].period & 0x3f)); if (per != 0) //OFF! - *buffer += m_voice[i].val * 8192; + sum += m_voice[i].val * 8192; m_voice[i].count++; @@ -122,8 +122,7 @@ void pv1000_sound_device::sound_stream_update_legacy(sound_stream &stream, strea } } - buffer++; - samples--; + buffer.put_int(sampindex, sum, 32768); } } |