mirror of
https://github.com/holub/mame
synced 2025-07-05 01:48:29 +03:00
es5503: re-modernized, no breakage this time. [R. Belmont]
This commit is contained in:
parent
002ebf0d07
commit
210d93e33f
@ -127,13 +127,13 @@ void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int ress
|
|||||||
m_irq_func(1);
|
m_irq_func(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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];
|
static int32_t mix[(44100/60)*2*8];
|
||||||
int32_t *mixp;
|
int32_t *mixp;
|
||||||
int osc, snum, i;
|
int osc, snum, i;
|
||||||
uint32_t ramptr;
|
uint32_t ramptr;
|
||||||
|
int samples = outputs[0].samples();
|
||||||
|
|
||||||
assert(samples < (44100/60)*2);
|
assert(samples < (44100/60)*2);
|
||||||
memset(mix, 0, sizeof(mix));
|
memset(mix, 0, sizeof(mix));
|
||||||
@ -198,9 +198,10 @@ void es5503_device::sound_stream_update_legacy(sound_stream &stream, stream_samp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mixp = &mix[0];
|
mixp = &mix[0];
|
||||||
for (i = 0; i < samples; i++)
|
constexpr stream_buffer::sample_t sample_scale = 1.0 / (32768.0 * 8.0);
|
||||||
for (int chan = 0; chan < output_channels; chan++)
|
for (int chan = 0; chan < output_channels; chan++)
|
||||||
outputs[chan][i] = (*mixp++)>>3;
|
for (i = 0; i < outputs[chan].samples(); i++)
|
||||||
|
outputs[chan].put(i, stream_buffer::sample_t(*mixp++) * sample_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -223,7 +224,7 @@ void es5503_device::device_start()
|
|||||||
save_pointer(STRUCT_MEMBER(oscillators, irqpend), 32);
|
save_pointer(STRUCT_MEMBER(oscillators, irqpend), 32);
|
||||||
|
|
||||||
output_rate = (clock() / 8) / (2 + oscsenabled);
|
output_rate = (clock() / 8) / (2 + oscsenabled);
|
||||||
m_stream = stream_alloc_legacy(0, output_channels, output_rate);
|
m_stream = stream_alloc(0, output_channels, output_rate);
|
||||||
|
|
||||||
m_timer = timer_alloc(0, nullptr);
|
m_timer = timer_alloc(0, nullptr);
|
||||||
attotime update_rate = output_rate ? attotime::from_hz(output_rate) : attotime::never;
|
attotime update_rate = output_rate ? attotime::from_hz(output_rate) : attotime::never;
|
||||||
|
@ -36,7 +36,8 @@ protected:
|
|||||||
virtual void device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) override;
|
virtual void device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) override;
|
||||||
|
|
||||||
// device_sound_interface overrides
|
// device_sound_interface overrides
|
||||||
virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
//virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
|
||||||
|
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
|
||||||
|
|
||||||
// device_rom_interface overrides
|
// device_rom_interface overrides
|
||||||
virtual void rom_bank_updated() override;
|
virtual void rom_bank_updated() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user