idectrl: words 57/58 of IDENTIFY DEVICE are total sectors, not sectors per track [R. Belmont]

As commented, this is the case for ATA-1, -2, -3, -4, and -5.  The CFFA2 Apple 
II IDE card firmware relies on this value being as documented in the standards 
to properly detect the drive size, and none of the usual sensitive Atari/Midway
games are broken by the change.

(This field is unused in ATA-6 and later).
This commit is contained in:
R. Belmont 2013-02-20 05:30:51 +00:00
parent 6a576392bc
commit c95286710d

View File

@ -327,7 +327,6 @@ void ide_hdd_device::ide_build_features()
{
memset(m_features, 0, IDE_DISK_SECTOR_SIZE);
int total_sectors = m_num_cylinders * m_num_heads * m_num_sectors;
int sectors_per_track = m_num_heads * m_num_sectors;
/* basic geometry */
m_features[ 0*2+0] = 0x5a; /* 0: configuration bits */
@ -382,13 +381,13 @@ void ide_hdd_device::ide_build_features()
m_features[55*2+1] = 0;/*num_heads >> 8;*/
m_features[56*2+0] = m_num_sectors & 0xff; /* 56: number of current logical sectors per track */
m_features[56*2+1] = 0;/*num_sectors >> 8;*/
m_features[57*2+0] = sectors_per_track & 0xff; /* 57-58: number of current logical sectors per track */
m_features[57*2+1] = sectors_per_track >> 8;
m_features[58*2+0] = sectors_per_track >> 16;
m_features[58*2+1] = sectors_per_track >> 24;
m_features[57*2+0] = total_sectors & 0xff; /* 57-58: current capacity in sectors (ATA-1 through ATA-5; obsoleted in ATA-6) */
m_features[57*2+1] = total_sectors >> 8;
m_features[58*2+0] = total_sectors >> 16;
m_features[58*2+1] = total_sectors >> 24;
m_features[59*2+0] = 0; /* 59: multiple sector timing */
m_features[59*2+1] = 0;
m_features[60*2+0] = total_sectors & 0xff; /* 60-61: total user addressable sectors */
m_features[60*2+0] = total_sectors & 0xff; /* 60-61: total user addressable sectors for LBA mode (ATA-1 through ATA-7) */
m_features[60*2+1] = total_sectors >> 8;
m_features[61*2+0] = total_sectors >> 16;
m_features[61*2+1] = total_sectors >> 24;