summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/ymz280b.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/ymz280b.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/ymz280b.cpp')
-rw-r--r--src/devices/sound/ymz280b.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/devices/sound/ymz280b.cpp b/src/devices/sound/ymz280b.cpp
index 8eced2f7fa8..6873048624f 100644
--- a/src/devices/sound/ymz280b.cpp
+++ b/src/devices/sound/ymz280b.cpp
@@ -417,16 +417,10 @@ int ymz280b_device::generate_pcm16(YMZ280BVoice *voice, s16 *buffer, int samples
// sound_stream_update - handle a stream update
//-------------------------------------------------
-void ymz280b_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
+void ymz280b_device::sound_stream_update(sound_stream &stream)
{
- auto &lacc = outputs[0];
- auto &racc = outputs[1];
int v;
- /* clear out the accumulator */
- lacc.fill(0);
- racc.fill(0);
-
/* loop over voices */
for (v = 0; v < 8; v++)
{
@@ -437,7 +431,7 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, std::vector<read_
s32 sampindex = 0;
u32 new_samples, samples_left;
u32 final_pos;
- int remaining = lacc.samples();
+ int remaining = stream.samples();
int lvol = voice->output_left;
int rvol = voice->output_right;
@@ -454,8 +448,8 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, std::vector<read_
while (remaining > 0 && voice->output_pos < FRAC_ONE)
{
int interp_sample = ((s32(prev) * (FRAC_ONE - voice->output_pos)) + (s32(curr) * voice->output_pos)) >> FRAC_BITS;
- lacc.add_int(sampindex, interp_sample * lvol / 2, 32768 * 256);
- racc.add_int(sampindex, interp_sample * rvol / 2, 32768 * 256);
+ stream.add_int(0, sampindex, interp_sample * lvol / 2, 32768 * 256);
+ stream.add_int(1, sampindex, interp_sample * rvol / 2, 32768 * 256);
sampindex++;
voice->output_pos += voice->output_step;
remaining--;
@@ -519,8 +513,8 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, std::vector<read_
while (remaining > 0 && voice->output_pos < FRAC_ONE)
{
int interp_sample = ((s32(prev) * (FRAC_ONE - voice->output_pos)) + (s32(curr) * voice->output_pos)) >> FRAC_BITS;
- lacc.add_int(sampindex, interp_sample * lvol / 2, 32768 * 256);
- racc.add_int(sampindex, interp_sample * rvol / 2, 32768 * 256);
+ stream.add_int(0, sampindex, interp_sample * lvol / 2, 32768 * 256);
+ stream.add_int(1, sampindex, interp_sample * rvol / 2, 32768 * 256);
sampindex++;
voice->output_pos += voice->output_step;
remaining--;