summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2020-09-14 20:29:01 +0200
committer hap <happppp@users.noreply.github.com>2020-09-14 20:29:01 +0200
commit44ea7782c1cba1628a0b71bf1b7007eb5e6ed2df (patch)
tree1e20d1a6157acdd6da38dbf2b2bd32312663d953 /src/devices
parent6ebf956324771f79dc1724c86f34af427ba32767 (diff)
i8244: update to use newsound
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/video/i8244.cpp10
-rw-r--r--src/devices/video/i8244.h3
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<read_stream_view> const &inputs, std::vector<write_stream_view> &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<read_stream_view> const &inputs, std::vector<write_stream_view> &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 );