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

trunk/src/emu/machine/idectrl.c
r20092r20093
518518   /* reset the totals */
519519   buffer_offset = 0;
520520
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;
525523   status &= ~IDE_STATUS_BUSY;
526524
527525   if (master_password_enable || user_password_enable)
r20092r20093
542540      read_next_sector();
543541   else
544542   {
545      status &= ~IDE_STATUS_BUFFER_READY; /* now clear it */
546543      bus_master_status &= ~IDE_BUSMASTER_STATUS_ACTIVE;
547544      dma_active = 0;
548545   }
r20092r20093
699696void ide_controller_device::read_next_sector()
700697{
701698   /* mark ourselves busy */
702//   status |= IDE_STATUS_BUSY;
699   status |= IDE_STATUS_BUSY;
703700
704701   if (command == IDE_COMMAND_READ_MULTIPLE_BLOCK)
705702   {
r20092r20093
11831180         status &= ~IDE_STATUS_DRIVE_READY;
11841181      }
11851182   }
1186   else
1187   {
1188      return 0;
1189   }
11901183
11911184   switch (BANK(bank, offset))
11921185   {
r20092r20093
14391432         //if (data == 0x04)
14401433         if (data & 0x04)
14411434         {
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));
14531438         }
14541439         break;
14551440   }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team