mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
es5503: revert to last version that plays correctly
This commit is contained in:
parent
f6652e9dfb
commit
69cc7e883c
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user