Tweaks to hard drive image parameter finding. Patch from Greatpsycho.

This commit is contained in:
SarahW 2017-07-05 21:54:48 +01:00
commit 1e90a84e90
3 changed files with 29 additions and 19 deletions

View file

@ -61,19 +61,23 @@ static void check_hd_type(off64_t sz)
}
else
{
if ((sz % 17) == 0 && sz <= 133693440)
if ((sz % 17) == 0 && sz <= 142606336)
{
hd_new_spt = 17;
if (sz <= 26738688)
hd_new_hpc = 4;
else if (sz <= 53477376)
else if ((sz % 3072) == 0 && sz <= 53477376)
hd_new_hpc = 6;
else if (sz <= 71303168)
hd_new_hpc = 8;
else
hd_new_hpc = 15;
{
for (c=5;c<16;c++)
{
if((sz % (c * 512)) == 0 && sz <= 1024*c*17*512) break;
if (c == 5) c++;
}
hd_new_hpc = c;
}
hd_new_cyl = (int)((sz / 512) / hd_new_hpc) / 17;
}
else