From bf976469e425272bfce78a184cd129613fa8ff62 Mon Sep 17 00:00:00 2001 From: cam900 Date: Fri, 24 Jul 2020 11:46:22 +0900 Subject: [PATCH] k053260.cpp: Allow side effects --- src/devices/sound/k053260.cpp | 7 ++++--- src/devices/sound/k053260.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/devices/sound/k053260.cpp b/src/devices/sound/k053260.cpp index 859a1fd30e9..05b08c95131 100644 --- a/src/devices/sound/k053260.cpp +++ b/src/devices/sound/k053260.cpp @@ -210,7 +210,7 @@ u8 k053260_device::read(offs_t offset) case 0x2e: // read ROM if (m_mode & 1) - ret = m_voice[0].read_rom(); + ret = m_voice[0].read_rom(!(machine().side_effects_disabled())); else logerror("%s: Attempting to read K053260 ROM without mode bit set\n", machine().describe_context()); break; @@ -494,11 +494,12 @@ void k053260_device::KDSC_Voice::play(stream_sample_t *outputs) outputs[1] += (m_output * m_pan_volume[1]) >> 15; } -u8 k053260_device::KDSC_Voice::read_rom() +u8 k053260_device::KDSC_Voice::read_rom(bool side_effects) { u32 offs = m_start + m_position; - m_position = (m_position + 1) & 0xffff; + if (side_effects) + m_position = (m_position + 1) & 0xffff; return m_device.read_byte(offs); } diff --git a/src/devices/sound/k053260.h b/src/devices/sound/k053260.h index e556e23a7a6..648fa00cb58 100644 --- a/src/devices/sound/k053260.h +++ b/src/devices/sound/k053260.h @@ -81,7 +81,7 @@ private: inline void key_off(); inline void play(stream_sample_t *outputs); inline bool playing() { return m_playing; } - inline u8 read_rom(); + inline u8 read_rom(bool side_effects); private: // pointer to owning device