From 0d23c0f6ea771f54a367861f379f6e7ca62d1ced Mon Sep 17 00:00:00 2001 From: tim lindner Date: Sat, 11 Mar 2017 15:08:11 -0800 Subject: Overrided device device method to support changing clock frequencies in the ay8910. --- src/devices/sound/ay8910.cpp | 5 +++++ src/devices/sound/ay8910.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp index 0f92d483c46..4583c11a591 100644 --- a/src/devices/sound/ay8910.cpp +++ b/src/devices/sound/ay8910.cpp @@ -991,6 +991,11 @@ void ay8910_device::ay_set_clock(int clock) m_channel->set_sample_rate( clock / 8 ); } +void ay8910_device::device_clock_changed() +{ + ay_set_clock(clock()); +} + void ay8910_device::ay8910_write_ym(int addr, uint8_t data) { if (addr & 1) diff --git a/src/devices/sound/ay8910.h b/src/devices/sound/ay8910.h index 0592d6c6cfa..a3cc28af0be 100644 --- a/src/devices/sound/ay8910.h +++ b/src/devices/sound/ay8910.h @@ -156,6 +156,7 @@ protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; + void device_clock_changed() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; -- cgit v1.2.3 From f825f7147bdccb514971ef77dbbf84912b34b22a Mon Sep 17 00:00:00 2001 From: tim lindner Date: Sat, 11 Mar 2017 15:42:19 -0800 Subject: Added virtual keyword to declaration. --- src/devices/sound/ay8910.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/sound/ay8910.h b/src/devices/sound/ay8910.h index a3cc28af0be..c4ea3f0f603 100644 --- a/src/devices/sound/ay8910.h +++ b/src/devices/sound/ay8910.h @@ -156,7 +156,7 @@ protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - void device_clock_changed() override; + virtual void device_clock_changed() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; -- cgit v1.2.3