mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Invert 'if' statement to reduce nesting.
This commit is contained in:
79
SCSI/EVPD.cs
79
SCSI/EVPD.cs
@@ -2301,52 +2301,49 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
return decoded;
|
||||
}
|
||||
|
||||
if(pageResponse[4] == pageResponse[3] - 1)
|
||||
{
|
||||
List<byte> array = new List<byte>();
|
||||
string fwRegExStr =
|
||||
"Firmware Rev\\s+=\\s+(?<fw>\\d+\\.\\d+)\\s+Build date\\s+=\\s+(?<date>(\\w|\\d|\\s*.)*)\\s*$";
|
||||
string fwcRegExStr = "FW_CONF\\s+=\\s+(?<value>0x[0-9A-Fa-f]{8})\\s*$";
|
||||
string servoRegExStr = "Servo\\s+Rev\\s+=\\s+(?<version>\\d+\\.\\d+)\\s*$";
|
||||
Regex fwRegEx = new Regex(fwRegExStr);
|
||||
Regex fwcRegEx = new Regex(fwcRegExStr);
|
||||
Regex servoRegEx = new Regex(servoRegExStr);
|
||||
Match fwMatch;
|
||||
Match fwcMatch;
|
||||
Match servoMatch;
|
||||
if(pageResponse[4] != pageResponse[3] - 1) return null;
|
||||
|
||||
for(int pos = 5; pos < pageResponse.Length; pos++)
|
||||
if(pageResponse[pos] == 0x00)
|
||||
List<byte> array = new List<byte>();
|
||||
string fwRegExStr =
|
||||
"Firmware Rev\\s+=\\s+(?<fw>\\d+\\.\\d+)\\s+Build date\\s+=\\s+(?<date>(\\w|\\d|\\s*.)*)\\s*$";
|
||||
string fwcRegExStr = "FW_CONF\\s+=\\s+(?<value>0x[0-9A-Fa-f]{8})\\s*$";
|
||||
string servoRegExStr = "Servo\\s+Rev\\s+=\\s+(?<version>\\d+\\.\\d+)\\s*$";
|
||||
Regex fwRegEx = new Regex(fwRegExStr);
|
||||
Regex fwcRegEx = new Regex(fwcRegExStr);
|
||||
Regex servoRegEx = new Regex(servoRegExStr);
|
||||
Match fwMatch;
|
||||
Match fwcMatch;
|
||||
Match servoMatch;
|
||||
|
||||
for(int pos = 5; pos < pageResponse.Length; pos++)
|
||||
if(pageResponse[pos] == 0x00)
|
||||
{
|
||||
string str = StringHandlers.CToString(array.ToArray());
|
||||
fwMatch = fwRegEx.Match(str);
|
||||
fwcMatch = fwcRegEx.Match(str);
|
||||
servoMatch = servoRegEx.Match(str);
|
||||
|
||||
if(str.ToLowerInvariant().StartsWith("copyright", StringComparison.Ordinal))
|
||||
decoded.Copyright = Encoding.ASCII.GetBytes(str);
|
||||
else if(fwMatch.Success)
|
||||
{
|
||||
string str = StringHandlers.CToString(array.ToArray());
|
||||
fwMatch = fwRegEx.Match(str);
|
||||
fwcMatch = fwcRegEx.Match(str);
|
||||
servoMatch = servoRegEx.Match(str);
|
||||
|
||||
if(str.ToLowerInvariant().StartsWith("copyright", StringComparison.Ordinal))
|
||||
decoded.Copyright = Encoding.ASCII.GetBytes(str);
|
||||
else if(fwMatch.Success)
|
||||
{
|
||||
decoded.Component = Encoding.ASCII.GetBytes("Firmware");
|
||||
decoded.Version = Encoding.ASCII.GetBytes(fwMatch.Groups["fw"].Value);
|
||||
decoded.Date = Encoding.ASCII.GetBytes(fwMatch.Groups["date"].Value);
|
||||
}
|
||||
else if(fwcMatch.Success)
|
||||
decoded.Variant = Encoding.ASCII.GetBytes(fwMatch.Groups["value"].Value);
|
||||
else if(servoMatch.Success)
|
||||
{
|
||||
decoded.Component = Encoding.ASCII.GetBytes("Servo");
|
||||
decoded.Version = Encoding.ASCII.GetBytes(servoMatch.Groups["version"].Value);
|
||||
}
|
||||
|
||||
array = new List<byte>();
|
||||
decoded.Component = Encoding.ASCII.GetBytes("Firmware");
|
||||
decoded.Version = Encoding.ASCII.GetBytes(fwMatch.Groups["fw"].Value);
|
||||
decoded.Date = Encoding.ASCII.GetBytes(fwMatch.Groups["date"].Value);
|
||||
}
|
||||
else if(fwcMatch.Success)
|
||||
decoded.Variant = Encoding.ASCII.GetBytes(fwMatch.Groups["value"].Value);
|
||||
else if(servoMatch.Success)
|
||||
{
|
||||
decoded.Component = Encoding.ASCII.GetBytes("Servo");
|
||||
decoded.Version = Encoding.ASCII.GetBytes(servoMatch.Groups["version"].Value);
|
||||
}
|
||||
else array.Add(pageResponse[pos]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
array = new List<byte>();
|
||||
}
|
||||
else array.Add(pageResponse[pos]);
|
||||
|
||||
return null;
|
||||
return decoded;
|
||||
}
|
||||
|
||||
public static string PrettifyPage_C0_to_C5_HP(byte[] pageResponse)
|
||||
|
||||
@@ -248,13 +248,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
decoded.Seagate_Copyright = new byte[48];
|
||||
Array.Copy(SCSIInquiryResponse, 96, decoded.Seagate_Copyright, 0, 48);
|
||||
}
|
||||
if(SCSIInquiryResponse.Length >= 148)
|
||||
{
|
||||
// Seagate 2
|
||||
decoded.Seagate3Present = true;
|
||||
decoded.Seagate_ServoPROMPartNo = new byte[4];
|
||||
Array.Copy(SCSIInquiryResponse, 144, decoded.Seagate_ServoPROMPartNo, 0, 4);
|
||||
}
|
||||
if(SCSIInquiryResponse.Length < 148) return decoded;
|
||||
// Seagate 2
|
||||
decoded.Seagate3Present = true;
|
||||
decoded.Seagate_ServoPROMPartNo = new byte[4];
|
||||
Array.Copy(SCSIInquiryResponse, 144, decoded.Seagate_ServoPROMPartNo, 0, 4);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2059,13 +2057,12 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendLine("============================================================");
|
||||
}
|
||||
|
||||
if(response.VendorSpecific2 != null)
|
||||
{
|
||||
sb.AppendFormat("Vendor-specific bytes 96 to {0}", response.AdditionalLength + 4).AppendLine();
|
||||
sb.AppendLine("============================================================");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VendorSpecific2, 60));
|
||||
sb.AppendLine("============================================================");
|
||||
}
|
||||
if(response.VendorSpecific2 == null) return sb.ToString();
|
||||
|
||||
sb.AppendFormat("Vendor-specific bytes 96 to {0}", response.AdditionalLength + 4).AppendLine();
|
||||
sb.AppendLine("============================================================");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VendorSpecific2, 60));
|
||||
sb.AppendLine("============================================================");
|
||||
#endif
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
@@ -316,15 +316,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.DiscApplicationCode = response[32];
|
||||
decoded.OPCTablesNumber = response[33];
|
||||
|
||||
if(decoded.OPCTablesNumber > 0 && response.Length == decoded.OPCTablesNumber * 8 + 34)
|
||||
if(decoded.OPCTablesNumber <= 0 || response.Length != decoded.OPCTablesNumber * 8 + 34) return decoded;
|
||||
|
||||
decoded.OPCTables = new OPCTable[decoded.OPCTablesNumber];
|
||||
for(int i = 0; i < decoded.OPCTablesNumber; i++)
|
||||
{
|
||||
decoded.OPCTables = new OPCTable[decoded.OPCTablesNumber];
|
||||
for(int i = 0; i < decoded.OPCTablesNumber; i++)
|
||||
{
|
||||
decoded.OPCTables[i].Speed = (ushort)((response[34 + i * 8 + 0] << 16) + response[34 + i * 8 + 1]);
|
||||
decoded.OPCTables[i].OPCValues = new byte[6];
|
||||
Array.Copy(response, 34 + i * 8 + 2, decoded.OPCTables[i].OPCValues, 0, 6);
|
||||
}
|
||||
decoded.OPCTables[i].Speed = (ushort)((response[34 + i * 8 + 0] << 16) + response[34 + i * 8 + 1]);
|
||||
decoded.OPCTables[i].OPCValues = new byte[6];
|
||||
Array.Copy(response, 34 + i * 8 + 2, decoded.OPCTables[i].OPCValues, 0, 6);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
@@ -425,11 +424,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
if(decoded.DBC_V) sb.AppendFormat("Disc barcode: {0:X16}", decoded.DiscBarcode).AppendLine();
|
||||
if(decoded.DAC_V) sb.AppendFormat("Disc application code: {0}", decoded.DiscApplicationCode).AppendLine();
|
||||
|
||||
if(decoded.OPCTables != null)
|
||||
foreach(OPCTable table in decoded.OPCTables)
|
||||
sb.AppendFormat("OPC values for {0}Kbit/sec.: {1}, {2}, {3}, {4}, {5}, {6}", table.Speed,
|
||||
table.OPCValues[0], table.OPCValues[1], table.OPCValues[2], table.OPCValues[3],
|
||||
table.OPCValues[4], table.OPCValues[5]).AppendLine();
|
||||
if(decoded.OPCTables == null) return sb.ToString();
|
||||
|
||||
foreach(OPCTable table in decoded.OPCTables)
|
||||
sb.AppendFormat("OPC values for {0}Kbit/sec.: {1}, {2}, {3}, {4}, {5}, {6}", table.Speed,
|
||||
table.OPCValues[0], table.OPCValues[1], table.OPCValues[2], table.OPCValues[3],
|
||||
table.OPCValues[4], table.OPCValues[5]).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -2274,11 +2274,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Lock |= (feature[4] & 0x01) == 0x01;
|
||||
}
|
||||
|
||||
if(decoded.Version >= 2)
|
||||
{
|
||||
decoded.Load |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.DBML |= (feature[4] & 0x02) == 0x02;
|
||||
}
|
||||
if(decoded.Version < 2) return decoded;
|
||||
|
||||
decoded.Load |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.DBML |= (feature[4] & 0x02) == 0x02;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2332,13 +2331,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.LogicalBlockSize =
|
||||
(uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]);
|
||||
decoded.Blocking = (ushort)((feature[8] << 8) + feature[9]);
|
||||
decoded.PP |= (feature[10] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.LogicalBlockSize =
|
||||
(uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]);
|
||||
decoded.Blocking = (ushort)((feature[8] << 8) + feature[9]);
|
||||
decoded.PP |= (feature[10] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2441,14 +2439,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 1)
|
||||
{
|
||||
decoded.LastLBA = (uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]);
|
||||
decoded.LogicalBlockSize =
|
||||
(uint)((feature[8] << 24) + (feature[9] << 16) + (feature[10] << 8) + feature[11]);
|
||||
decoded.Blocking = (ushort)((feature[12] << 8) + feature[13]);
|
||||
decoded.PP |= (feature[14] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 1) return decoded;
|
||||
|
||||
decoded.LastLBA = (uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]);
|
||||
decoded.LogicalBlockSize =
|
||||
(uint)((feature[8] << 24) + (feature[9] << 16) + (feature[10] << 8) + feature[11]);
|
||||
decoded.Blocking = (ushort)((feature[12] << 8) + feature[13]);
|
||||
decoded.PP |= (feature[14] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2479,11 +2476,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
if(feature.Length > feature[7] + 8) Array.Copy(feature, 8, decoded.LinkSizes, 0, feature[7]);
|
||||
}
|
||||
|
||||
if(decoded.Version >= 3)
|
||||
{
|
||||
decoded.TRIO |= (feature[6] & 0x04) == 0x04;
|
||||
decoded.ARSV |= (feature[6] & 0x02) == 0x02;
|
||||
}
|
||||
if(decoded.Version < 3) return decoded;
|
||||
|
||||
decoded.TRIO |= (feature[6] & 0x04) == 0x04;
|
||||
decoded.ARSV |= (feature[6] & 0x02) == 0x02;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2582,13 +2578,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.LogicalBlockSize =
|
||||
(uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]);
|
||||
decoded.Blocking = (ushort)((feature[8] << 8) + feature[9]);
|
||||
decoded.PP |= (feature[10] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.LogicalBlockSize =
|
||||
(uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]);
|
||||
decoded.Blocking = (ushort)((feature[8] << 8) + feature[9]);
|
||||
decoded.PP |= (feature[10] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2655,11 +2650,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
if(decoded.Version >= 0) decoded.Write |= (feature[4] & 0x01) == 0x01;
|
||||
|
||||
if(decoded.Version >= 1)
|
||||
{
|
||||
decoded.DVDPWrite |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.DVDPRead |= (feature[4] & 0x02) == 0x02;
|
||||
}
|
||||
if(decoded.Version < 1) return decoded;
|
||||
|
||||
decoded.DVDPWrite |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.DVDPRead |= (feature[4] & 0x02) == 0x02;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2682,12 +2676,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.DRTDM |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.DBICacheZones = feature[5];
|
||||
decoded.Entries = (ushort)((feature[6] << 8) + feature[7]);
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.DRTDM |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.DBICacheZones = feature[5];
|
||||
decoded.Entries = (ushort)((feature[6] << 8) + feature[7]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2762,13 +2755,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.DSDG |= (feature[4] & 0x08) == 0x08;
|
||||
decoded.DSDR |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.Intermediate |= (feature[4] & 0x02) == 0x02;
|
||||
decoded.Blank |= (feature[4] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.DSDG |= (feature[4] & 0x08) == 0x08;
|
||||
decoded.DSDR |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.Intermediate |= (feature[4] & 0x02) == 0x02;
|
||||
decoded.Blank |= (feature[4] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2799,12 +2791,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.DataTypeSupported = (ushort)((feature[6] << 8) + feature[7]);
|
||||
}
|
||||
|
||||
if(decoded.Version >= 2)
|
||||
{
|
||||
decoded.BUF |= (feature[4] & 0x40) == 0x40;
|
||||
decoded.RWRaw |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.RWPack |= (feature[4] & 0x08) == 0x08;
|
||||
}
|
||||
if(decoded.Version < 2) return decoded;
|
||||
|
||||
decoded.BUF |= (feature[4] & 0x40) == 0x40;
|
||||
decoded.RWRaw |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.RWPack |= (feature[4] & 0x08) == 0x08;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2936,11 +2927,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.Intermediate |= (feature[4] & 0x02) == 0x02;
|
||||
decoded.Blank |= (feature[4] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.Intermediate |= (feature[4] & 0x02) == 0x02;
|
||||
decoded.Blank |= (feature[4] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2963,11 +2953,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(feature[7] > 0 && feature.Length > feature[7] + 8)
|
||||
{
|
||||
decoded.LinkSizes = new byte[feature[7]];
|
||||
Array.Copy(feature, 8, decoded.LinkSizes, 0, feature[7]);
|
||||
}
|
||||
if(feature[7] <= 0 || feature.Length <= feature[7] + 8) return decoded;
|
||||
|
||||
decoded.LinkSizes = new byte[feature[7]];
|
||||
Array.Copy(feature, 8, decoded.LinkSizes, 0, feature[7]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3055,12 +3044,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.Write |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.QuickStart |= (feature[5] & 0x02) == 0x02;
|
||||
decoded.CloseOnly |= (feature[5] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.Write |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.QuickStart |= (feature[5] & 0x02) == 0x02;
|
||||
decoded.CloseOnly |= (feature[5] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3113,14 +3101,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.OldROM |= (feature[25] & 0x01) == 0x01;
|
||||
}
|
||||
|
||||
if(decoded.Version >= 1)
|
||||
{
|
||||
decoded.BCA |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.RE2 |= (feature[9] & 0x04) == 0x04;
|
||||
decoded.RE1 |= (feature[9] & 0x02) == 0x02;
|
||||
decoded.R |= (feature[17] & 0x02) == 0x02;
|
||||
decoded.ROM |= (feature[25] & 0x02) == 0x02;
|
||||
}
|
||||
if(decoded.Version < 1) return decoded;
|
||||
|
||||
decoded.BCA |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.RE2 |= (feature[9] & 0x04) == 0x04;
|
||||
decoded.RE1 |= (feature[9] & 0x02) == 0x02;
|
||||
decoded.R |= (feature[17] & 0x02) == 0x02;
|
||||
decoded.ROM |= (feature[25] & 0x02) == 0x02;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3150,12 +3137,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.OldR |= (feature[17] & 0x01) == 0x01;
|
||||
}
|
||||
|
||||
if(decoded.Version >= 1)
|
||||
{
|
||||
decoded.RE2 |= (feature[9] & 0x04) == 0x04;
|
||||
decoded.RE1 |= (feature[9] & 0x02) == 0x02;
|
||||
decoded.R |= (feature[17] & 0x02) == 0x02;
|
||||
}
|
||||
if(decoded.Version < 1) return decoded;
|
||||
|
||||
decoded.RE2 |= (feature[9] & 0x04) == 0x04;
|
||||
decoded.RE1 |= (feature[9] & 0x02) == 0x02;
|
||||
decoded.R |= (feature[17] & 0x02) == 0x02;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3199,11 +3185,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.HDDVDR |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.HDDVDRAM |= (feature[6] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.HDDVDR |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.HDDVDRAM |= (feature[6] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3226,11 +3211,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.HDDVDR |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.HDDVDRAM |= (feature[6] & 0x01) == 0x01;
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.HDDVDR |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.HDDVDRAM |= (feature[6] & 0x01) == 0x01;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3320,12 +3304,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.SCC |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.SDP |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.HighestSlotNumber = (byte)(feature[7] & 0x1F);
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.SCC |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.SDP |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.HighestSlotNumber = (byte)(feature[7] & 0x1F);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3348,13 +3331,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.Scan |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.SCM |= (feature[4] & 0x02) == 0x02;
|
||||
decoded.SV |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.VolumeLevels = (ushort)((feature[6] << 8) + feature[7]);
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.Scan |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.SCM |= (feature[4] & 0x02) == 0x02;
|
||||
decoded.SV |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.VolumeLevels = (ushort)((feature[6] << 8) + feature[7]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3400,11 +3382,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 1 && feature.Length >= 8)
|
||||
{
|
||||
decoded.Group3 |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.UnitLength = (ushort)((feature[6] << 8) + feature[7]);
|
||||
}
|
||||
if(decoded.Version < 1 || feature.Length < 8) return decoded;
|
||||
|
||||
decoded.Group3 |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.UnitLength = (ushort)((feature[6] << 8) + feature[7]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3459,11 +3440,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.SW |= (feature[4] & 0x01) == 0x01;
|
||||
}
|
||||
|
||||
if(decoded.Version >= 5 && feature.Length >= 8)
|
||||
{
|
||||
decoded.SMP |= (feature[4] & 0x20) == 0x20;
|
||||
decoded.RBCB |= (feature[4] & 0x10) == 0x10;
|
||||
}
|
||||
if(decoded.Version < 5 || feature.Length < 8) return decoded;
|
||||
|
||||
decoded.SMP |= (feature[4] & 0x20) == 0x20;
|
||||
decoded.RBCB |= (feature[4] & 0x10) == 0x10;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3486,12 +3466,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
byte[] serial = new byte[feature.Length];
|
||||
Array.Copy(feature, 4, serial, 0, feature.Length - 4);
|
||||
decoded.Serial = StringHandlers.CToString(serial).Trim();
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
byte[] serial = new byte[feature.Length];
|
||||
Array.Copy(feature, 4, serial, 0, feature.Length - 4);
|
||||
decoded.Serial = StringHandlers.CToString(serial).Trim();
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3535,13 +3514,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.DCBs = new uint[feature[3] / 4];
|
||||
for(int i = 0; i < decoded.DCBs.Length; i++)
|
||||
decoded.DCBs[i] = (uint)((feature[0 + 4 + i * 4] << 24) + (feature[1 + 4 + i * 4] << 16) +
|
||||
(feature[2 + 4 + i * 4] << 8) + feature[3 + 4 + i * 4]);
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.DCBs = new uint[feature[3] / 4];
|
||||
for(int i = 0; i < decoded.DCBs.Length; i++)
|
||||
decoded.DCBs[i] = (uint)((feature[0 + 4 + i * 4] << 24) + (feature[1 + 4 + i * 4] << 16) +
|
||||
(feature[2 + 4 + i * 4] << 8) + feature[3 + 4 + i * 4]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3587,16 +3565,15 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.Century = (ushort)((feature[4] << 8) + feature[5]);
|
||||
decoded.Year = (ushort)((feature[6] << 8) + feature[7]);
|
||||
decoded.Month = (ushort)((feature[8] << 8) + feature[9]);
|
||||
decoded.Day = (ushort)((feature[10] << 8) + feature[11]);
|
||||
decoded.Hour = (ushort)((feature[12] << 8) + feature[13]);
|
||||
decoded.Minute = (ushort)((feature[14] << 8) + feature[15]);
|
||||
decoded.Second = (ushort)((feature[16] << 8) + feature[17]);
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.Century = (ushort)((feature[4] << 8) + feature[5]);
|
||||
decoded.Year = (ushort)((feature[6] << 8) + feature[7]);
|
||||
decoded.Month = (ushort)((feature[8] << 8) + feature[9]);
|
||||
decoded.Day = (ushort)((feature[10] << 8) + feature[11]);
|
||||
decoded.Hour = (ushort)((feature[12] << 8) + feature[13]);
|
||||
decoded.Minute = (ushort)((feature[14] << 8) + feature[15]);
|
||||
decoded.Second = (ushort)((feature[16] << 8) + feature[17]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3627,13 +3604,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.AACSVersion = feature[7];
|
||||
}
|
||||
|
||||
if(decoded.Version >= 2)
|
||||
{
|
||||
decoded.RDC |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.RMC |= (feature[4] & 0x08) == 0x08;
|
||||
decoded.WBE |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.BEC |= (feature[4] & 0x02) == 0x02;
|
||||
}
|
||||
if(decoded.Version < 2) return decoded;
|
||||
|
||||
decoded.RDC |= (feature[4] & 0x10) == 0x10;
|
||||
decoded.RMC |= (feature[4] & 0x08) == 0x08;
|
||||
decoded.WBE |= (feature[4] & 0x04) == 0x04;
|
||||
decoded.BEC |= (feature[4] & 0x02) == 0x02;
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3721,16 +3697,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
if(decoded.Version >= 0)
|
||||
{
|
||||
decoded.PSAU |= (feature[4] & 0x80) == 0x80;
|
||||
decoded.LOSPB |= (feature[4] & 0x40) == 0x40;
|
||||
decoded.ME |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.Profiles = new ushort[feature[5]];
|
||||
if(feature[5] * 2 + 6 == feature.Length)
|
||||
for(int i = 0; i < feature[5]; i++)
|
||||
decoded.Profiles[i] = (ushort)((feature[0 + 6 + 2 * i] << 8) + feature[1 + 6 + 2 * i]);
|
||||
}
|
||||
if(decoded.Version < 0) return decoded;
|
||||
|
||||
decoded.PSAU |= (feature[4] & 0x80) == 0x80;
|
||||
decoded.LOSPB |= (feature[4] & 0x40) == 0x40;
|
||||
decoded.ME |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.Profiles = new ushort[feature[5]];
|
||||
if(feature[5] * 2 + 6 != feature.Length) return decoded;
|
||||
|
||||
for(int i = 0; i < feature[5]; i++)
|
||||
decoded.Profiles[i] = (ushort)((feature[0 + 6 + 2 * i] << 8) + feature[1 + 6 + 2 * i]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3743,137 +3719,138 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine("MMC Supported Profiles:");
|
||||
if(ftr.Profiles != null)
|
||||
foreach(Profile prof in ftr.Profiles)
|
||||
{
|
||||
switch(prof.Number)
|
||||
{
|
||||
case ProfileNumber.Reserved:
|
||||
sb.Append("\tDrive reported a reserved profile number");
|
||||
break;
|
||||
case ProfileNumber.NonRemovable:
|
||||
sb.Append("\tDrive supports non-removable changeable media");
|
||||
break;
|
||||
case ProfileNumber.Removable:
|
||||
sb.Append("\tDrive supports rewritable and removable media");
|
||||
break;
|
||||
case ProfileNumber.MOErasable:
|
||||
sb.Append("\tDrive supports Magnet-Optical media");
|
||||
break;
|
||||
case ProfileNumber.OpticalWORM:
|
||||
sb.Append("\tDrive supports optical write-once media");
|
||||
break;
|
||||
case ProfileNumber.ASMO:
|
||||
sb.Append("\tDrive supports Advanced Storage - Magneto-Optical");
|
||||
break;
|
||||
case ProfileNumber.CDROM:
|
||||
sb.Append("\tDrive supports CD-ROM");
|
||||
break;
|
||||
case ProfileNumber.CDR:
|
||||
sb.Append("\tDrive supports CD-R");
|
||||
break;
|
||||
case ProfileNumber.CDRW:
|
||||
sb.Append("\tDrive supports CD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDROM:
|
||||
sb.Append("\tDrive supports DVD-ROM");
|
||||
break;
|
||||
case ProfileNumber.DVDRSeq:
|
||||
sb.Append("\tDrive supports DVD-R");
|
||||
break;
|
||||
case ProfileNumber.DVDRAM:
|
||||
sb.Append("\tDrive supports DVD-RAM");
|
||||
break;
|
||||
case ProfileNumber.DVDRWRes:
|
||||
sb.Append("\tDrive supports restricted overwrite DVD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRWSeq:
|
||||
sb.Append("\tDrive supports sequentially recorded DVD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRDLSeq:
|
||||
sb.Append("\tDrive supports sequentially recorded DVD-R DL");
|
||||
break;
|
||||
case ProfileNumber.DVDRDLJump:
|
||||
sb.Append("\tDrive supports layer jump recorded DVD-R DL");
|
||||
break;
|
||||
case ProfileNumber.DVDRWDL:
|
||||
sb.Append("\tDrive supports DVD-RW DL");
|
||||
break;
|
||||
case ProfileNumber.DVDDownload:
|
||||
sb.Append("\tDrive supports DVD-Download");
|
||||
break;
|
||||
case ProfileNumber.DVDRWPlus:
|
||||
sb.Append("\tDrive supports DVD+RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRPlus:
|
||||
sb.Append("\tDrive supports DVD+R");
|
||||
break;
|
||||
case ProfileNumber.DDCDROM:
|
||||
sb.Append("\tDrive supports DDCD-ROM");
|
||||
break;
|
||||
case ProfileNumber.DDCDR:
|
||||
sb.Append("\tDrive supports DDCD-R");
|
||||
break;
|
||||
case ProfileNumber.DDCDRW:
|
||||
sb.Append("\tDrive supports DDCD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRWDLPlus:
|
||||
sb.Append("\tDrive supports DVD+RW DL");
|
||||
break;
|
||||
case ProfileNumber.DVDRDLPlus:
|
||||
sb.Append("\tDrive supports DVD+R DL");
|
||||
break;
|
||||
case ProfileNumber.BDROM:
|
||||
sb.Append("\tDrive supports BD-ROM");
|
||||
break;
|
||||
case ProfileNumber.BDRSeq:
|
||||
sb.Append("\tDrive supports BD-R SRM");
|
||||
break;
|
||||
case ProfileNumber.BDRRdm:
|
||||
sb.Append("\tDrive supports BD-R RRM");
|
||||
break;
|
||||
case ProfileNumber.BDRE:
|
||||
sb.Append("\tDrive supports BD-RE");
|
||||
break;
|
||||
case ProfileNumber.HDDVDROM:
|
||||
sb.Append("\tDrive supports HD DVD-ROM");
|
||||
break;
|
||||
case ProfileNumber.HDDVDR:
|
||||
sb.Append("\tDrive supports HD DVD-R");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRAM:
|
||||
sb.Append("\tDrive supports HD DVD-RAM");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRW:
|
||||
sb.Append("\tDrive supports HD DVD-RW");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRDL:
|
||||
sb.Append("\tDrive supports HD DVD-R DL");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRWDL:
|
||||
sb.Append("\tDrive supports HD DVD-RW DL");
|
||||
break;
|
||||
case ProfileNumber.HDBURNROM:
|
||||
sb.Append("\tDrive supports HDBurn CD-ROM");
|
||||
break;
|
||||
case ProfileNumber.HDBURNR:
|
||||
sb.Append("\tDrive supports HDBurn CD-R");
|
||||
break;
|
||||
case ProfileNumber.HDBURNRW:
|
||||
sb.Append("\tDrive supports HDBurn CD-RW");
|
||||
break;
|
||||
case ProfileNumber.Unconforming:
|
||||
sb.Append("\tDrive is not conforming to any profile");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tDrive informs of unknown profile 0x{0:X4}", (ushort)prof.Number);
|
||||
break;
|
||||
}
|
||||
if(ftr.Profiles == null) return sb.ToString();
|
||||
|
||||
if(prof.Current) sb.AppendLine(" (current)");
|
||||
else sb.AppendLine();
|
||||
foreach(Profile prof in ftr.Profiles)
|
||||
{
|
||||
switch(prof.Number)
|
||||
{
|
||||
case ProfileNumber.Reserved:
|
||||
sb.Append("\tDrive reported a reserved profile number");
|
||||
break;
|
||||
case ProfileNumber.NonRemovable:
|
||||
sb.Append("\tDrive supports non-removable changeable media");
|
||||
break;
|
||||
case ProfileNumber.Removable:
|
||||
sb.Append("\tDrive supports rewritable and removable media");
|
||||
break;
|
||||
case ProfileNumber.MOErasable:
|
||||
sb.Append("\tDrive supports Magnet-Optical media");
|
||||
break;
|
||||
case ProfileNumber.OpticalWORM:
|
||||
sb.Append("\tDrive supports optical write-once media");
|
||||
break;
|
||||
case ProfileNumber.ASMO:
|
||||
sb.Append("\tDrive supports Advanced Storage - Magneto-Optical");
|
||||
break;
|
||||
case ProfileNumber.CDROM:
|
||||
sb.Append("\tDrive supports CD-ROM");
|
||||
break;
|
||||
case ProfileNumber.CDR:
|
||||
sb.Append("\tDrive supports CD-R");
|
||||
break;
|
||||
case ProfileNumber.CDRW:
|
||||
sb.Append("\tDrive supports CD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDROM:
|
||||
sb.Append("\tDrive supports DVD-ROM");
|
||||
break;
|
||||
case ProfileNumber.DVDRSeq:
|
||||
sb.Append("\tDrive supports DVD-R");
|
||||
break;
|
||||
case ProfileNumber.DVDRAM:
|
||||
sb.Append("\tDrive supports DVD-RAM");
|
||||
break;
|
||||
case ProfileNumber.DVDRWRes:
|
||||
sb.Append("\tDrive supports restricted overwrite DVD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRWSeq:
|
||||
sb.Append("\tDrive supports sequentially recorded DVD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRDLSeq:
|
||||
sb.Append("\tDrive supports sequentially recorded DVD-R DL");
|
||||
break;
|
||||
case ProfileNumber.DVDRDLJump:
|
||||
sb.Append("\tDrive supports layer jump recorded DVD-R DL");
|
||||
break;
|
||||
case ProfileNumber.DVDRWDL:
|
||||
sb.Append("\tDrive supports DVD-RW DL");
|
||||
break;
|
||||
case ProfileNumber.DVDDownload:
|
||||
sb.Append("\tDrive supports DVD-Download");
|
||||
break;
|
||||
case ProfileNumber.DVDRWPlus:
|
||||
sb.Append("\tDrive supports DVD+RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRPlus:
|
||||
sb.Append("\tDrive supports DVD+R");
|
||||
break;
|
||||
case ProfileNumber.DDCDROM:
|
||||
sb.Append("\tDrive supports DDCD-ROM");
|
||||
break;
|
||||
case ProfileNumber.DDCDR:
|
||||
sb.Append("\tDrive supports DDCD-R");
|
||||
break;
|
||||
case ProfileNumber.DDCDRW:
|
||||
sb.Append("\tDrive supports DDCD-RW");
|
||||
break;
|
||||
case ProfileNumber.DVDRWDLPlus:
|
||||
sb.Append("\tDrive supports DVD+RW DL");
|
||||
break;
|
||||
case ProfileNumber.DVDRDLPlus:
|
||||
sb.Append("\tDrive supports DVD+R DL");
|
||||
break;
|
||||
case ProfileNumber.BDROM:
|
||||
sb.Append("\tDrive supports BD-ROM");
|
||||
break;
|
||||
case ProfileNumber.BDRSeq:
|
||||
sb.Append("\tDrive supports BD-R SRM");
|
||||
break;
|
||||
case ProfileNumber.BDRRdm:
|
||||
sb.Append("\tDrive supports BD-R RRM");
|
||||
break;
|
||||
case ProfileNumber.BDRE:
|
||||
sb.Append("\tDrive supports BD-RE");
|
||||
break;
|
||||
case ProfileNumber.HDDVDROM:
|
||||
sb.Append("\tDrive supports HD DVD-ROM");
|
||||
break;
|
||||
case ProfileNumber.HDDVDR:
|
||||
sb.Append("\tDrive supports HD DVD-R");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRAM:
|
||||
sb.Append("\tDrive supports HD DVD-RAM");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRW:
|
||||
sb.Append("\tDrive supports HD DVD-RW");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRDL:
|
||||
sb.Append("\tDrive supports HD DVD-R DL");
|
||||
break;
|
||||
case ProfileNumber.HDDVDRWDL:
|
||||
sb.Append("\tDrive supports HD DVD-RW DL");
|
||||
break;
|
||||
case ProfileNumber.HDBURNROM:
|
||||
sb.Append("\tDrive supports HDBurn CD-ROM");
|
||||
break;
|
||||
case ProfileNumber.HDBURNR:
|
||||
sb.Append("\tDrive supports HDBurn CD-R");
|
||||
break;
|
||||
case ProfileNumber.HDBURNRW:
|
||||
sb.Append("\tDrive supports HDBurn CD-RW");
|
||||
break;
|
||||
case ProfileNumber.Unconforming:
|
||||
sb.Append("\tDrive is not conforming to any profile");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tDrive informs of unknown profile 0x{0:X4}", (ushort)prof.Number);
|
||||
break;
|
||||
}
|
||||
|
||||
if(prof.Current) sb.AppendLine(" (current)");
|
||||
else sb.AppendLine();
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -4337,27 +4314,26 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
if(ftr.TestWrite) sb.AppendLine("\tDrive can do a test writing");
|
||||
if(ftr.BUF) sb.AppendLine("\tDrive supports zero loss linking");
|
||||
|
||||
if(ftr.DataTypeSupported > 0)
|
||||
{
|
||||
sb.Append("\tDrive supports data block types:");
|
||||
if((ftr.DataTypeSupported & 0x0001) == 0x0001) sb.Append(" 0");
|
||||
if((ftr.DataTypeSupported & 0x0002) == 0x0002) sb.Append(" 1");
|
||||
if((ftr.DataTypeSupported & 0x0004) == 0x0004) sb.Append(" 2");
|
||||
if((ftr.DataTypeSupported & 0x0008) == 0x0008) sb.Append(" 3");
|
||||
if((ftr.DataTypeSupported & 0x0010) == 0x0010) sb.Append(" 4");
|
||||
if((ftr.DataTypeSupported & 0x0020) == 0x0020) sb.Append(" 5");
|
||||
if((ftr.DataTypeSupported & 0x0040) == 0x0040) sb.Append(" 6");
|
||||
if((ftr.DataTypeSupported & 0x0080) == 0x0080) sb.Append(" 7");
|
||||
if((ftr.DataTypeSupported & 0x0100) == 0x0100) sb.Append(" 8");
|
||||
if((ftr.DataTypeSupported & 0x0200) == 0x0200) sb.Append(" 9");
|
||||
if((ftr.DataTypeSupported & 0x0400) == 0x0400) sb.Append(" 10");
|
||||
if((ftr.DataTypeSupported & 0x0800) == 0x0800) sb.Append(" 11");
|
||||
if((ftr.DataTypeSupported & 0x1000) == 0x1000) sb.Append(" 12");
|
||||
if((ftr.DataTypeSupported & 0x2000) == 0x2000) sb.Append(" 13");
|
||||
if((ftr.DataTypeSupported & 0x4000) == 0x4000) sb.Append(" 14");
|
||||
if((ftr.DataTypeSupported & 0x8000) == 0x8000) sb.Append(" 15");
|
||||
sb.AppendLine();
|
||||
}
|
||||
if(ftr.DataTypeSupported <= 0) return sb.ToString();
|
||||
|
||||
sb.Append("\tDrive supports data block types:");
|
||||
if((ftr.DataTypeSupported & 0x0001) == 0x0001) sb.Append(" 0");
|
||||
if((ftr.DataTypeSupported & 0x0002) == 0x0002) sb.Append(" 1");
|
||||
if((ftr.DataTypeSupported & 0x0004) == 0x0004) sb.Append(" 2");
|
||||
if((ftr.DataTypeSupported & 0x0008) == 0x0008) sb.Append(" 3");
|
||||
if((ftr.DataTypeSupported & 0x0010) == 0x0010) sb.Append(" 4");
|
||||
if((ftr.DataTypeSupported & 0x0020) == 0x0020) sb.Append(" 5");
|
||||
if((ftr.DataTypeSupported & 0x0040) == 0x0040) sb.Append(" 6");
|
||||
if((ftr.DataTypeSupported & 0x0080) == 0x0080) sb.Append(" 7");
|
||||
if((ftr.DataTypeSupported & 0x0100) == 0x0100) sb.Append(" 8");
|
||||
if((ftr.DataTypeSupported & 0x0200) == 0x0200) sb.Append(" 9");
|
||||
if((ftr.DataTypeSupported & 0x0400) == 0x0400) sb.Append(" 10");
|
||||
if((ftr.DataTypeSupported & 0x0800) == 0x0800) sb.Append(" 11");
|
||||
if((ftr.DataTypeSupported & 0x1000) == 0x1000) sb.Append(" 12");
|
||||
if((ftr.DataTypeSupported & 0x2000) == 0x2000) sb.Append(" 13");
|
||||
if((ftr.DataTypeSupported & 0x4000) == 0x4000) sb.Append(" 14");
|
||||
if((ftr.DataTypeSupported & 0x8000) == 0x8000) sb.Append(" 15");
|
||||
sb.AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -4449,9 +4425,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
sb.AppendLine("MMC Layer Jump Recording:");
|
||||
|
||||
if(ftr.LinkSizes != null)
|
||||
foreach(byte link in ftr.LinkSizes)
|
||||
sb.AppendFormat("\tCurrent media has a {0} bytes link available", link).AppendLine();
|
||||
if(ftr.LinkSizes == null) return sb.ToString();
|
||||
|
||||
foreach(byte link in ftr.LinkSizes)
|
||||
sb.AppendFormat("\tCurrent media has a {0} bytes link available", link).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -4469,19 +4446,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine("Drive can write CD-RW");
|
||||
if(ftr.SubtypeSupport > 0)
|
||||
{
|
||||
sb.Append("\tDrive supports CD-RW subtypes");
|
||||
if((ftr.SubtypeSupport & 0x01) == 0x01) sb.Append(" 0");
|
||||
if((ftr.SubtypeSupport & 0x02) == 0x02) sb.Append(" 1");
|
||||
if((ftr.SubtypeSupport & 0x04) == 0x04) sb.Append(" 2");
|
||||
if((ftr.SubtypeSupport & 0x08) == 0x08) sb.Append(" 3");
|
||||
if((ftr.SubtypeSupport & 0x10) == 0x10) sb.Append(" 4");
|
||||
if((ftr.SubtypeSupport & 0x20) == 0x20) sb.Append(" 5");
|
||||
if((ftr.SubtypeSupport & 0x40) == 0x40) sb.Append(" 6");
|
||||
if((ftr.SubtypeSupport & 0x80) == 0x80) sb.Append(" 7");
|
||||
sb.AppendLine();
|
||||
}
|
||||
if(ftr.SubtypeSupport <= 0) return sb.ToString();
|
||||
|
||||
sb.Append("\tDrive supports CD-RW subtypes");
|
||||
if((ftr.SubtypeSupport & 0x01) == 0x01) sb.Append(" 0");
|
||||
if((ftr.SubtypeSupport & 0x02) == 0x02) sb.Append(" 1");
|
||||
if((ftr.SubtypeSupport & 0x04) == 0x04) sb.Append(" 2");
|
||||
if((ftr.SubtypeSupport & 0x08) == 0x08) sb.Append(" 3");
|
||||
if((ftr.SubtypeSupport & 0x10) == 0x10) sb.Append(" 4");
|
||||
if((ftr.SubtypeSupport & 0x20) == 0x20) sb.Append(" 5");
|
||||
if((ftr.SubtypeSupport & 0x40) == 0x40) sb.Append(" 6");
|
||||
if((ftr.SubtypeSupport & 0x80) == 0x80) sb.Append(" 7");
|
||||
sb.AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -4722,12 +4698,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
sb.AppendLine("Drive supports Timeout & Protect mode page 1Dh");
|
||||
|
||||
if(ftr.Group3)
|
||||
{
|
||||
sb.AppendLine("\tDrive supports the Group3 in Timeout & Protect mode page 1Dh");
|
||||
if(ftr.UnitLength > 0)
|
||||
sb.AppendFormat("\tDrive has {0} increase of Group 3 time unit", ftr.UnitLength).AppendLine();
|
||||
}
|
||||
if(!ftr.Group3) return sb.ToString();
|
||||
|
||||
sb.AppendLine("\tDrive supports the Group3 in Timeout & Protect mode page 1Dh");
|
||||
if(ftr.UnitLength > 0)
|
||||
sb.AppendFormat("\tDrive has {0} increase of Group 3 time unit", ftr.UnitLength).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -4791,7 +4766,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Feature_010A ftr = feature.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if(ftr.DCBs != null) foreach(uint DCB in ftr.DCBs) sb.AppendFormat("Drive supports DCB {0:X8}h", DCB).AppendLine();
|
||||
if(ftr.DCBs == null) return sb.ToString();
|
||||
|
||||
foreach(uint DCB in ftr.DCBs) sb.AppendFormat("Drive supports DCB {0:X8}h", DCB).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -4946,9 +4923,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
if(ftr.LOSPB) sb.AppendLine("\tDrive supports linked OSPBs");
|
||||
if(ftr.ME) sb.AppendLine("\tDrive will only record on the OSSC Disc Format");
|
||||
|
||||
if(ftr.Profiles != null)
|
||||
for(int i = 0; i < ftr.Profiles.Length; i++)
|
||||
sb.AppendFormat("\tProfile {0}: {1}", i, ftr.Profiles[i]).AppendLine();
|
||||
if(ftr.Profiles == null) return sb.ToString();
|
||||
|
||||
for(int i = 0; i < ftr.Profiles.Length; i++)
|
||||
sb.AppendFormat("\tProfile {0}: {1}", i, ftr.Profiles[i]).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -110,12 +110,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(page.DVW) sb.AppendLine("\tVerifying after writing is disabled");
|
||||
if(page.DDE) sb.AppendLine("\tDrive will abort when a writing error is detected");
|
||||
|
||||
if(page.SLM)
|
||||
{
|
||||
sb.Append("\tDrive has two LUNs with rewritable being ");
|
||||
if(page.SLM) sb.AppendLine("LUN 1");
|
||||
else sb.AppendLine("LUN 0");
|
||||
}
|
||||
if(!page.SLM) return sb.ToString();
|
||||
|
||||
sb.Append("\tDrive has two LUNs with rewritable being ");
|
||||
if(page.SLM) sb.AppendLine("LUN 1");
|
||||
else sb.AppendLine("LUN 0");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -228,26 +228,25 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
}
|
||||
|
||||
if(page.OutputPort3ChannelSelection > 0)
|
||||
{
|
||||
sb.Append("\tOutput port 3 has channels ");
|
||||
if((page.OutputPort3ChannelSelection & 0x01) == 0x01) sb.Append("0 ");
|
||||
if((page.OutputPort3ChannelSelection & 0x02) == 0x02) sb.Append("1 ");
|
||||
if((page.OutputPort3ChannelSelection & 0x04) == 0x04) sb.Append("2 ");
|
||||
if((page.OutputPort3ChannelSelection & 0x08) == 0x08) sb.Append("3 ");
|
||||
if(page.OutputPort3ChannelSelection <= 0) return sb.ToString();
|
||||
|
||||
switch(page.OutputPort3Volume)
|
||||
{
|
||||
case 0:
|
||||
sb.AppendLine("muted");
|
||||
break;
|
||||
case 0xFF:
|
||||
sb.AppendLine("at maximum volume");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("at volume {0}", page.OutputPort3Volume).AppendLine();
|
||||
break;
|
||||
}
|
||||
sb.Append("\tOutput port 3 has channels ");
|
||||
if((page.OutputPort3ChannelSelection & 0x01) == 0x01) sb.Append("0 ");
|
||||
if((page.OutputPort3ChannelSelection & 0x02) == 0x02) sb.Append("1 ");
|
||||
if((page.OutputPort3ChannelSelection & 0x04) == 0x04) sb.Append("2 ");
|
||||
if((page.OutputPort3ChannelSelection & 0x08) == 0x08) sb.Append("3 ");
|
||||
|
||||
switch(page.OutputPort3Volume)
|
||||
{
|
||||
case 0:
|
||||
sb.AppendLine("muted");
|
||||
break;
|
||||
case 0xFF:
|
||||
sb.AppendLine("at maximum volume");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("at volume {0}", page.OutputPort3Volume).AppendLine();
|
||||
break;
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
@@ -91,11 +91,10 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\tVendor-specific mode control: {0}", page.ModeControl);
|
||||
sb.AppendFormat("\tVendor-specific velocity setting: {0}", page.VelocitySetting);
|
||||
|
||||
if(page.EncryptionCapable)
|
||||
{
|
||||
sb.AppendLine("\tDrive supports encryption");
|
||||
if(page.EncryptionEnabled) sb.AppendLine("\tDrive has encryption enabled");
|
||||
}
|
||||
if(!page.EncryptionCapable) return sb.ToString();
|
||||
|
||||
sb.AppendLine("\tDrive supports encryption");
|
||||
if(page.EncryptionEnabled) sb.AppendLine("\tDrive has encryption enabled");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -236,37 +236,38 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(longLBA) hdr[4] += 0x01;
|
||||
|
||||
if(header.BlockDescriptors != null)
|
||||
if(longLBA)
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
byte[] temp = BitConverter.GetBytes(header.BlockDescriptors[i].Blocks);
|
||||
hdr[7 + i * 16 + 8] = temp[0];
|
||||
hdr[6 + i * 16 + 8] = temp[1];
|
||||
hdr[5 + i * 16 + 8] = temp[2];
|
||||
hdr[4 + i * 16 + 8] = temp[3];
|
||||
hdr[3 + i * 16 + 8] = temp[4];
|
||||
hdr[2 + i * 16 + 8] = temp[5];
|
||||
hdr[1 + i * 16 + 8] = temp[6];
|
||||
hdr[0 + i * 16 + 8] = temp[7];
|
||||
hdr[12 + i * 16 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF000000) >> 24);
|
||||
hdr[13 + i * 16 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF0000) >> 16);
|
||||
hdr[14 + i * 16 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF00) >> 8);
|
||||
hdr[15 + i * 16 + 8] = (byte)(header.BlockDescriptors[i].BlockLength & 0xFF);
|
||||
}
|
||||
else
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
if(deviceType != PeripheralDeviceTypes.DirectAccess)
|
||||
hdr[0 + i * 8 + 8] = (byte)header.BlockDescriptors[i].Density;
|
||||
else hdr[0 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF000000) >> 24);
|
||||
hdr[1 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF0000) >> 16);
|
||||
hdr[2 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF00) >> 8);
|
||||
hdr[3 + i * 8 + 8] = (byte)(header.BlockDescriptors[i].Blocks & 0xFF);
|
||||
hdr[5 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF0000) >> 16);
|
||||
hdr[6 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF00) >> 8);
|
||||
hdr[7 + i * 8 + 8] = (byte)(header.BlockDescriptors[i].BlockLength & 0xFF);
|
||||
}
|
||||
if(header.BlockDescriptors == null) return hdr;
|
||||
|
||||
if(longLBA)
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
byte[] temp = BitConverter.GetBytes(header.BlockDescriptors[i].Blocks);
|
||||
hdr[7 + i * 16 + 8] = temp[0];
|
||||
hdr[6 + i * 16 + 8] = temp[1];
|
||||
hdr[5 + i * 16 + 8] = temp[2];
|
||||
hdr[4 + i * 16 + 8] = temp[3];
|
||||
hdr[3 + i * 16 + 8] = temp[4];
|
||||
hdr[2 + i * 16 + 8] = temp[5];
|
||||
hdr[1 + i * 16 + 8] = temp[6];
|
||||
hdr[0 + i * 16 + 8] = temp[7];
|
||||
hdr[12 + i * 16 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF000000) >> 24);
|
||||
hdr[13 + i * 16 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF0000) >> 16);
|
||||
hdr[14 + i * 16 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF00) >> 8);
|
||||
hdr[15 + i * 16 + 8] = (byte)(header.BlockDescriptors[i].BlockLength & 0xFF);
|
||||
}
|
||||
else
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
if(deviceType != PeripheralDeviceTypes.DirectAccess)
|
||||
hdr[0 + i * 8 + 8] = (byte)header.BlockDescriptors[i].Density;
|
||||
else hdr[0 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF000000) >> 24);
|
||||
hdr[1 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF0000) >> 16);
|
||||
hdr[2 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF00) >> 8);
|
||||
hdr[3 + i * 8 + 8] = (byte)(header.BlockDescriptors[i].Blocks & 0xFF);
|
||||
hdr[5 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF0000) >> 16);
|
||||
hdr[6 + i * 8 + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF00) >> 8);
|
||||
hdr[7 + i * 8 + 8] = (byte)(header.BlockDescriptors[i].BlockLength & 0xFF);
|
||||
}
|
||||
|
||||
return hdr;
|
||||
}
|
||||
@@ -282,7 +283,8 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
Array.Copy(hdr, 0, md, 0, hdr.Length);
|
||||
|
||||
if(mode.Pages != null)
|
||||
if(mode.Pages == null) return md;
|
||||
|
||||
{
|
||||
int offset = hdr.Length;
|
||||
foreach(ModePage page in mode.Pages)
|
||||
|
||||
@@ -184,20 +184,19 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
if(header.BlockDescriptors != null)
|
||||
{
|
||||
hdr[3] = (byte)(header.BlockDescriptors.Length * 8);
|
||||
if(header.BlockDescriptors == null) return hdr;
|
||||
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
hdr[0 + i * 8 + 4] = (byte)header.BlockDescriptors[i].Density;
|
||||
hdr[1 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF0000) >> 16);
|
||||
hdr[2 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF00) >> 8);
|
||||
hdr[3 + i * 8 + 4] = (byte)(header.BlockDescriptors[i].Blocks & 0xFF);
|
||||
hdr[5 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF0000) >> 16);
|
||||
hdr[6 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF00) >> 8);
|
||||
hdr[7 + i * 8 + 4] = (byte)(header.BlockDescriptors[i].BlockLength & 0xFF);
|
||||
}
|
||||
hdr[3] = (byte)(header.BlockDescriptors.Length * 8);
|
||||
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
hdr[0 + i * 8 + 4] = (byte)header.BlockDescriptors[i].Density;
|
||||
hdr[1 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF0000) >> 16);
|
||||
hdr[2 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].Blocks & 0xFF00) >> 8);
|
||||
hdr[3 + i * 8 + 4] = (byte)(header.BlockDescriptors[i].Blocks & 0xFF);
|
||||
hdr[5 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF0000) >> 16);
|
||||
hdr[6 + i * 8 + 4] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF00) >> 8);
|
||||
hdr[7 + i * 8 + 4] = (byte)(header.BlockDescriptors[i].BlockLength & 0xFF);
|
||||
}
|
||||
|
||||
return hdr;
|
||||
@@ -214,7 +213,8 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
Array.Copy(hdr, 0, md, 0, hdr.Length);
|
||||
|
||||
if(mode.Pages != null)
|
||||
if(mode.Pages == null) return md;
|
||||
|
||||
{
|
||||
int offset = hdr.Length;
|
||||
foreach(ModePage page in mode.Pages)
|
||||
|
||||
@@ -301,11 +301,10 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(sense.Length >= 18) decoded.SenseKeySpecific = (uint)((sense[15] << 16) + (sense[16] << 8) + sense[17]);
|
||||
|
||||
if(sense.Length > 18)
|
||||
{
|
||||
decoded.AdditionalSense = new byte[sense.Length - 18];
|
||||
Array.Copy(sense, 18, decoded.AdditionalSense, 0, decoded.AdditionalSense.Length);
|
||||
}
|
||||
if(sense.Length <= 18) return decoded;
|
||||
|
||||
decoded.AdditionalSense = new byte[sense.Length - 18];
|
||||
Array.Copy(sense, 18, decoded.AdditionalSense, 0, decoded.AdditionalSense.Length);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -398,33 +397,34 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(decoded.AdditionalLength < 10) return sb.ToString();
|
||||
|
||||
if(decoded.SKSV)
|
||||
switch(decoded.SenseKey)
|
||||
{
|
||||
case SenseKeys.IllegalRequest:
|
||||
{
|
||||
if((decoded.SenseKeySpecific & 0x400000) == 0x400000) sb.AppendLine("Illegal field in CDB");
|
||||
else sb.AppendLine("Illegal field in data parameters");
|
||||
if(!decoded.SKSV) return sb.ToString();
|
||||
|
||||
if((decoded.SenseKeySpecific & 0x200000) == 0x200000)
|
||||
sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB",
|
||||
(decoded.SenseKeySpecific & 0x70000) >> 16,
|
||||
decoded.SenseKeySpecific & 0xFFFF).AppendLine();
|
||||
else
|
||||
sb.AppendFormat("Invalid value in field {0} of CDB", decoded.SenseKeySpecific & 0xFFFF)
|
||||
.AppendLine();
|
||||
}
|
||||
break;
|
||||
case SenseKeys.NotReady:
|
||||
sb.AppendFormat("Format progress {0:P}", (double)(decoded.SenseKeySpecific & 0xFFFF) / 65536)
|
||||
switch(decoded.SenseKey)
|
||||
{
|
||||
case SenseKeys.IllegalRequest:
|
||||
{
|
||||
if((decoded.SenseKeySpecific & 0x400000) == 0x400000) sb.AppendLine("Illegal field in CDB");
|
||||
else sb.AppendLine("Illegal field in data parameters");
|
||||
|
||||
if((decoded.SenseKeySpecific & 0x200000) == 0x200000)
|
||||
sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB",
|
||||
(decoded.SenseKeySpecific & 0x70000) >> 16,
|
||||
decoded.SenseKeySpecific & 0xFFFF).AppendLine();
|
||||
else
|
||||
sb.AppendFormat("Invalid value in field {0} of CDB", decoded.SenseKeySpecific & 0xFFFF)
|
||||
.AppendLine();
|
||||
break;
|
||||
case SenseKeys.RecoveredError:
|
||||
case SenseKeys.HardwareError:
|
||||
case SenseKeys.MediumError:
|
||||
sb.AppendFormat("Actual retry count is {0}", decoded.SenseKeySpecific & 0xFFFF).AppendLine();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SenseKeys.NotReady:
|
||||
sb.AppendFormat("Format progress {0:P}", (double)(decoded.SenseKeySpecific & 0xFFFF) / 65536)
|
||||
.AppendLine();
|
||||
break;
|
||||
case SenseKeys.RecoveredError:
|
||||
case SenseKeys.HardwareError:
|
||||
case SenseKeys.MediumError:
|
||||
sb.AppendFormat("Actual retry count is {0}", decoded.SenseKeySpecific & 0xFFFF).AppendLine();
|
||||
break;
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user