summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2021-05-24 18:44:27 +0200
committer Vas Crabb <vas@vastheman.com>2021-05-25 04:09:23 +1000
commit7f6658b5f67d65719d0c7c1eada2627b673c8373 (patch)
tree93e22e2a80310db08097c89ae8338202ddf0f2c0
parentdbb54033db5fc8358e2f5b5ce96cdd030526e846 (diff)
swim: Fixed bugs linked to device selection
-rw-r--r--src/devices/machine/swim1.cpp11
-rw-r--r--src/devices/machine/swim2.cpp2
-rw-r--r--src/devices/machine/swim3.cpp2
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);