summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2020-07-24 11:46:22 +0900
committer cam900 <dbtlrchl@naver.com>2020-07-24 11:46:22 +0900
commitbf976469e425272bfce78a184cd129613fa8ff62 (patch)
treecfbe5ab7cea31e153833ab2e89717c5d8c1b7b72 /src
parentde66b182e83c5848234352f86c8237b0eaf732b0 (diff)
k053260.cpp: Allow side effects
Diffstat (limited to 'src')
-rw-r--r--src/devices/sound/k053260.cpp7
-rw-r--r--src/devices/sound/k053260.h2
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