diff options
author | Olivier Galibert <galibert@pobox.com> | 2021-05-24 18:44:27 +0200 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2021-05-24 18:44:38 +0200 |
commit | 602852e530de37c524bcf33438cbc596c5837567 (patch) | |
tree | 5918610e3d8014b7b23383425b08383ab9312742 | |
parent | a80392678a5ba6c1dfee666549fbb049b5ccba98 (diff) |
swim: Fixed bugs linked to device selection
-rw-r--r-- | src/devices/machine/swim1.cpp | 11 | ||||
-rw-r--r-- | src/devices/machine/swim2.cpp | 2 | ||||
-rw-r--r-- | src/devices/machine/swim3.cpp | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/devices/machine/swim1.cpp b/src/devices/machine/swim1.cpp index 75c3b12b186..8e747a219bd 100644 --- a/src/devices/machine/swim1.cpp +++ b/src/devices/machine/swim1.cpp @@ -298,8 +298,12 @@ void swim1_device::ism_write(offs_t offset, u8 data) m_ism_mode &= ~data; m_ism_param_idx = 0; ism_show_mode(); - if(!(m_ism_mode & 0x40)) + if(!(m_ism_mode & 0x40)) { logerror("switch to iwm\n"); + u8 ism_devsel = m_ism_mode & 0x80 ? (m_ism_mode >> 1) & 3 : 0; + if(ism_devsel != m_iwm_devsel) + m_devsel_cb(m_iwm_devsel); + } break; case 0x7: @@ -315,7 +319,7 @@ void swim1_device::ism_write(offs_t offset, u8 data) if(m_ism_mode & 0x01) ism_fifo_clear(); - if((m_ism_mode ^ prev_mode) & 0x06) + if((m_ism_mode ^ prev_mode) & 0x86) m_devsel_cb(m_ism_mode & 0x80 ? (m_ism_mode >> 1) & 3 : 0); if((m_ism_mode ^ prev_mode) & 0x20) m_hdsel_cb((m_ism_mode >> 5) & 1); @@ -533,6 +537,9 @@ u8 swim1_device::iwm_control(int offset, u8 data) if(data & 0x40) { m_ism_mode |= 0x40; logerror("switch to ism\n"); + u8 ism_devsel = m_ism_mode & 0x80 ? (m_ism_mode >> 1) & 3 : 0; + if(ism_devsel != m_iwm_devsel) + m_devsel_cb(ism_devsel); } break; } diff --git a/src/devices/machine/swim2.cpp b/src/devices/machine/swim2.cpp index da26c70cb41..69b718a4cef 100644 --- a/src/devices/machine/swim2.cpp +++ b/src/devices/machine/swim2.cpp @@ -297,7 +297,7 @@ void swim2_device::write(offs_t offset, u8 data) if(m_mode & 0x01) fifo_clear(); - if((m_mode ^ prev_mode) & 0x06) + if((m_mode ^ prev_mode) & 0x86) m_devsel_cb(m_mode & 0x80 ? (m_mode >> 1) & 3 : 0); if((m_mode ^ prev_mode) & 0x20) m_hdsel_cb((m_mode >> 5) & 1); diff --git a/src/devices/machine/swim3.cpp b/src/devices/machine/swim3.cpp index ec24c6e2606..1be0e9937f6 100644 --- a/src/devices/machine/swim3.cpp +++ b/src/devices/machine/swim3.cpp @@ -254,7 +254,7 @@ void swim3_device::write(offs_t offset, u8 data) break; } - if((m_mode ^ prev_mode) & 0x06) + if((m_mode ^ prev_mode) & 0x86) m_devsel_cb((m_mode >> 1) & 3); if((m_mode ^ prev_mode) & 0x20) m_hdsel_cb((m_mode >> 5) & 1); |