summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/swim2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/swim2.h')
-rw-r--r--src/devices/machine/swim2.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/devices/machine/swim2.h b/src/devices/machine/swim2.h
index dc729fe533e..bab440e4ec9 100644
--- a/src/devices/machine/swim2.h
+++ b/src/devices/machine/swim2.h
@@ -11,6 +11,7 @@
#pragma once
#include "applefdintf.h"
+#include "fdc_pll.h"
//**************************************************************************
@@ -30,17 +31,44 @@ public:
virtual void set_floppy(floppy_image_device *floppy) override;
virtual floppy_image_device *get_floppy() const override;
+ virtual void sync() override;
+
protected:
virtual void device_start() override;
virtual void device_reset() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
+ enum {
+ M_MARK = 0x100,
+ M_CRC = 0x200,
+ M_CRC0 = 0x400
+ };
+
floppy_image_device *m_floppy;
u8 m_param[4];
- u8 m_mode, m_setup, m_param_idx;
+ u8 m_mode, m_setup, m_error, m_param_idx, m_fifo_pos, m_tss_sr, m_tss_output, m_current_bit;
+ u16 m_fifo[2], m_sr;
+ u16 m_crc, m_mfm_sync_counter;
+ u32 m_half_cycles_before_change;
+
+ u64 m_last_sync;
+ u64 m_flux_write_start;
+ std::array<u64, 32> m_flux_write;
+ u32 m_flux_write_count;
+ fdc_pll_t m_pll;
+
+ u64 time_to_cycles(const attotime &tm) const;
+ attotime cycles_to_time(u64 cycles) const;
+
+ void fifo_clear();
+ bool fifo_push(u16 data);
+ u16 fifo_pop();
+ void flush_write(u64 when = 0);
void show_mode() const;
+
+ void crc_update(int bit);
+ void crc_clear();
};
DECLARE_DEVICE_TYPE(SWIM2, swim2_device)