summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/k007232.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/k007232.cpp')
-rw-r--r--src/devices/sound/k007232.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/devices/sound/k007232.cpp b/src/devices/sound/k007232.cpp
index 3b35eeb9d5c..a8b6c135a51 100644
--- a/src/devices/sound/k007232.cpp
+++ b/src/devices/sound/k007232.cpp
@@ -86,7 +86,7 @@ void k007232_device::device_start()
for (auto & elem : m_wreg)
elem = 0;
- m_stream = stream_alloc_legacy(0, 2, clock()/128);
+ m_stream = stream_alloc(0, 2, clock()/128);
save_item(STRUCT_MEMBER(m_channel, vol));
save_item(STRUCT_MEMBER(m_channel, addr));
@@ -206,14 +206,11 @@ void k007232_device::set_bank(int chan_a_bank, int chan_b_bank)
//-------------------------------------------------
-// sound_stream_update_legacy - handle a stream update
+// sound_stream_update - handle a stream update
//-------------------------------------------------
-void k007232_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
+void k007232_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
- memset(outputs[0], 0, samples * sizeof(stream_sample_t));
- memset(outputs[1], 0, samples * sizeof(stream_sample_t));
-
if (K007232_LOG_PCM)
{
for (int i = 0; i < KDAC_A_PCM_MAX; i++)
@@ -239,8 +236,9 @@ void k007232_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
}
}
- for (int j = 0; j < samples; j++)
+ for (int j = 0; j < outputs[0].samples(); j++)
{
+ s32 lsum = 0, rsum = 0;
for (int i = 0; i < KDAC_A_PCM_MAX; i++)
{
channel_t *channel = &m_channel[i];
@@ -279,9 +277,11 @@ void k007232_device::sound_stream_update_legacy(sound_stream &stream, stream_sam
int out = (read_sample(i, addr) & 0x7f) - 0x40;
- outputs[0][j] += out * vol_a;
- outputs[1][j] += out * vol_b;
+ lsum += out * vol_a;
+ rsum += out * vol_b;
}
}
+ outputs[0].put_int(j, lsum, 32768);
+ outputs[1].put_int(j, rsum, 32768);
}
}