trunk/src/emu/machine/idehd.c
| r23738 | r23739 | |
| 160 | 160 | |
| 161 | 161 | /* standard CHS */ |
| 162 | 162 | else |
| 163 | | return (((((m_cylinder_high << 8 ) | m_cylinder_low) * m_num_heads) + (m_device_head & IDE_DEVICE_HEAD_HS)) * m_num_sectors) + m_sector_number - 1; |
| 163 | return (((((m_cylinder_high << 8) | m_cylinder_low) * m_num_heads) + (m_device_head & IDE_DEVICE_HEAD_HS)) * m_num_sectors) + m_sector_number - 1; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| r23738 | r23739 | |
| 457 | 457 | |
| 458 | 458 | void ide_mass_storage_device::next_sector() |
| 459 | 459 | { |
| 460 | UINT8 cur_head = m_device_head & IDE_DEVICE_HEAD_HS; |
| 461 | |
| 460 | 462 | /* LBA direct? */ |
| 461 | 463 | if (m_device_head & IDE_DEVICE_HEAD_L) |
| 462 | 464 | { |
| r23738 | r23739 | |
| 467 | 469 | if (m_cylinder_low == 0) |
| 468 | 470 | { |
| 469 | 471 | m_cylinder_high++; |
| 470 | | if( m_cylinder_high == 0) |
| 471 | | m_device_head = (m_device_head & ~IDE_DEVICE_HEAD_HS) | ((m_device_head + 1) & IDE_DEVICE_HEAD_HS); |
| 472 | if (m_cylinder_high == 0) |
| 473 | cur_head++; |
| 472 | 474 | } |
| 473 | 475 | } |
| 474 | 476 | } |
| r23738 | r23739 | |
| 482 | 484 | { |
| 483 | 485 | /* heads are 0 based */ |
| 484 | 486 | m_sector_number = 1; |
| 485 | | m_device_head = (m_device_head & ~IDE_DEVICE_HEAD_HS) | ((m_device_head + 1) & IDE_DEVICE_HEAD_HS); |
| 486 | | if ((m_device_head & IDE_DEVICE_HEAD_HS) >= m_num_heads) |
| 487 | cur_head++; |
| 488 | if (cur_head >= m_num_heads) |
| 487 | 489 | { |
| 488 | | m_device_head &= ~IDE_DEVICE_HEAD_HS; |
| 490 | cur_head = 0; |
| 489 | 491 | m_cylinder_low++; |
| 490 | 492 | if (m_cylinder_low == 0) |
| 491 | 493 | m_cylinder_high++; |
| r23738 | r23739 | |
| 493 | 495 | } |
| 494 | 496 | } |
| 495 | 497 | |
| 498 | m_device_head = (m_device_head & ~IDE_DEVICE_HEAD_HS) | cur_head; |
| 499 | |
| 496 | 500 | m_cur_lba = lba_address(); |
| 497 | 501 | } |
| 498 | 502 | |