Previous 15994 Revisions Next

r6721 Tuesday 22nd December, 2009 at 10:54:38 UTC by Dirk Best
[WD17XX] Avoid anonymous timers
[src/mess/machine]wd17xx.c

src/mess/machine/wd17xx.c
r6720r6721
314314
315315   int     hld_count;            /* head loaded counter */
316316
317   /* timers to delay execution/completion of commands */
318   emu_timer *timer_cmd, *timer_data, *timer_rs, *timer_ws;
319
317320   /* this is the drive currently selected */
318321   const device_config *drive;
319322
r6720r6721
480483
481484   w->status |= STA_1_BUSY;
482485
483   timer_set(device->machine, duration, (void *)device, 0, wd17xx_command_callback);
486   timer_adjust_oneshot(w->timer_cmd, duration, 0);
484487}
485488
486489
r6720r6721
912915   usecs = 12;
913916
914917   /* 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);
916919}
917920
918921
r6720r6721
10641067   usecs = wd17xx_get_datarate_in_us(w->density);
10651068
10661069   /* 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);
10681071}
10691072
10701073
r6720r6721
10781081   usecs = w->pause_time; /* How long should we wait? How about 40 micro seconds? */
10791082
10801083   /* 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);
10821085}
10831086
10841087
r6720r6721
10921095   usecs = w->pause_time; /* How long should we wait? How about 40 micro seconds? */
10931096
10941097   /* 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);
10961099}
10971100
10981101
r6720r6721
18021805   w->density = DEN_MFM_LO;
18031806   w->pause_time = 40;
18041807
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
18051814   /* resolve callbacks */
18061815   devcb_resolve_write_line(&w->out_intrq_func, &w->intf->out_intrq_func, device);
18071816   devcb_resolve_write_line(&w->out_drq_func, &w->intf->out_drq_func, device);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team