src/mess/machine/kay_kbd.c
| r4657 | r4658 | |
| 4 | 4 | * |
| 5 | 5 | * Kaypro II Serial Keyboard |
| 6 | 6 | * |
| 7 | | * Most of this is copied from kaypro.c, |
| 7 | * Most of this is copied from the old kaypro.c, |
| 8 | 8 | * rather than re-inventing the wheel. |
| 9 | 9 | * |
| 10 | 10 | * Juergen Buchmueller, July 1998 |
| r4657 | r4658 | |
| 12 | 12 | * |
| 13 | 13 | * Converted to a serial device (as far as MESS will allow) |
| 14 | 14 | * by Robbbert, April 2009. |
| 15 | | |
| 16 | | NOTE: THIS IS A WIP, IT DOESN'T DO ANYTHING AT THIS TIME !! |
| 17 | 15 | * |
| 18 | 16 | ******************************************************************************/ |
| 19 | 17 | |
| r4657 | r4658 | |
| 397 | 395 | #endif |
| 398 | 396 | |
| 399 | 397 | /****************************************************** |
| 400 | | * kaypro_conin_w |
| 401 | 398 | * stuff character into the keyboard buffer |
| 402 | 399 | * releases CPU if it was waiting for a key |
| 403 | 400 | * sounds bell if buffer would overflow |
src/mess/machine/wd17xx.c
| r4657 | r4658 | |
| 1184 | 1184 | |
| 1185 | 1185 | w->status |= STA_2_BUSY; |
| 1186 | 1186 | w->busy_count = 0; |
| 1187 | | } else { |
| 1187 | } |
| 1188 | else |
| 1189 | { |
| 1188 | 1190 | wd17xx_complete_command(device, DELAY_DATADONE); |
| 1189 | 1191 | |
| 1190 | 1192 | if (VERBOSE) |
| 1191 | 1193 | logerror("wd17xx_data_r(): multi data read completed\n"); |
| 1192 | 1194 | } |
| 1193 | | } else { |
| 1194 | | /* Delay the INTRQ 3 byte times becuase we need to read two CRC bytes and |
| 1195 | } |
| 1196 | else |
| 1197 | { |
| 1198 | /* Delay the INTRQ 3 byte times because we need to read two CRC bytes and |
| 1195 | 1199 | compare them with a calculated CRC */ |
| 1196 | 1200 | wd17xx_complete_command(device, DELAY_DATADONE); |
| 1197 | 1201 | |
| r4657 | r4658 | |
| 1251 | 1255 | |
| 1252 | 1256 | w->busy_count = 0; |
| 1253 | 1257 | w->command_type = TYPE_IV; |
| 1254 | | return; |
| 1258 | return; |
| 1255 | 1259 | } |
| 1256 | 1260 | |
| 1257 | 1261 | if (data & 0x80) |
| r4657 | r4658 | |
| 1319 | 1323 | wd17xx_clear_data_request(device); |
| 1320 | 1324 | |
| 1321 | 1325 | if (!floppy_drive_get_flag_state(wd17xx_current_image(device), FLOPPY_DRIVE_READY)) |
| 1322 | | { |
| 1326 | { |
| 1323 | 1327 | wd17xx_complete_command(device, DELAY_NOTREADY); |
| 1324 | | } |
| 1325 | | else |
| 1326 | | { |
| 1328 | } |
| 1329 | else |
| 1330 | { |
| 1327 | 1331 | |
| 1328 | | /* drive write protected? */ |
| 1329 | | if (floppy_drive_get_flag_state(wd17xx_current_image(device),FLOPPY_DRIVE_DISK_WRITE_PROTECTED)) |
| 1330 | | { |
| 1331 | | /* yes */ |
| 1332 | | w->status |= STA_2_WRITE_PRO; |
| 1333 | | /* quit command */ |
| 1334 | | wd17xx_complete_command(device, DELAY_ERROR); |
| 1335 | | } |
| 1336 | | else |
| 1337 | | { |
| 1338 | | w->command = data & ~FDC_MASK_TYPE_III; |
| 1339 | | w->data_offset = 0; |
| 1340 | | w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD; |
| 1341 | | wd17xx_set_data_request(device); |
| 1342 | | |
| 1343 | | w->status |= STA_2_BUSY; |
| 1344 | | w->busy_count = 0; |
| 1345 | | } |
| 1346 | | } |
| 1347 | | return; |
| 1332 | /* drive write protected? */ |
| 1333 | if (floppy_drive_get_flag_state(wd17xx_current_image(device),FLOPPY_DRIVE_DISK_WRITE_PROTECTED)) |
| 1334 | { |
| 1335 | /* yes */ |
| 1336 | w->status |= STA_2_WRITE_PRO; |
| 1337 | /* quit command */ |
| 1338 | wd17xx_complete_command(device, DELAY_ERROR); |
| 1339 | } |
| 1340 | else |
| 1341 | { |
| 1342 | w->command = data & ~FDC_MASK_TYPE_III; |
| 1343 | w->data_offset = 0; |
| 1344 | w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD; |
| 1345 | wd17xx_set_data_request(device); |
| 1346 | w->status |= STA_2_BUSY; |
| 1347 | w->busy_count = 0; |
| 1348 | } |
| 1349 | } |
| 1350 | return; |
| 1348 | 1351 | } |
| 1349 | 1352 | |
| 1350 | 1353 | if ((data & ~FDC_MASK_TYPE_III) == FDC_READ_DAM) |
| r4657 | r4658 | |
| 1358 | 1361 | |
| 1359 | 1362 | if (floppy_drive_get_flag_state(wd17xx_current_image(device), FLOPPY_DRIVE_READY)) |
| 1360 | 1363 | wd17xx_read_id(device); |
| 1361 | | |
| 1364 | else |
| 1362 | 1365 | wd17xx_complete_command(device, DELAY_NOTREADY); |
| 1363 | 1366 | |
| 1364 | 1367 | return; |
| r4657 | r4658 | |
| 1400 | 1403 | w->direction = 1; |
| 1401 | 1404 | } |
| 1402 | 1405 | else if (w->track_reg > w->data) |
| 1403 | | { |
| 1406 | { |
| 1404 | 1407 | if (VERBOSE) |
| 1405 | 1408 | logerror("direction: -1\n"); |
| 1406 | 1409 | |
| r4657 | r4658 | |
| 1464 | 1467 | logerror("wd17xx_command_w $%02X STEP_IN\n", data); |
| 1465 | 1468 | |
| 1466 | 1469 | w->command_type = TYPE_I; |
| 1467 | | w->direction = +1; |
| 1470 | w->direction = +1; |
| 1468 | 1471 | /* simulate seek time busy signal */ |
| 1469 | 1472 | w->busy_count = 0; //((data & FDC_STEP_RATE) + 1); |
| 1470 | 1473 | |
| r4657 | r4658 | |
| 1485 | 1488 | logerror("wd17xx_command_w $%02X STEP_OUT\n", data); |
| 1486 | 1489 | |
| 1487 | 1490 | w->command_type = TYPE_I; |
| 1488 | | w->direction = -1; |
| 1491 | w->direction = -1; |
| 1489 | 1492 | /* simulate seek time busy signal */ |
| 1490 | 1493 | w->busy_count = 0; //((data & FDC_STEP_RATE) + 1); |
| 1491 | 1494 | |