Corrected CHS calculation.

This commit is contained in:
2017-09-19 18:55:47 +01:00
parent 4faba6b763
commit 77529762a7
2 changed files with 44 additions and 4 deletions

View File

@@ -226,6 +226,9 @@ namespace DiscImageChef.DiscImages
ImageInfo.xmlMediaType = XmlMediaType.BlockMedia;
ImageInfo.mediaType = MediaType.GENERIC_HDD;
ImageInfo.imageSize = pHdr.sectors * 512;
ImageInfo.cylinders = pHdr.cylinders;
ImageInfo.heads = pHdr.heads;
ImageInfo.sectorsPerTrack = (uint)((ImageInfo.sectors / ImageInfo.cylinders) / ImageInfo.heads);
imageStream = stream;
return true;
@@ -269,10 +272,6 @@ namespace DiscImageChef.DiscImages
sectorCache.Add(sectorAddress, sector);
ImageInfo.cylinders = pHdr.cylinders;
ImageInfo.heads = pHdr.heads;
ImageInfo.sectorsPerTrack = (uint)((pHdr.sectors / pHdr.heads) / pHdr.cylinders);
return sector;
}