summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/iremga20.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/iremga20.cpp')
-rw-r--r--src/devices/sound/iremga20.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/devices/sound/iremga20.cpp b/src/devices/sound/iremga20.cpp
index ba49eaa75c4..3c5ac7dfe0f 100644
--- a/src/devices/sound/iremga20.cpp
+++ b/src/devices/sound/iremga20.cpp
@@ -73,7 +73,7 @@ iremga20_device::iremga20_device(const machine_config &mconfig, const char *tag,
void iremga20_device::device_start()
{
- m_stream = stream_alloc_legacy(0, 2, clock()/4);
+ m_stream = stream_alloc(0, 2, clock()/4);
save_item(NAME(m_regs));
for (int i = 0; i < 4; i++)
@@ -126,19 +126,18 @@ void iremga20_device::rom_bank_updated()
}
//-------------------------------------------------
-// sound_stream_update_legacy - handle a stream update
+// sound_stream_update - handle a stream update
//-------------------------------------------------
-void iremga20_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples)
+void iremga20_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
- stream_sample_t *outL, *outR;
+ auto &outL = outputs[0];
+ auto &outR = outputs[1];
- outL = outputs[0];
- outR = outputs[1];
-
- for (int i = 0; i < samples; i++)
+ stream_buffer::sample_t sample_scale = 1.0 / (32768.0 * 4.0);
+ for (int i = 0; i < outL.samples(); i++)
{
- stream_sample_t sampleout = 0;
+ s32 sampleout = 0;
for (auto &ch : m_channel)
{
@@ -160,9 +159,9 @@ void iremga20_device::sound_stream_update_legacy(sound_stream &stream, stream_sa
}
}
- sampleout >>= 2;
- outL[i] = sampleout;
- outR[i] = sampleout;
+ stream_buffer::sample_t final = stream_buffer::sample_t(sampleout) * sample_scale;
+ outL.put(i, final);
+ outR.put(i, final);
}
}