summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/iwm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/iwm.cpp')
-rw-r--r--src/devices/machine/iwm.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/devices/machine/iwm.cpp b/src/devices/machine/iwm.cpp
index af955e30978..d1dcf79046a 100644
--- a/src/devices/machine/iwm.cpp
+++ b/src/devices/machine/iwm.cpp
@@ -144,6 +144,7 @@ void iwm_device::flush_write()
u8 iwm_device::control(int offset, u8 data)
{
sync();
+
// logerror("control trigger %x, %02x\n", offset, data);
u8 changed = m_control | (m_phases & 0xf);
if(offset < 8) {
@@ -336,6 +337,8 @@ u64 iwm_device::write_sync_half_window_size() const
return m_mode & 0x08 ? 2 : 4;
}
+static u64 ssx1 = 0, ssx2 = 0;
+
void iwm_device::sync()
{
if(!m_active)
@@ -355,6 +358,12 @@ void iwm_device::sync()
next_flux_change = flux.is_never() ? u64(-1) : time_to_cycles(flux);
if(next_flux_change <= m_last_sync)
next_flux_change = m_last_sync+1;
+ if(!ssx1)
+ ssx1 = ssx2 = next_flux_change;
+ if(ssx2 != next_flux_change) {
+ ssx1 = ssx2;
+ ssx2 = next_flux_change;
+ }
}
if(next_sync < m_next_state_change) {
m_last_sync = next_sync;
@@ -399,7 +408,6 @@ void iwm_device::sync()
} else if(m_rsh >= 0x80) {
m_data = m_rsh;
m_async_update = 0;
- // logerror("%s %010d DATAR %s %02x\n", cycles_to_time(m_last_sync).to_string(), m_last_sync, m_floppy->tag(), m_data);
m_rsh = 0;
}
break;
@@ -429,7 +437,6 @@ void iwm_device::sync()
m_last_sync = m_next_state_change;
switch(m_rw_state) {
case S_IDLE:
- // logerror("%s: idle\n", attotime::from_ticks(m_last_sync, clock()).to_string());
m_flux_write_count = 0;
if(m_mode & 0x02) {
m_rw_state = SW_WINDOW_LOAD;
@@ -446,9 +453,7 @@ void iwm_device::sync()
break;
case SW_WINDOW_LOAD:
- // logerror("%s: window load\n", attotime::from_ticks(m_last_sync, clock()).to_string());
if(m_whd & 0x80) {
- // logerror("Underrun\n");
m_whd &= ~0x40;
m_rw_state = S_IDLE;
m_last_sync = next_sync;
@@ -461,7 +466,6 @@ void iwm_device::sync()
break;
case SW_WINDOW_MIDDLE:
- // logerror("%s: window middle\n", attotime::from_ticks(m_last_sync, clock()).to_string());
if(m_wsh & 0x80)
m_flux_write[m_flux_write_count++] = m_last_sync;
m_wsh <<= 1;
@@ -473,7 +477,6 @@ void iwm_device::sync()
break;
case SW_WINDOW_END:
- // logerror("%s: window end\n", attotime::from_ticks(m_last_sync, clock()).to_string());
if(m_flux_write_count == m_flux_write.size())
flush_write();
if(m_mode & 0x02) {