From 44ea7782c1cba1628a0b71bf1b7007eb5e6ed2df Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 14 Sep 2020 20:29:01 +0200 Subject: i8244: update to use newsound --- src/devices/video/i8244.cpp | 10 +++++----- src/devices/video/i8244.h | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp index 5a4a1551cc0..8288dd9e552 100644 --- a/src/devices/video/i8244.cpp +++ b/src/devices/video/i8244.cpp @@ -129,7 +129,7 @@ void i8244_device::device_start() m_hblank_timer->adjust(screen().time_until_pos(0, m_hblank_start), 0, screen().scan_period()); // allocate a stream - m_stream = stream_alloc_legacy(0, 1, clock()); + m_stream = stream_alloc(0, 1, clock()); // register our state memset(m_vdc.reg, 0, 0x100); @@ -740,16 +740,16 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap } -void i8244_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) +void i8244_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { u8 volume = m_vdc.s.sound & 0xf; - int sample_on = (m_sh_output & m_vdc.s.sound >> 7) * 0x4000; + stream_buffer::sample_t sample_on = (m_sh_output & m_vdc.s.sound >> 7) * 0.5; - for (int i = 0; i < samples; i++) + for (int i = 0; i < outputs[0].samples(); i++) { // clock duty cycle m_sh_duty = (m_sh_duty + 1) & 0xf; - outputs[0][i] = (m_sh_duty < volume) ? sample_on : 0; + outputs[0].put(i, (m_sh_duty < volume) ? sample_on : 0.0); } } diff --git a/src/devices/video/i8244.h b/src/devices/video/i8244.h index ebcbebbdea3..3568f5a613d 100644 --- a/src/devices/video/i8244.h +++ b/src/devices/video/i8244.h @@ -97,11 +97,10 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; // 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(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; virtual void set_default_params(); - //void render_scanline(int vpos); int get_y_beam(); int get_x_beam(); offs_t fix_register_mirrors( offs_t offset ); -- cgit v1.2.3