summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/dmadac.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/dmadac.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/dmadac.cpp')
-rw-r--r--src/devices/sound/dmadac.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/devices/sound/dmadac.cpp b/src/devices/sound/dmadac.cpp
index ae2ebce61ad..e1e937069b6 100644
--- a/src/devices/sound/dmadac.cpp
+++ b/src/devices/sound/dmadac.cpp
@@ -158,7 +158,7 @@ void dmadac_set_volume(dmadac_sound_device **devlist, uint8_t num_channels, uint
void dmadac_sound_device::set_volume(uint16_t volume)
{
m_channel->update();
- m_volume = stream_buffer::sample_t(volume) * (1.0 / 256.0);
+ m_volume = sound_stream::sample_t(volume) * (1.0 / 256.0);
}
DEFINE_DEVICE_TYPE(DMADAC, dmadac_sound_device, "dmadac", "DMA-driven DAC")
@@ -178,23 +178,19 @@ dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const ch
// sound_stream_update - handle a stream update
//-------------------------------------------------
-void dmadac_sound_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
+void dmadac_sound_device::sound_stream_update(sound_stream &stream)
{
- auto &output = outputs[0];
uint32_t curout = m_bufout;
uint32_t curin = m_bufin;
- /* feed as much as we can */
+ /* feed as much as we can, leave the rest as silence */
int sampindex;
- for (sampindex = 0; curout != curin && sampindex < output.samples(); sampindex++)
+ for (sampindex = 0; curout != curin && sampindex < stream.samples(); sampindex++)
{
- output.put(sampindex, stream_buffer::sample_t(m_buffer[curout]) * m_volume);
+ stream.put(0, sampindex, sound_stream::sample_t(m_buffer[curout]) * m_volume);
curout = (curout + 1) % BUFFER_SIZE;
}
- /* fill the rest with silence */
- output.fill(0, sampindex);
-
/* save the new output pointer */
m_bufout = curout;
}