summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/sp0250.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2025-04-14 11:31:53 +0200
committer Olivier Galibert <galibert@pobox.com>2025-04-27 22:23:20 +0200
commitd0f1c15a0f6df2dd51a754cb46e6175b7079c8f2 (patch)
treebe35c94340442af08c316a8679089ee68e119fac /src/devices/sound/sp0250.cpp
parentec636faeba5c5841c5a4a35b7c9dc2f06a00f538 (diff)
New sound infrastructure.
Should be added soon: - mute - speaker/microphone resampling To be added a little later: - compression - reverb Needs to be added by someone else: - coreaudio - direct - portaudio - xaudio2 - js
Diffstat (limited to 'src/devices/sound/sp0250.cpp')
-rw-r--r--src/devices/sound/sp0250.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/devices/sound/sp0250.cpp b/src/devices/sound/sp0250.cpp
index 2c4384888e9..763fc5b11e0 100644
--- a/src/devices/sound/sp0250.cpp
+++ b/src/devices/sound/sp0250.cpp
@@ -257,18 +257,16 @@ int8_t sp0250_device::next()
// sound_stream_update - handle a stream update
//-------------------------------------------------
-void sp0250_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
+void sp0250_device::sound_stream_update(sound_stream &stream)
{
- auto &output = outputs[0];
-
if (!m_pwm_mode)
{
- for (int sampindex = 0; sampindex < output.samples(); sampindex++)
- output.put_int(sampindex, next(), 128);
+ for (int sampindex = 0; sampindex < stream.samples(); sampindex++)
+ stream.put_int(0, sampindex, next(), 128);
}
else
{
- for (int sampindex = 0; sampindex < output.samples(); )
+ for (int sampindex = 0; sampindex < stream.samples(); )
{
// see where we're at in the current PWM cycle
if (m_pwm_index >= PWM_CLOCKS)
@@ -282,7 +280,7 @@ void sp0250_device::sound_stream_update(sound_stream &stream, std::vector<read_s
// determine the value to fill and the number of samples remaining
// until it changes
- stream_buffer::sample_t value;
+ sound_stream::sample_t value;
int remaining;
if (m_pwm_index < m_pwm_count)
{
@@ -296,13 +294,13 @@ void sp0250_device::sound_stream_update(sound_stream &stream, std::vector<read_s
}
// clamp to the number of samples requested and advance the counters
- if (remaining > output.samples() - sampindex)
- remaining = output.samples() - sampindex;
+ if (remaining > stream.samples() - sampindex)
+ remaining = stream.samples() - sampindex;
m_pwm_index += remaining;
// fill the output
while (remaining-- != 0)
- outputs[0].put(sampindex++, value);
+ stream.put(0, sampindex++, value);
}
}
}