src/mess/machine/upd765.c
| r13353 | r13354 | |
| 78 | 78 | #define UPD765_FDD_READY 0x040 |
| 79 | 79 | |
| 80 | 80 | #define UPD765_MF 0x40 |
| 81 | #define UPD765_MT 0x80 |
| 81 | 82 | |
| 82 | 83 | #define UPD765_RESET 0x080 |
| 83 | 84 | |
| r13353 | r13354 | |
| 1234 | 1235 | |
| 1235 | 1236 | |
| 1236 | 1237 | /* multi-track? */ |
| 1237 | | if (fdc->upd765_command_bytes[0] & 0x080) |
| 1238 | if (fdc->upd765_command_bytes[0] & UPD765_MT) |
| 1238 | 1239 | { |
| 1239 | 1240 | /* it appears that in multi-track mode, |
| 1240 | 1241 | the EOT parameter of the command is ignored!? - |
| r13353 | r13354 | |
| 1363 | 1364 | static void upd765_increment_sector(device_t *device) |
| 1364 | 1365 | { |
| 1365 | 1366 | upd765_t *fdc = get_safe_token(device); |
| 1367 | |
| 1366 | 1368 | /* multi-track? */ |
| 1367 | | if (fdc->upd765_command_bytes[0] & 0x080) |
| 1369 | if (fdc->upd765_command_bytes[0] & UPD765_MT) |
| 1368 | 1370 | { |
| 1369 | 1371 | /* reached EOT? */ |
| 1370 | | /* if (fdc->upd765_command_bytes[4]==fdc->upd765_command_bytes[6])*/ |
| 1371 | | if (upd765_just_read_last_sector_on_track(device)) |
| 1372 | if (fdc->upd765_command_bytes[4] == fdc->upd765_command_bytes[6]) |
| 1372 | 1373 | { |
| 1373 | | /* reset sector id to 1 */ |
| 1374 | | fdc->upd765_command_bytes[4] = 1; |
| 1375 | | |
| 1376 | | /* yes */ |
| 1377 | | if(fdc->side == 1) { |
| 1378 | | fdc->upd765_command_bytes[3] = 0; |
| 1374 | if (fdc->side == 1) |
| 1375 | { |
| 1379 | 1376 | fdc->upd765_command_bytes[2]++; |
| 1380 | | return; |
| 1381 | 1377 | } |
| 1382 | | |
| 1383 | | /* reached EOT */ |
| 1384 | | /* change side to 1 */ |
| 1385 | | fdc->side = 1; |
| 1386 | | /* set head to 1 for get next sector test */ |
| 1387 | | fdc->upd765_command_bytes[3] = 1; |
| 1378 | |
| 1379 | fdc->upd765_command_bytes[3] ^= 0x01; |
| 1380 | fdc->upd765_command_bytes[4] = 1; |
| 1381 | fdc->side = fdc->upd765_command_bytes[3] & 0x01; |
| 1388 | 1382 | } |
| 1389 | 1383 | else |
| 1390 | 1384 | { |
| 1391 | | /* increment */ |
| 1392 | 1385 | fdc->upd765_command_bytes[4]++; |
| 1393 | 1386 | } |
| 1394 | | |
| 1395 | 1387 | } |
| 1396 | 1388 | else |
| 1397 | 1389 | { |
| 1398 | | if (upd765_just_read_last_sector_on_track(device)) |
| 1390 | if (fdc->upd765_command_bytes[4] == fdc->upd765_command_bytes[6]) |
| 1399 | 1391 | { |
| 1400 | | fdc->upd765_command_bytes[4] = 1; |
| 1401 | 1392 | fdc->upd765_command_bytes[2]++; |
| 1402 | | return; |
| 1393 | fdc->upd765_command_bytes[4] = 1; |
| 1403 | 1394 | } |
| 1404 | | |
| 1405 | | fdc->upd765_command_bytes[4]++; |
| 1395 | else |
| 1396 | { |
| 1397 | fdc->upd765_command_bytes[4]++; |
| 1398 | } |
| 1406 | 1399 | } |
| 1407 | 1400 | } |
| 1408 | 1401 | |