diff options
author | Sven Schnelle <svens@stackframe.org> | 2018-07-04 18:54:55 +0200 |
---|---|---|
committer | Sven Schnelle <svens@stackframe.org> | 2018-08-31 21:39:42 +0200 |
commit | 9f476fa0ade4eca7e00f9d956090ff052c77b295 (patch) | |
tree | e5e5ea9cda4fb91b4ecd8387c4d78393523f9c28 | |
parent | d353e05016994aad1f3f35f56db9275b85c08040 (diff) |
hp9122c: add motor off timer (nw)
-rw-r--r-- | src/devices/bus/ieee488/hp9122c.cpp | 14 | ||||
-rw-r--r-- | src/devices/bus/ieee488/hp9122c.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/devices/bus/ieee488/hp9122c.cpp b/src/devices/bus/ieee488/hp9122c.cpp index 94c52a7512f..5075e01a38c 100644 --- a/src/devices/bus/ieee488/hp9122c.cpp +++ b/src/devices/bus/ieee488/hp9122c.cpp @@ -85,6 +85,16 @@ void hp9122c_device::device_start() save_item(NAME(m_index_int)); save_item(NAME(m_ds0)); save_item(NAME(m_ds1)); + + m_motor_timer = timer_alloc(0); +} + +void hp9122c_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + floppy_image_device *floppy0 = m_floppy[0]->get_device(); + floppy_image_device *floppy1 = m_floppy[1]->get_device(); + floppy0->mon_w(1); + floppy1->mon_w(1); } void hp9122c_device::device_reset() @@ -287,10 +297,14 @@ WRITE8_MEMBER(hp9122c_device::cmd_w) floppy0->mon_w(0); floppy0->ss_w(!(data & REG_CNTL_HEADSEL)); m_fdc->set_floppy(floppy0); + m_motor_timer->reset(); } else if (m_ds1) { floppy1->mon_w(0); floppy1->ss_w(!(data & REG_CNTL_HEADSEL)); m_fdc->set_floppy(floppy1); + m_motor_timer->reset(); + } else { + m_motor_timer->adjust(attotime::from_msec(2000)); } if (data & REG_CNTL_CLOCK_SEL) diff --git a/src/devices/bus/ieee488/hp9122c.h b/src/devices/bus/ieee488/hp9122c.h index 8b51af38e28..4bd51888e26 100644 --- a/src/devices/bus/ieee488/hp9122c.h +++ b/src/devices/bus/ieee488/hp9122c.h @@ -118,6 +118,7 @@ private: DECLARE_WRITE8_MEMBER(fdc_write); void cpu_map(address_map &map); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; required_device<cpu_device> m_cpu; required_device<i8291a_device> m_i8291a; @@ -143,6 +144,8 @@ private: bool m_ds0; bool m_ds1; + + emu_timer *m_motor_timer; }; // device type definition |