mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
Merge pull request #3929 from hp9k/hp9122c_motor_timer
hp9122c: add motor off timer (nw)
This commit is contained in:
commit
f0b81ff6aa
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user