mirror of
https://github.com/holub/mame
synced 2025-07-04 09:28:51 +03:00
Fixed head incrementing when using CHS with 16 heads (nw)
This commit is contained in:
parent
eb5c9decf4
commit
42d77a2f41
@ -457,6 +457,8 @@ void ide_mass_storage_device::signal_delayed_interrupt(attotime time, int buffer
|
|||||||
|
|
||||||
void ide_mass_storage_device::next_sector()
|
void ide_mass_storage_device::next_sector()
|
||||||
{
|
{
|
||||||
|
UINT8 cur_head = m_device_head & IDE_DEVICE_HEAD_HS;
|
||||||
|
|
||||||
/* LBA direct? */
|
/* LBA direct? */
|
||||||
if (m_device_head & IDE_DEVICE_HEAD_L)
|
if (m_device_head & IDE_DEVICE_HEAD_L)
|
||||||
{
|
{
|
||||||
@ -468,7 +470,7 @@ void ide_mass_storage_device::next_sector()
|
|||||||
{
|
{
|
||||||
m_cylinder_high++;
|
m_cylinder_high++;
|
||||||
if (m_cylinder_high == 0)
|
if (m_cylinder_high == 0)
|
||||||
m_device_head = (m_device_head & ~IDE_DEVICE_HEAD_HS) | ((m_device_head + 1) & IDE_DEVICE_HEAD_HS);
|
cur_head++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -482,10 +484,10 @@ void ide_mass_storage_device::next_sector()
|
|||||||
{
|
{
|
||||||
/* heads are 0 based */
|
/* heads are 0 based */
|
||||||
m_sector_number = 1;
|
m_sector_number = 1;
|
||||||
m_device_head = (m_device_head & ~IDE_DEVICE_HEAD_HS) | ((m_device_head + 1) & IDE_DEVICE_HEAD_HS);
|
cur_head++;
|
||||||
if ((m_device_head & IDE_DEVICE_HEAD_HS) >= m_num_heads)
|
if (cur_head >= m_num_heads)
|
||||||
{
|
{
|
||||||
m_device_head &= ~IDE_DEVICE_HEAD_HS;
|
cur_head = 0;
|
||||||
m_cylinder_low++;
|
m_cylinder_low++;
|
||||||
if (m_cylinder_low == 0)
|
if (m_cylinder_low == 0)
|
||||||
m_cylinder_high++;
|
m_cylinder_high++;
|
||||||
@ -493,6 +495,8 @@ void ide_mass_storage_device::next_sector()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_device_head = (m_device_head & ~IDE_DEVICE_HEAD_HS) | cur_head;
|
||||||
|
|
||||||
m_cur_lba = lba_address();
|
m_cur_lba = lba_address();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user