diff options
author | 2020-09-20 23:01:23 -0400 | |
---|---|---|
committer | 2020-09-20 23:01:23 -0400 | |
commit | 69cc7e883c504f4445d4f97491b2afd825e1c928 (patch) | |
tree | 80585457484b1d366663ac0bff4d8287ab5d07ea /src | |
parent | f6652e9dfb3551fe5c3682e977fc7de11a6daadb (diff) |
es5503: revert to last version that plays correctly
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/sound/es5503.cpp | 25 | ||||
-rw-r--r-- | src/devices/sound/es5503.h | 2 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp index 0d727fc77bf..ebad016852e 100644 --- a/src/devices/sound/es5503.cpp +++ b/src/devices/sound/es5503.cpp @@ -128,19 +128,18 @@ void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int ress } } -void es5503_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) +void es5503_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) { + static int32_t mix[(44100/60)*2*8]; int32_t *mixp; int osc, snum, i; uint32_t ramptr; - if (m_mix_buffer.size() < outputs[0].samples()) - m_mix_buffer.resize(outputs[0].samples()); + assert(samples < (44100/60)*2); + memset(mix, 0, sizeof(mix)); for (int chan = 0; chan < output_channels; chan++) { - std::fill_n(&m_mix_buffer[0], outputs[0].samples(), 0); - for (osc = 0; osc < (oscsenabled+1); osc++) { ES5503Osc *pOsc = &oscillators[osc]; @@ -156,9 +155,9 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vector<read_s int8_t data = -128; int resshift = resshifts[pOsc->resolution] - pOsc->wavetblsize; uint32_t sizemask = accmasks[pOsc->wavetblsize]; - mixp = &m_mix_buffer[0]; + mixp = &mix[0] + chan; - for (snum = 0; snum < outputs[0].samples(); snum++) + for (snum = 0; snum < samples; snum++) { altram = acc >> resshift; ramptr = altram & sizemask; @@ -176,7 +175,7 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vector<read_s else { *mixp += data * vol; - mixp++; + mixp += output_channels; if (altram >= wtsize) { @@ -197,11 +196,11 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vector<read_s pOsc->data = data ^ 0x80; } } - - mixp = &m_mix_buffer[0]; - for (i = 0; i < outputs[chan].samples(); i++) - outputs[chan].put_int(i, *mixp++, 32768 * 8); } + mixp = &mix[0]; + for (i = 0; i < samples; i++) + for (int chan = 0; chan < output_channels; chan++) + outputs[chan][i] = (*mixp++)>>3; } @@ -224,7 +223,7 @@ void es5503_device::device_start() save_pointer(STRUCT_MEMBER(oscillators, irqpend), 32); output_rate = (clock() / 8) / (2 + oscsenabled); - m_stream = stream_alloc(0, output_channels, output_rate); + m_stream = stream_alloc_legacy(0, output_channels, output_rate); m_timer = timer_alloc(0, nullptr); attotime update_rate = output_rate ? attotime::from_hz(output_rate) : attotime::never; diff --git a/src/devices/sound/es5503.h b/src/devices/sound/es5503.h index aaef9096e6c..772ef80dbf7 100644 --- a/src/devices/sound/es5503.h +++ b/src/devices/sound/es5503.h @@ -36,7 +36,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) override; // device_sound_interface overrides - virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; + virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override; // device_rom_interface overrides virtual void rom_bank_updated() override; |