src/mess/machine/coco.c
| r11032 | r11033 | |
| 2986 | 2986 | MACHINE_RESET( dgnalpha ) |
| 2987 | 2987 | { |
| 2988 | 2988 | 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); |
| 2991 | 2991 | |
| 2992 | 2992 | /* state->m_dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */ |
| 2993 | 2993 | /* by the WD2797, it is reset to 0 after the first inurrupt */ |
src/mess/machine/wd17xx.c
| r11032 | r11033 | |
| 133 | 133 | - Triggering intrq now clears the DRQ bit in the status as well as the busy bit. |
| 134 | 134 | Execution of the READ_DAM command now correctly sets w->command. |
| 135 | 135 | |
| 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 | |
| 136 | 140 | TODO: |
| 137 | 141 | - What happens if a track is read that doesn't have any id's on it? |
| 138 | 142 | (e.g. unformatted disc) |
| r11032 | r11033 | |
| 354 | 358 | /* pause time when writing/reading sector */ |
| 355 | 359 | int pause_time; |
| 356 | 360 | |
| 357 | | /* complete command delay */ |
| 358 | | int complete_command_delay; |
| 359 | | |
| 360 | 361 | /* Were we busy when we received a FORCE_INT command */ |
| 361 | 362 | UINT8 was_busy; |
| 362 | 363 | |
| r11032 | r11033 | |
| 1021 | 1022 | */ |
| 1022 | 1023 | static void wd17xx_complete_command(device_t *device, int delay) |
| 1023 | 1024 | { |
| 1024 | | int usecs; |
| 1025 | 1025 | wd1770_state *w = get_safe_token(device); |
| 1026 | 1026 | |
| 1027 | 1027 | w->data_count = 0; |
| 1028 | 1028 | |
| 1029 | 1029 | w->hld_count = 2; |
| 1030 | 1030 | |
| 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 | | |
| 1044 | 1031 | /* set new timer */ |
| 1032 | int usecs = wd17xx_dden(device) ? 32 : 16; |
| 1045 | 1033 | w->timer_cmd->adjust(attotime::from_usec(usecs)); |
| 1046 | 1034 | |
| 1047 | 1035 | /* Kill onshot read/write sector timers */ |
| r11032 | r11033 | |
| 1265 | 1253 | w->pause_time = usec; |
| 1266 | 1254 | } |
| 1267 | 1255 | |
| 1268 | | void 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 | | } |
| 1273 | 1256 | |
| 1274 | | |
| 1275 | 1257 | /*************************************************************************** |
| 1276 | 1258 | DEVICE HANDLERS |
| 1277 | 1259 | ***************************************************************************/ |
| r11032 | r11033 | |
| 2024 | 2006 | |
| 2025 | 2007 | w->status = STA_1_TRACK0; |
| 2026 | 2008 | w->pause_time = 1000; |
| 2027 | | w->complete_command_delay = 12; |
| 2028 | 2009 | |
| 2029 | 2010 | /* allocate timers */ |
| 2030 | 2011 | w->timer_cmd = device->machine().scheduler().timer_alloc(FUNC(wd17xx_command_callback), (void *)device); |