src/mess/machine/wd17xx.c
| r4658 | r4659 | |
| 27 | 27 | - wd17xx_complete_command(device, DELAY_DATADONE); |
| 28 | 28 | + wd17xx_set_data_request(); |
| 29 | 29 | |
| 30 | 2009-May-10 Robbbert: |
| 31 | Further change to get the Kaypro II to work |
| 32 | - When wd17xx_read_id has generated the 6 data bytes, it should make |
| 33 | an IRQ and turn off the busy status. The timing for Osborne is |
| 34 | critical, it must be between 300 and 700 usec, I've settled on 400. |
| 35 | The Kaypro doesn't care timewise, but the busy flag must turn off |
| 36 | sometime or it hangs. |
| 37 | - w->status |= STA_2_BUSY; |
| 38 | + wd17xx_set_busy(device, ATTOTIME_IN_USEC(400)); |
| 39 | |
| 30 | 40 | TODO: |
| 31 | 41 | - Multiple record write |
| 32 | 42 | - What happens if a track is read that doesn't have any id's on it? |
| r4658 | r4659 | |
| 200 | 210 | /* this is the head currently selected */ |
| 201 | 211 | UINT8 hd; |
| 202 | 212 | |
| 203 | | /* pause time when writeing/reading sector */ |
| 213 | /* pause time when writing/reading sector */ |
| 204 | 214 | int pause_time; |
| 205 | 215 | |
| 206 | 216 | /* Pointer to interface */ |
| r4658 | r4659 | |
| 623 | 633 | w->buffer[5] = crc & 255; |
| 624 | 634 | |
| 625 | 635 | w->sector = id.C; |
| 626 | | |
| 627 | | w->status |= STA_2_BUSY; |
| 636 | wd17xx_set_busy(device, ATTOTIME_IN_USEC(400)); |
| 628 | 637 | w->busy_count = 0; |
| 629 | 638 | |
| 630 | 639 | wd17xx_set_data_request(device); |
| r4658 | r4659 | |
| 1238 | 1247 | |
| 1239 | 1248 | w->data_count = 0; |
| 1240 | 1249 | w->data_offset = 0; |
| 1241 | | w->status &= ~(STA_2_BUSY); |
| 1250 | w->status &= ~STA_2_BUSY; |
| 1242 | 1251 | |
| 1243 | 1252 | wd17xx_clear_data_request(device); |
| 1244 | 1253 | |
| r4658 | r4659 | |
| 1362 | 1371 | if (floppy_drive_get_flag_state(wd17xx_current_image(device), FLOPPY_DRIVE_READY)) |
| 1363 | 1372 | wd17xx_read_id(device); |
| 1364 | 1373 | else |
| 1365 | | wd17xx_complete_command(device, DELAY_NOTREADY); |
| 1374 | wd17xx_complete_command(device, DELAY_NOTREADY); |
| 1366 | 1375 | |
| 1367 | 1376 | return; |
| 1368 | 1377 | } |
src/mess/machine/kaypro.c
| r4658 | r4659 | |
| 21 | 21 | |
| 22 | 22 | PIO |
| 23 | 23 | |
| 24 | | It seems there must have been a bulk-purchase |
| 25 | | special on pios - port B is unused on both of them |
| 24 | Port B is unused on both PIOs |
| 26 | 25 | |
| 27 | 26 | ************************************************************/ |
| 28 | 27 | |
| 29 | | static WRITE8_DEVICE_HANDLER( kaypro_interrupt ) |
| 28 | static void kaypro_interrupt(const device_config *device, int state) |
| 30 | 29 | { |
| 31 | | cputag_set_input_line(device->machine, "maincpu", 0, data); |
| 30 | cputag_set_input_line(device->machine, "maincpu", 0, state); |
| 32 | 31 | } |
| 33 | 32 | |
| 34 | 33 | static READ8_DEVICE_HANDLER( pio_system_r ) |
| r4658 | r4659 | |
| 81 | 80 | |
| 82 | 81 | const z80pio_interface kayproii_pio_g_intf = |
| 83 | 82 | { |
| 84 | | DEVCB_HANDLER(kaypro_interrupt), |
| 83 | DEVCB_LINE(kaypro_interrupt), |
| 85 | 84 | DEVCB_NULL, |
| 86 | 85 | DEVCB_NULL, |
| 87 | 86 | DEVCB_DEVICE_HANDLER("centronics", centronics_data_w), |
| r4658 | r4659 | |
| 92 | 91 | |
| 93 | 92 | const z80pio_interface kayproii_pio_s_intf = |
| 94 | 93 | { |
| 95 | | DEVCB_HANDLER(kaypro_interrupt), |
| 94 | DEVCB_LINE(kaypro_interrupt), |
| 96 | 95 | DEVCB_HANDLER(pio_system_r), /* read printer status */ |
| 97 | 96 | DEVCB_NULL, |
| 98 | 97 | DEVCB_HANDLER(pio_system_w), /* activate various internal devices */ |
| r4658 | r4659 | |
| 243 | 242 | // z80sio_set_tx_clock( kaypro2x_z80sio, baud_clock[data], 0); |
| 244 | 243 | } |
| 245 | 244 | |
| 246 | | |
| 247 | | /* when sio devcb'ed like pio is, change to use pio's int handler */ |
| 248 | | static void kaypro_int_sio(const device_config *device, int state) |
| 249 | | { |
| 250 | | cputag_set_input_line(device->machine, "maincpu", 0, state); |
| 251 | | } |
| 252 | | |
| 253 | 245 | const z80sio_interface kaypro_sio_intf = |
| 254 | 246 | { |
| 255 | | kaypro_int_sio, /* interrupt handler */ |
| 247 | kaypro_interrupt, /* interrupt handler */ |
| 256 | 248 | 0, /* DTR changed handler */ |
| 257 | 249 | 0, /* RTS changed handler */ |
| 258 | 250 | 0, /* BREAK changed handler */ |
| r4658 | r4659 | |
| 342 | 334 | { |
| 343 | 335 | if ((state == WD17XX_DRQ_SET) || (state == WD17XX_IRQ_SET)) |
| 344 | 336 | { |
| 345 | | timer_set(device->machine, ATTOTIME_IN_USEC(10), NULL, 0, kaypro_timer_callback); |
| 337 | timer_set(device->machine, ATTOTIME_IN_USEC(25), NULL, 0, kaypro_timer_callback); |
| 346 | 338 | } |
| 347 | 339 | else |
| 348 | 340 | { |