Merge pull request #6997 from cam900/k053260_side

k053260.cpp: Allow side effects
This commit is contained in:
ajrhacker 2020-07-24 09:41:37 -04:00 committed by GitHub
commit 7249e5e5bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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);
}

View File

@ -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