summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/swim2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/swim2.cpp')
-rw-r--r--src/devices/machine/swim2.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/devices/machine/swim2.cpp b/src/devices/machine/swim2.cpp
index d5fd0a01c1f..788c6dd7aca 100644
--- a/src/devices/machine/swim2.cpp
+++ b/src/devices/machine/swim2.cpp
@@ -97,17 +97,22 @@ void swim2_device::flush_write(u64 when)
when = m_last_sync;
if(m_floppy && when > m_flux_write_start) {
- if(m_flux_write_count && m_flux_write[m_flux_write_count-1] == when)
+ bool last_on_edge = m_flux_write_count && m_flux_write[m_flux_write_count-1] == when;
+ if(last_on_edge)
m_flux_write_count--;
+
attotime start = cycles_to_time(m_flux_write_start);
attotime end = cycles_to_time(when);
std::vector<attotime> fluxes(m_flux_write_count);
for(u32 i=0; i != m_flux_write_count; i++)
fluxes[i] = cycles_to_time(m_flux_write[i]);
m_floppy->write_flux(start, end, m_flux_write_count, m_flux_write_count ? &fluxes[0] : nullptr);
- }
- m_flux_write_count = 0;
- m_flux_write_start = when;
+
+ m_flux_write_count = 0;
+ if(last_on_edge)
+ m_flux_write[m_flux_write_count++] = when;
+ } else
+ m_flux_write_count = 0;
}
void swim2_device::show_mode() const