Corrected how CSD is prettyfied.

This commit is contained in:
2017-09-28 19:48:23 +00:00
parent 4f69f31e4c
commit 5e7ec2a918
2 changed files with 8 additions and 6 deletions

View File

@@ -491,15 +491,16 @@ namespace DiscImageChef.Decoders.MMC
break; break;
} }
unitFactor = Convert.ToDouble(string.Format("{0:X}", csd.EraseGroupSize)); // TODO: Check specification
multiplier = Convert.ToDouble(string.Format("{0:X}", csd.EraseGroupSizeMultiplier)); unitFactor = Convert.ToDouble(csd.EraseGroupSize);
multiplier = Convert.ToDouble(csd.EraseGroupSizeMultiplier);
result = (unitFactor + 1) * (multiplier + 1); result = (unitFactor + 1) * (multiplier + 1);
sb.AppendFormat("\tDevice can erase a minimum of {0} blocks at a time", (int)result).AppendLine(); sb.AppendFormat("\tDevice can erase a minimum of {0} blocks at a time", (int)result).AppendLine();
if(csd.WriteProtectGroupEnable) if(csd.WriteProtectGroupEnable)
{ {
sb.AppendLine("\tDevice can write protect regions"); sb.AppendLine("\tDevice can write protect regions");
unitFactor = Convert.ToDouble(string.Format("{0:X}", csd.WriteProtectGroupSize)); unitFactor = Convert.ToDouble(csd.WriteProtectGroupSize);
sb.AppendFormat("\tDevice can write protect a minimum of {0} blocks at a time", (int)(result + 1)).AppendLine(); sb.AppendFormat("\tDevice can write protect a minimum of {0} blocks at a time", (int)(result + 1)).AppendLine();
} }
else else

View File

@@ -500,13 +500,14 @@ namespace DiscImageChef.Decoders.SecureDigital
if(csd.EraseBlockEnable) if(csd.EraseBlockEnable)
sb.AppendLine("\tDevice can erase multiple blocks"); sb.AppendLine("\tDevice can erase multiple blocks");
sb.AppendFormat("\tDevice must erase a minimum of {0} blocks at a time", Convert.ToUInt32(string.Format("{0:X}", csd.EraseSectorSize)) + 1).AppendLine(); // TODO: Check specification
sb.AppendFormat("\tDevice must erase a minimum of {0} blocks at a time", Convert.ToUInt32(csd.EraseSectorSize) + 1).AppendLine();
if(csd.WriteProtectGroupEnable) if(csd.WriteProtectGroupEnable)
{ {
sb.AppendLine("\tDevice can write protect regions"); sb.AppendLine("\tDevice can write protect regions");
unitFactor = Convert.ToDouble(string.Format("{0:X}", csd.WriteProtectGroupSize)); // TODO: Check specification
unitFactor = Convert.ToDouble(csd.WriteProtectGroupSize);
sb.AppendFormat("\tDevice can write protect a minimum of {0} blocks at a time", (int)(result + 1)).AppendLine(); sb.AppendFormat("\tDevice can write protect a minimum of {0} blocks at a time", (int)(result + 1)).AppendLine();
} }
else else