diff options
Diffstat (limited to 'src/devices/sound/namco.cpp')
-rw-r--r-- | src/devices/sound/namco.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/devices/sound/namco.cpp b/src/devices/sound/namco.cpp index cdad9636209..830f3713b45 100644 --- a/src/devices/sound/namco.cpp +++ b/src/devices/sound/namco.cpp @@ -237,9 +237,9 @@ void namco_audio_device::build_decoded_waveform(uint8_t *rgnbase) /* generate sound by oversampling */ uint32_t namco_audio_device::namco_update_one(write_stream_view &buffer, const int16_t *wave, uint32_t counter, uint32_t freq) { - while (!buffer.done()) + for (int sampindex = 0; sampindex < buffer.samples(); sampindex++) { - buffer.add(stream_buffer::sample_t(wave[WAVEFORM_POSITION(counter)]) * sample_scale); + buffer.add(sampindex, stream_buffer::sample_t(wave[WAVEFORM_POSITION(counter)]) * sample_scale); counter += freq; } @@ -672,8 +672,8 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, std::vector<r /* loop over each voice and add its contribution */ for (sound_channel *voice = m_channel_list; voice < m_last_channel; voice++) { - auto &lmix = outputs[0].reset(); - auto &rmix = outputs[1].reset(); + auto &lmix = outputs[0]; + auto &rmix = outputs[1]; int lv = voice->volume[0]; int rv = voice->volume[1]; @@ -699,13 +699,13 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, std::vector<r if (voice->noise_state) { - lmix.add(stream_buffer::sample_t(l_noise_data) * sample_scale); - rmix.add(stream_buffer::sample_t(r_noise_data) * sample_scale); + lmix.add(i, stream_buffer::sample_t(l_noise_data) * sample_scale); + rmix.add(i, stream_buffer::sample_t(r_noise_data) * sample_scale); } else { - lmix.add(stream_buffer::sample_t(-l_noise_data) * sample_scale); - rmix.add(stream_buffer::sample_t(-r_noise_data) * sample_scale); + lmix.add(i, stream_buffer::sample_t(-l_noise_data) * sample_scale); + rmix.add(i, stream_buffer::sample_t(-r_noise_data) * sample_scale); } if (hold) @@ -779,7 +779,6 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, std::vector<r /* loop over each voice and add its contribution */ for (voice = m_channel_list; voice < m_last_channel; voice++) { - buffer.reset(); int v = voice->volume[0]; if (voice->noise_sw) { @@ -792,16 +791,17 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, std::vector<r uint32_t delta = f << 4; uint32_t c = voice->noise_counter; int16_t noise_data = OUTPUT_LEVEL(0x07 * (v >> 1)); + int i; /* add our contribution */ - while (!buffer.done()) + for (i = 0; i < buffer.samples(); i++) { int cnt; if (voice->noise_state) - buffer.add(stream_buffer::sample_t(noise_data) * sample_scale); + buffer.add(i, stream_buffer::sample_t(noise_data) * sample_scale); else - buffer.add(stream_buffer::sample_t(-noise_data) * sample_scale); + buffer.add(i, stream_buffer::sample_t(-noise_data) * sample_scale); if (hold) { |