Previous 15994 Revisions Next

r11033 Friday 1st April, 2011 at 18:27:49 UTC by Curt Coder
[WD17XX] Set complete command delay to 16/32 usec based on DDEN.
[src/mess/machine]coco.c mbee.c wd17xx.c wd17xx.h

src/mess/machine/mbee.c
r11032r11033
534534   state->m_fdc = machine.device("fdc");
535535   /* These values need to be fine tuned or the fdc repaired */
536536   wd17xx_set_pause_time(state->m_fdc, 45);       /* default is 40 usec if not set */
537   wd17xx_set_complete_command_delay(state->m_fdc, 50);   /* default is 12 usec if not set */
537//   wd17xx_set_complete_command_delay(state->m_fdc, 50);   /* default is 12 usec if not set */
538538}
539539
540540MACHINE_RESET( mbee )
src/mess/machine/coco.c
r11032r11033
29862986MACHINE_RESET( dgnalpha )
29872987{
29882988   coco_state *state = machine.driver_data<coco_state>();
2989   device_t *fdc = machine.device("wd2797");
2990   wd17xx_set_complete_command_delay(fdc,20);
2989//   device_t *fdc = machine.device("wd2797");
2990//   wd17xx_set_complete_command_delay(fdc,20);
29912991
29922992   /* state->m_dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */
29932993   /* by the WD2797, it is reset to 0 after the first inurrupt */
src/mess/machine/wd17xx.c
r11032r11033
133133   - Triggering intrq now clears the DRQ bit in the status as well as the busy bit.
134134     Execution of the READ_DAM command now correctly sets w->command.
135135
136   2011-Apr-01 Curt Coder
137   - Set complete command delay to 16 usec (DD) / 32 usec (SD) and removed
138     the external delay setting hack.
139
136140    TODO:
137141        - What happens if a track is read that doesn't have any id's on it?
138142         (e.g. unformatted disc)
r11032r11033
354358   /* pause time when writing/reading sector */
355359   int pause_time;
356360
357   /* complete command delay */
358   int complete_command_delay;
359
360361   /* Were we busy when we received a FORCE_INT command */
361362   UINT8   was_busy;
362363
r11032r11033
10211022*/
10221023static void wd17xx_complete_command(device_t *device, int delay)
10231024{
1024   int usecs;
10251025   wd1770_state *w = get_safe_token(device);
10261026
10271027   w->data_count = 0;
10281028
10291029   w->hld_count = 2;
10301030
1031#if 0
1032   /* clear busy bit */
1033   /* RL - removed, busy bit must be on until wd17xx_misc_timer_callback() is fired */
1034   /* Robbbert - adjusted delay value (see notes above) to fix the osborne1 */
1035   w->status &= ~STA_2_BUSY;
1036
1037   usecs = wd17xx_get_datarate_in_us(w->density);
1038   usecs *= delay;
1039#endif
1040
1041   //usecs = 12;
1042    usecs   = w->complete_command_delay;
1043
10441031   /* set new timer */
1032   int usecs = wd17xx_dden(device) ? 32 : 16;
10451033   w->timer_cmd->adjust(attotime::from_usec(usecs));
10461034
10471035   /* Kill onshot read/write sector timers */
r11032r11033
12651253   w->pause_time = usec;
12661254}
12671255
1268void wd17xx_set_complete_command_delay(device_t *device, int usec)
1269{
1270   wd1770_state *w = get_safe_token(device);
1271    w->complete_command_delay=usec;
1272}
12731256
1274
12751257/***************************************************************************
12761258    DEVICE HANDLERS
12771259***************************************************************************/
r11032r11033
20242006
20252007   w->status = STA_1_TRACK0;
20262008   w->pause_time = 1000;
2027    w->complete_command_delay = 12;
20282009
20292010   /* allocate timers */
20302011   w->timer_cmd = device->machine().scheduler().timer_alloc(FUNC(wd17xx_command_callback), (void *)device);
src/mess/machine/wd17xx.h
r11032r11033
5858void wd17xx_set_side(device_t *device, UINT8);      /* set side wd179x is accessing */
5959
6060void wd17xx_set_pause_time(device_t *device, int usec);       /* default is 40 usec if not set */
61void wd17xx_set_complete_command_delay(device_t *device, int usec);   /* default is 12 usec if not set */
6261
6362READ8_DEVICE_HANDLER( wd17xx_status_r );
6463READ8_DEVICE_HANDLER( wd17xx_track_r );

Previous 15994 Revisions Next


© 1998-2018 The MESS Team