summaryrefslogtreecommitdiffstats
path: root/src/devices/machine/wd1010.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/wd1010.cpp')
-rw-r--r--src/devices/machine/wd1010.cpp81
1 files changed, 42 insertions, 39 deletions
diff --git a/src/devices/machine/wd1010.cpp b/src/devices/machine/wd1010.cpp
index 859b5bbe2bf..cef0b5d9dd2 100644
--- a/src/devices/machine/wd1010.cpp
+++ b/src/devices/machine/wd1010.cpp
@@ -96,9 +96,9 @@ void wd1010_device::device_start()
m_out_data_cb.resolve_safe();
// allocate timer
- m_seek_timer = timer_alloc(TIMER_SEEK);
- m_read_timer = timer_alloc(TIMER_READ);
- m_write_timer = timer_alloc(TIMER_WRITE);
+ m_seek_timer = timer_alloc(FUNC(wd1010_device::update_seek), this);
+ m_read_timer = timer_alloc(FUNC(wd1010_device::delayed_read), this);
+ m_write_timer = timer_alloc(FUNC(wd1010_device::delayed_write), this);
// register for save states
save_item(NAME(m_intrq));
@@ -124,59 +124,62 @@ void wd1010_device::device_reset()
}
//-------------------------------------------------
-// device_timer - device-specific timer
+// update_seek -
//-------------------------------------------------
-void wd1010_device::device_timer(emu_timer &timer, device_timer_id tid, int param)
+TIMER_CALLBACK_MEMBER(wd1010_device::update_seek)
{
- switch (tid)
+ if ((m_command >> 4) != CMD_SCAN_ID)
{
- case TIMER_SEEK:
-
- if ((m_command >> 4) != CMD_SCAN_ID)
- {
- LOGSEEK("Seek complete\n");
- m_drives[drive()].cylinder = param;
- m_status |= STATUS_SC;
- }
+ LOGSEEK("Seek complete\n");
+ m_drives[drive()].cylinder = param;
+ m_status |= STATUS_SC;
+ }
- switch (m_command >> 4)
- {
- case CMD_RESTORE:
- cmd_restore();
- break;
-
- case CMD_SEEK:
- cmd_seek();
- break;
-
- case CMD_READ_SECTOR:
- cmd_read_sector();
- break;
-
- case CMD_WRITE_SECTOR:
- case CMD_WRITE_FORMAT:
- cmd_write_sector();
- break;
-
- case CMD_SCAN_ID:
- cmd_scan_id();
- break;
- }
+ switch (m_command >> 4)
+ {
+ case CMD_RESTORE:
+ cmd_restore();
+ break;
+ case CMD_SEEK:
+ cmd_seek();
break;
- case TIMER_READ:
+ case CMD_READ_SECTOR:
cmd_read_sector();
break;
- case TIMER_WRITE:
+ case CMD_WRITE_SECTOR:
+ case CMD_WRITE_FORMAT:
cmd_write_sector();
break;
+
+ case CMD_SCAN_ID:
+ cmd_scan_id();
+ break;
}
}
//-------------------------------------------------
+// delayed_read -
+//-------------------------------------------------
+
+TIMER_CALLBACK_MEMBER(wd1010_device::delayed_read)
+{
+ cmd_read_sector();
+}
+
+//-------------------------------------------------
+// delayed_write -
+//-------------------------------------------------
+
+TIMER_CALLBACK_MEMBER(wd1010_device::delayed_write)
+{
+ cmd_write_sector();
+}
+
+//-------------------------------------------------
// set_error - set error and adjust status
//-------------------------------------------------