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.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/devices/machine/swim2.cpp b/src/devices/machine/swim2.cpp
index e45a4edd624..582a97a58b2 100644
--- a/src/devices/machine/swim2.cpp
+++ b/src/devices/machine/swim2.cpp
@@ -128,7 +128,6 @@ u8 swim2_device::read(offs_t offset)
sync();
static const char *const names[] = {
- "?0", "?1", "?2", "?3", "?4", "?5", "?6", "?7",
"data", "mark", "crc", "param", "phases", "setup", "status", "handshake"
};
switch(offset & 7) {
@@ -201,7 +200,7 @@ u8 swim2_device::read(offs_t offset)
}
default:
- logerror("read %s\n", names[offset & 15]);
+ logerror("read %s\n", names[offset & 7]);
break;
}
return 0xff;
@@ -215,7 +214,6 @@ void swim2_device::write(offs_t offset, u8 data)
static const char *const names[] = {
"data", "mark", "crc", "param", "phases", "setup", "mode0", "mode1",
- "?8", "?9", "?a", "?b", "?c", "?d", "?e", "?f"
};
switch(offset & 7) {
@@ -275,7 +273,7 @@ void swim2_device::write(offs_t offset, u8 data)
break;
default:
- logerror("write %s, %02x\n", names[offset], data);
+ logerror("write %s, %02x\n", names[offset & 7], data);
break;
}
@@ -325,11 +323,6 @@ void swim2_device::write(offs_t offset, u8 data)
}
}
-u64 swim2_device::time_to_cycles(const attotime &tm) const
-{
- return tm.as_ticks(clock());
-}
-
void swim2_device::crc_clear()
{
m_crc = 0xcdb4;
@@ -344,6 +337,11 @@ void swim2_device::crc_update(int bit)
}
+u64 swim2_device::time_to_cycles(const attotime &tm) const
+{
+ return tm.as_ticks(clock());
+}
+
attotime swim2_device::cycles_to_time(u64 cycles) const
{
return attotime::from_ticks(cycles, clock());
@@ -373,21 +371,6 @@ u16 swim2_device::fifo_pop()
return r;
}
-// cell times
-// 1 us: 31.32
-// 1.5us: 47.32
-// 2us: 31.16 63.32
-// 3us: 47.16 94.32
-// 4us: 63.16 125.32
-// 6us: 94.16 188.32
-
-// time1 = 31, time0 = 16 for clock /1 mfm
-// time1 =
-
-// 32 mfm, t1=63, t0=31
-// 16 mfm, t1=31.5, t0=15.5
-// 16 gcr, t1=31.5, t0=31.5
-
void swim2_device::sync()
{
u64 next_sync = time_to_cycles(machine().time());
@@ -411,8 +394,7 @@ void swim2_device::sync()
cycles = 0;
break;
}
- }
-
+ }
if(m_tss_output & 0xc) {
bool bit;
@@ -424,7 +406,7 @@ void swim2_device::sync()
m_tss_output = 0;
}
if(bit) {
- if(m_flux_write_count == 32)
+ if(m_flux_write_count == m_flux_write.size())
flush_write(next_sync - (cycles >> 1));
m_flux_write[m_flux_write_count ++] = next_sync - (cycles >> 1);
m_half_cycles_before_change = 63;