| Previous | 199869 Revisions | Next |
| r20093 Saturday 5th January, 2013 at 22:43:37 UTC by Tafoid |
|---|
| Revert of a portion of r20073: idectrl.c [Peter Ferrie] - correct status flags for multi-sector reads - implement more correct controller reset values - fix phantom slave drive detection problem Causes problems noted with many MAME games such as Area 51: Site 4, Primal Rage 2, All Viper.c games among others that are either not starting or constantly RE-starting looking for proper IDE communications. |
| [src/emu/machine] | idectrl.c |
| r20092 | r20093 | |
|---|---|---|
| 518 | 518 | /* reset the totals */ |
| 519 | 519 | buffer_offset = 0; |
| 520 | 520 | |
| 521 | /* clear just the busy flag | |
| 522 | the buffer ready flag stays set until all sectors are read | |
| 523 | */ | |
| 524 | // status &= ~IDE_STATUS_BUFFER_READY; | |
| 521 | /* clear the buffer ready and busy flag */ | |
| 522 | status &= ~IDE_STATUS_BUFFER_READY; | |
| 525 | 523 | status &= ~IDE_STATUS_BUSY; |
| 526 | 524 | |
| 527 | 525 | if (master_password_enable || user_password_enable) |
| r20092 | r20093 | |
| 542 | 540 | read_next_sector(); |
| 543 | 541 | else |
| 544 | 542 | { |
| 545 | status &= ~IDE_STATUS_BUFFER_READY; /* now clear it */ | |
| 546 | 543 | bus_master_status &= ~IDE_BUSMASTER_STATUS_ACTIVE; |
| 547 | 544 | dma_active = 0; |
| 548 | 545 | } |
| r20092 | r20093 | |
| 699 | 696 | void ide_controller_device::read_next_sector() |
| 700 | 697 | { |
| 701 | 698 | /* mark ourselves busy */ |
| 702 | ||
| 699 | status |= IDE_STATUS_BUSY; | |
| 703 | 700 | |
| 704 | 701 | if (command == IDE_COMMAND_READ_MULTIPLE_BLOCK) |
| 705 | 702 | { |
| r20092 | r20093 | |
| 1183 | 1180 | status &= ~IDE_STATUS_DRIVE_READY; |
| 1184 | 1181 | } |
| 1185 | 1182 | } |
| 1186 | else | |
| 1187 | { | |
| 1188 | return 0; | |
| 1189 | } | |
| 1190 | 1183 | |
| 1191 | 1184 | switch (BANK(bank, offset)) |
| 1192 | 1185 | { |
| r20092 | r20093 | |
| 1439 | 1432 | //if (data == 0x04) |
| 1440 | 1433 | if (data & 0x04) |
| 1441 | 1434 | { |
| 1442 | // status |= IDE_STATUS_BUSY; | |
| 1443 | // status &= ~IDE_STATUS_DRIVE_READY; | |
| 1444 | // reset_timer->adjust(attotime::from_msec(5)); | |
| 1445 | device_reset(); /* deliver instantly to support buggy BIOSes that don't poll properly */ | |
| 1446 | sector_count = 1; | |
| 1447 | drive[0].cur_sector = 1; | |
| 1448 | drive[0].cur_head = 0; | |
| 1449 | drive[0].cur_cylinder = 0; | |
| 1450 | drive[1].cur_sector = 1; | |
| 1451 | drive[1].cur_head = 0; | |
| 1452 | drive[1].cur_cylinder = 0; | |
| 1435 | status |= IDE_STATUS_BUSY; | |
| 1436 | status &= ~IDE_STATUS_DRIVE_READY; | |
| 1437 | reset_timer->adjust(attotime::from_msec(5)); | |
| 1453 | 1438 | } |
| 1454 | 1439 | break; |
| 1455 | 1440 | } |
| Previous | 199869 Revisions | Next |