diff options
author | 2025-04-14 11:31:53 +0200 | |
---|---|---|
committer | 2025-04-27 22:23:20 +0200 | |
commit | d0f1c15a0f6df2dd51a754cb46e6175b7079c8f2 (patch) | |
tree | be35c94340442af08c316a8679089ee68e119fac /src/devices/sound/ics2115.cpp | |
parent | ec636faeba5c5841c5a4a35b7c9dc2f06a00f538 (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/ics2115.cpp')
-rw-r--r-- | src/devices/sound/ics2115.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp index 49124cd5a38..bf52eb2a7a3 100644 --- a/src/devices/sound/ics2115.cpp +++ b/src/devices/sound/ics2115.cpp @@ -421,13 +421,13 @@ void ics2115_device::ics2115_voice::update_ramp() } } -int ics2115_device::fill_output(ics2115_voice& voice, std::vector<write_stream_view> &outputs) +int ics2115_device::fill_output(ics2115_voice& voice, sound_stream &stream) { bool irq_invalid = false; const u16 fine = 1 << (3*(voice.vol.incr >> 6)); voice.vol.add = (voice.vol.incr & 0x3f)<< (10 - fine); - for (int i = 0; i < outputs[0].samples(); i++) + for (int i = 0; i < stream.samples(); i++) { constexpr int RAMP_SHIFT = 6; const u32 volacc = (voice.vol.acc >> 14) & 0xfff; @@ -448,8 +448,8 @@ int ics2115_device::fill_output(ics2115_voice& voice, std::vector<write_stream_v //if (voice.playing()) if (!m_vmode || voice.playing()) { - outputs[0].add_int(i, (sample * vleft) >> (5 + volume_bits), 32768); - outputs[1].add_int(i, (sample * vright) >> (5 + volume_bits), 32768); + stream.add_int(0, i, (sample * vleft) >> (5 + volume_bits), 32768); + stream.add_int(1, i, (sample * vright) >> (5 + volume_bits), 32768); } voice.update_ramp(); @@ -464,11 +464,8 @@ int ics2115_device::fill_output(ics2115_voice& voice, std::vector<write_stream_v return irq_invalid; } -void ics2115_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) +void ics2115_device::sound_stream_update(sound_stream &stream) { - outputs[0].fill(0); - outputs[1].fill(0); - bool irq_invalid = false; for (int osc = 0; osc <= m_active_osc; osc++) { @@ -485,7 +482,7 @@ void ics2115_device::sound_stream_update(sound_stream &stream, std::vector<read_ logerror("[%06x=%04x]", curaddr, (s16)sample); #endif */ - if (fill_output(voice, outputs)) + if (fill_output(voice, stream)) irq_invalid = true; #ifdef ICS2115_DEBUG |