Previous 199869 Revisions Next

r21209 Wednesday 20th February, 2013 at 05:30:51 UTC by R. Belmont
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).
[src/emu/machine]idectrl.c

trunk/src/emu/machine/idectrl.c
r21208r21209
327327{
328328   memset(m_features, 0, IDE_DISK_SECTOR_SIZE);
329329   int total_sectors = m_num_cylinders * m_num_heads * m_num_sectors;
330   int sectors_per_track = m_num_heads * m_num_sectors;
331330
332331   /* basic geometry */
333332   m_features[ 0*2+0] = 0x5a;                      /*  0: configuration bits */
r21208r21209
382381   m_features[55*2+1] = 0;/*num_heads >> 8;*/
383382   m_features[56*2+0] = m_num_sectors & 0xff;  /* 56: number of current logical sectors per track */
384383   m_features[56*2+1] = 0;/*num_sectors >> 8;*/
385   m_features[57*2+0] = sectors_per_track & 0xff;  /* 57-58: number of current logical sectors per track */
386   m_features[57*2+1] = sectors_per_track >> 8;
387   m_features[58*2+0] = sectors_per_track >> 16;
388   m_features[58*2+1] = sectors_per_track >> 24;
384   m_features[57*2+0] = total_sectors & 0xff;  /* 57-58: current capacity in sectors (ATA-1 through ATA-5; obsoleted in ATA-6) */
385   m_features[57*2+1] = total_sectors >> 8;
386   m_features[58*2+0] = total_sectors >> 16;
387   m_features[58*2+1] = total_sectors >> 24;
389388   m_features[59*2+0] = 0;                         /* 59: multiple sector timing */
390389   m_features[59*2+1] = 0;
391   m_features[60*2+0] = total_sectors & 0xff;      /* 60-61: total user addressable sectors */
390   m_features[60*2+0] = total_sectors & 0xff;      /* 60-61: total user addressable sectors for LBA mode (ATA-1 through ATA-7) */
392391   m_features[60*2+1] = total_sectors >> 8;
393392   m_features[61*2+0] = total_sectors >> 16;
394393   m_features[61*2+1] = total_sectors >> 24;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team