summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author wilbertpol <wilbertpol@users.noreply.github.com>2022-05-17 03:31:53 +0100
committer GitHub <noreply@github.com>2022-05-16 22:31:53 -0400
commit9a33d692610514e9a9e7949451b29222b2548d68 (patch)
tree9c1932e99906caa16c7ec197f3dac9d3af04151d
parentc504690af5dc9c977584e052c88a0849a387cc23 (diff)
upd7759: Fixes to switching between slave and stand alone mode. (nw) (#9772)
-rw-r--r--src/devices/sound/upd7759.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp
index 1e9a98b8a3d..36738f029a5 100644
--- a/src/devices/sound/upd7759.cpp
+++ b/src/devices/sound/upd7759.cpp
@@ -390,8 +390,6 @@ void upd775x_device::advance_state()
{
// Idle state: we stick around here while there's nothing to do
case STATE_IDLE:
- // If we have dropped back to idle state we always switch back to stand alone mode
- m_mode = MODE_STAND_ALONE;
m_clocks_left = 4;
break;
@@ -678,7 +676,7 @@ void upd7759_device::internal_start_w(int state)
m_channel->update();
- if (m_state == STATE_IDLE && oldstart && !m_start && m_reset)
+ if (m_state == STATE_IDLE && m_mode == MODE_STAND_ALONE && oldstart && !m_start && m_reset)
{
m_state = STATE_START;
@@ -725,11 +723,18 @@ void upd7759_device::internal_md_w(int state)
m_channel->update();
- if (m_state == STATE_IDLE && old_md && !m_md && m_reset)
+ if (m_state == STATE_IDLE && m_reset)
{
- m_mode = MODE_SLAVE;
- m_state = STATE_START;
- m_timer->adjust(attotime::zero);
+ if (old_md && !m_md)
+ {
+ m_mode = MODE_SLAVE;
+ m_state = STATE_START;
+ m_timer->adjust(attotime::zero);
+ }
+ else if (!old_md && m_md)
+ {
+ m_mode = MODE_STAND_ALONE;
+ }
}
}