src/mess/machine/wd17xx.c
| r6720 | r6721 | |
| 314 | 314 | |
| 315 | 315 | int hld_count; /* head loaded counter */ |
| 316 | 316 | |
| 317 | /* timers to delay execution/completion of commands */ |
| 318 | emu_timer *timer_cmd, *timer_data, *timer_rs, *timer_ws; |
| 319 | |
| 317 | 320 | /* this is the drive currently selected */ |
| 318 | 321 | const device_config *drive; |
| 319 | 322 | |
| r6720 | r6721 | |
| 480 | 483 | |
| 481 | 484 | w->status |= STA_1_BUSY; |
| 482 | 485 | |
| 483 | | timer_set(device->machine, duration, (void *)device, 0, wd17xx_command_callback); |
| 486 | timer_adjust_oneshot(w->timer_cmd, duration, 0); |
| 484 | 487 | } |
| 485 | 488 | |
| 486 | 489 | |
| r6720 | r6721 | |
| 912 | 915 | usecs = 12; |
| 913 | 916 | |
| 914 | 917 | /* set new timer */ |
| 915 | | timer_set(device->machine, ATTOTIME_IN_USEC(usecs), (void *)device, 0, wd17xx_command_callback); |
| 918 | timer_adjust_oneshot(w->timer_cmd, ATTOTIME_IN_USEC(usecs), 0); |
| 916 | 919 | } |
| 917 | 920 | |
| 918 | 921 | |
| r6720 | r6721 | |
| 1064 | 1067 | usecs = wd17xx_get_datarate_in_us(w->density); |
| 1065 | 1068 | |
| 1066 | 1069 | /* set new timer */ |
| 1067 | | timer_set(device->machine, ATTOTIME_IN_USEC(usecs), (void *)device, 0, wd17xx_data_callback); |
| 1070 | timer_adjust_oneshot(w->timer_data, ATTOTIME_IN_USEC(usecs), 0); |
| 1068 | 1071 | } |
| 1069 | 1072 | |
| 1070 | 1073 | |
| r6720 | r6721 | |
| 1078 | 1081 | usecs = w->pause_time; /* How long should we wait? How about 40 micro seconds? */ |
| 1079 | 1082 | |
| 1080 | 1083 | /* set new timer */ |
| 1081 | | timer_set(device->machine, ATTOTIME_IN_USEC(usecs), (void *)device, 0, wd17xx_read_sector_callback); |
| 1084 | timer_adjust_oneshot(w->timer_rs, ATTOTIME_IN_USEC(usecs), 0); |
| 1082 | 1085 | } |
| 1083 | 1086 | |
| 1084 | 1087 | |
| r6720 | r6721 | |
| 1092 | 1095 | usecs = w->pause_time; /* How long should we wait? How about 40 micro seconds? */ |
| 1093 | 1096 | |
| 1094 | 1097 | /* set new timer */ |
| 1095 | | timer_set(device->machine, ATTOTIME_IN_USEC(usecs), (void *)device, 0, wd17xx_write_sector_callback); |
| 1098 | timer_adjust_oneshot(w->timer_ws, ATTOTIME_IN_USEC(usecs), 0); |
| 1096 | 1099 | } |
| 1097 | 1100 | |
| 1098 | 1101 | |
| r6720 | r6721 | |
| 1802 | 1805 | w->density = DEN_MFM_LO; |
| 1803 | 1806 | w->pause_time = 40; |
| 1804 | 1807 | |
| 1808 | /* allocate timers */ |
| 1809 | w->timer_cmd = timer_alloc(device->machine, wd17xx_command_callback, (void *)device); |
| 1810 | w->timer_data = timer_alloc(device->machine, wd17xx_data_callback, (void *)device); |
| 1811 | w->timer_rs = timer_alloc(device->machine, wd17xx_read_sector_callback, (void *)device); |
| 1812 | w->timer_ws = timer_alloc(device->machine, wd17xx_write_sector_callback, (void *)device); |
| 1813 | |
| 1805 | 1814 | /* resolve callbacks */ |
| 1806 | 1815 | devcb_resolve_write_line(&w->out_intrq_func, &w->intf->out_intrq_func, device); |
| 1807 | 1816 | devcb_resolve_write_line(&w->out_drq_func, &w->intf->out_drq_func, device); |