summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/ieee488/c2040fdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/bus/ieee488/c2040fdc.c')
-rw-r--r--src/emu/bus/ieee488/c2040fdc.c187
1 files changed, 0 insertions, 187 deletions
diff --git a/src/emu/bus/ieee488/c2040fdc.c b/src/emu/bus/ieee488/c2040fdc.c
index 48b888bd9f8..5440176cced 100644
--- a/src/emu/bus/ieee488/c2040fdc.c
+++ b/src/emu/bus/ieee488/c2040fdc.c
@@ -9,15 +9,6 @@
**********************************************************************/
-/*
-
- TODO:
-
- - writing starts in the middle of a byte
- - 8050 PLL
-
-*/
-
#include "c2040fdc.h"
@@ -35,7 +26,6 @@
//**************************************************************************
const device_type C2040_FDC = &device_creator<c2040_fdc_t>;
-const device_type C8050_FDC = &device_creator<c8050_fdc_t>;
//-------------------------------------------------
@@ -67,31 +57,6 @@ const rom_entry *c2040_fdc_t::device_rom_region() const
// c2040_fdc_t - constructor
//-------------------------------------------------
-c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
- device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
- m_write_sync(*this),
- m_write_ready(*this),
- m_write_error(*this),
- m_gcr_rom(*this, "gcr"),
- m_floppy0(NULL),
- m_floppy1(NULL),
- m_mtr0(1),
- m_mtr1(1),
- m_stp0(0),
- m_stp1(0),
- m_ds(0),
- m_drv_sel(0),
- m_mode_sel(0),
- m_rw_sel(0),
- m_period(attotime::from_hz(clock))
-{
- cur_live.tm = attotime::never;
- cur_live.state = IDLE;
- cur_live.next_state = -1;
- cur_live.write_position = 0;
- cur_live.write_start_time = attotime::never;
-}
-
c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, C2040_FDC, "C2040 FDC", tag, owner, clock, "c2040fdc", __FILE__),
m_write_sync(*this),
@@ -118,9 +83,6 @@ c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, const char *tag, device_
cur_live.drv_sel = m_drv_sel;
}
-c8050_fdc_t::c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- c2040_fdc_t(mconfig, C8050_FDC, "C8050 FDC", tag, owner, clock, "c8050fdc", __FILE__) { }
-
//-------------------------------------------------
@@ -635,152 +597,3 @@ void c2040_fdc_t::set_floppy(floppy_image_device *floppy0, floppy_image_device *
m_floppy0 = floppy0;
m_floppy1 = floppy1;
}
-
-void c8050_fdc_t::live_start()
-{
- cur_live.tm = machine().time();
- cur_live.state = RUNNING;
- cur_live.next_state = -1;
-
- cur_live.shift_reg = 0;
- cur_live.shift_reg_write = 0;
- cur_live.cycle_counter = 0;
- cur_live.cell_counter = 0;
- cur_live.bit_counter = 0;
- cur_live.ds = m_ds;
- cur_live.drv_sel = m_drv_sel;
- cur_live.mode_sel = m_mode_sel;
- cur_live.rw_sel = m_rw_sel;
- cur_live.pi = m_pi;
-
- pll_reset(cur_live.tm, attotime::from_double(0));
- checkpoint_live = cur_live;
- pll_save_checkpoint();
-
- live_run();
-}
-
-void c8050_fdc_t::pll_reset(const attotime &when, const attotime clock)
-{
- cur_pll.reset(when);
- cur_pll.set_clock(clock);
-}
-
-void c8050_fdc_t::pll_save_checkpoint()
-{
- checkpoint_pll = cur_pll;
-}
-
-void c8050_fdc_t::pll_retrieve_checkpoint()
-{
- cur_pll = checkpoint_pll;
-}
-
-void c8050_fdc_t::checkpoint()
-{
- checkpoint_live = cur_live;
- pll_save_checkpoint();
-}
-
-void c8050_fdc_t::rollback()
-{
- cur_live = checkpoint_live;
- pll_retrieve_checkpoint();
-}
-
-void c8050_fdc_t::live_run(const attotime &limit)
-{
- if(cur_live.state == IDLE || cur_live.next_state != -1)
- return;
-
- for(;;) {
- switch(cur_live.state) {
- case RUNNING: {
- bool syncpoint = false;
-
- if (cur_live.tm > limit)
- return;
-
- int bit = get_next_bit(cur_live.tm, limit);
- if(bit < 0)
- return;
-
- if (syncpoint) {
- commit(cur_live.tm);
-
- cur_live.tm += m_period;
- live_delay(RUNNING_SYNCPOINT);
- return;
- }
-
- cur_live.tm += m_period;
- break;
- }
-
- case RUNNING_SYNCPOINT: {
- m_write_ready(cur_live.ready);
- m_write_sync(cur_live.sync);
- m_write_error(cur_live.error);
-
- cur_live.state = RUNNING;
- checkpoint();
- break;
- }
- }
- }
-}
-
-int c8050_fdc_t::get_next_bit(attotime &tm, const attotime &limit)
-{
- return cur_pll.get_next_bit(tm, get_floppy(), limit);
-}
-
-void c8050_fdc_t::stp_w(floppy_image_device *floppy, int mtr, int &old_stp, int stp)
-{
- if (mtr) return;
-
- int tracks = 0;
-
- switch (old_stp)
- {
- case 0: if (stp == 1) tracks++; else if (stp == 2) tracks--; break;
- case 1: if (stp == 3) tracks++; else if (stp == 0) tracks--; break;
- case 2: if (stp == 0) tracks++; else if (stp == 3) tracks--; break;
- case 3: if (stp == 2) tracks++; else if (stp == 1) tracks--; break;
- }
-
- if (tracks == -1)
- {
- floppy->dir_w(1);
- floppy->stp_w(1);
- floppy->stp_w(0);
- }
- else if (tracks == 1)
- {
- floppy->dir_w(0);
- floppy->stp_w(1);
- floppy->stp_w(0);
- }
-
- old_stp = stp;
-}
-
-WRITE_LINE_MEMBER( c8050_fdc_t::odd_hd_w )
-{
- if (m_odd_hd != state)
- {
- live_sync();
- m_odd_hd = cur_live.odd_hd = state;
- if (LOG) logerror("%s ODD HD %u\n", machine().time().as_string(), state);
- m_floppy0->ss_w(!state);
- if (m_floppy1) m_floppy1->ss_w(!state);
- checkpoint();
- live_run();
- }
-}
-
-WRITE_LINE_MEMBER( c8050_fdc_t::pull_sync_w )
-{
- // TODO
- if (LOG) logerror("%s PULL SYNC %u\n", machine().time().as_string(), state);
-}