Reformatted.

This commit is contained in:
2016-04-19 02:11:47 +01:00
parent 6a8499f8ed
commit f8bc81d4f5
149 changed files with 6983 additions and 6970 deletions

View File

@@ -280,16 +280,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC
public static StandardDiscInformation? Decode000b(byte[] response)
{
if (response.Length < 34)
if(response.Length < 34)
return null;
if ((response[2] & 0xE0) != 0)
if((response[2] & 0xE0) != 0)
return null;
StandardDiscInformation decoded = new StandardDiscInformation();
decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
if ((decoded.DataLength + 2) != response.Length)
if((decoded.DataLength + 2) != response.Length)
return null;
decoded.DataType = (byte)((response[2] & 0xE0) >> 5);
@@ -324,33 +324,33 @@ 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)
{
decoded.OPCTables = new OPCTable[decoded.OPCTablesNumber];
for (int i = 0; i < decoded.OPCTablesNumber; i++)
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);
}
}
return decoded;
}
public static string Prettify000b(StandardDiscInformation? information)
{
if (!information.HasValue)
if(!information.HasValue)
return null;
StandardDiscInformation decoded = information.Value;
if (decoded.DataType != 0)
if(decoded.DataType != 0)
return null;
StringBuilder sb = new StringBuilder();
switch (decoded.DiscType)
switch(decoded.DiscType)
{
case 0x00:
sb.AppendLine("Disc type declared as CD-DA or CD-ROM");
@@ -369,7 +369,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
break;
}
switch (decoded.DiscStatus)
switch(decoded.DiscStatus)
{
case 0:
sb.AppendLine("Disc is empty");
@@ -382,10 +382,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
break;
}
if (decoded.Erasable)
if(decoded.Erasable)
sb.AppendLine("Disc is erasable");
switch (decoded.LastSessionStatus)
switch(decoded.LastSessionStatus)
{
case 0:
sb.AppendLine("Last session is empty");
@@ -401,7 +401,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
break;
}
switch (decoded.BGFormatStatus)
switch(decoded.BGFormatStatus)
{
case 1:
sb.AppendLine("Media was being formatted in the background but it is stopped and incomplete");
@@ -414,37 +414,37 @@ namespace DiscImageChef.Decoders.SCSI.MMC
break;
}
if (decoded.Dbit)
if(decoded.Dbit)
sb.AppendLine("MRW is dirty");
sb.AppendFormat("First track on disc is track {0}", decoded.FirstTrackNumber).AppendLine();
sb.AppendFormat("Disc has {0} sessions", decoded.Sessions).AppendLine();
sb.AppendFormat("First track in last session is track {0}", decoded.FirstTrackLastSession).AppendLine();
sb.AppendFormat("Last track in last session is track {0}", decoded.LastTrackLastSession).AppendLine();
sb.AppendFormat("Last session Lead-In address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastSessionLeadInStartLBA,
sb.AppendFormat("Last session Lead-In address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastSessionLeadInStartLBA,
(decoded.LastSessionLeadInStartLBA & 0xFF0000) >> 16,
(decoded.LastSessionLeadInStartLBA & 0xFF00) >> 8,
(decoded.LastSessionLeadInStartLBA & 0xFF)).AppendLine();
sb.AppendFormat("Last possible Lead-Out address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastPossibleLeadOutStartLBA,
sb.AppendFormat("Last possible Lead-Out address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastPossibleLeadOutStartLBA,
(decoded.LastPossibleLeadOutStartLBA & 0xFF0000) >> 16,
(decoded.LastPossibleLeadOutStartLBA & 0xFF00) >> 8,
(decoded.LastPossibleLeadOutStartLBA & 0xFF)).AppendLine();
if (decoded.URU)
if(decoded.URU)
sb.AppendLine("Disc is defined for unrestricted use");
else
sb.AppendLine("Disc is defined for restricted use");
if (decoded.DID_V)
if(decoded.DID_V)
sb.AppendFormat("Disc ID: {0:X6}", decoded.DiscIdentification & 0x00FFFFFF).AppendLine();
if (decoded.DBC_V)
if(decoded.DBC_V)
sb.AppendFormat("Disc barcode: {0:X16}", decoded.DiscBarcode).AppendLine();
if (decoded.DAC_V)
if(decoded.DAC_V)
sb.AppendFormat("Disc application code: {0}", decoded.DiscApplicationCode).AppendLine();
if (decoded.OPCTables != null)
if(decoded.OPCTables != null)
{
foreach (OPCTable table in decoded.OPCTables)
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],
@@ -457,16 +457,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC
public static TrackResourcesInformation? Decode001b(byte[] response)
{
if (response.Length != 12)
if(response.Length != 12)
return null;
if ((response[2] & 0xE0) != 0x20)
if((response[2] & 0xE0) != 0x20)
return null;
TrackResourcesInformation decoded = new TrackResourcesInformation();
decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
if ((decoded.DataLength + 2) != response.Length)
if((decoded.DataLength + 2) != response.Length)
return null;
decoded.DataType = (byte)((response[2] & 0xE0) >> 5);
@@ -480,12 +480,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
public static string Prettify001b(TrackResourcesInformation? information)
{
if (!information.HasValue)
if(!information.HasValue)
return null;
TrackResourcesInformation decoded = information.Value;
if (decoded.DataType != 1)
if(decoded.DataType != 1)
return null;
StringBuilder sb = new StringBuilder();
@@ -500,16 +500,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC
public static POWResourcesInformation? Decode010b(byte[] response)
{
if (response.Length != 16)
if(response.Length != 16)
return null;
if ((response[2] & 0xE0) != 0x40)
if((response[2] & 0xE0) != 0x40)
return null;
POWResourcesInformation decoded = new POWResourcesInformation();
decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
if ((decoded.DataLength + 2) != response.Length)
if((decoded.DataLength + 2) != response.Length)
return null;
decoded.DataType = (byte)((response[2] & 0xE0) >> 5);
@@ -522,12 +522,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
public static string Prettify010b(POWResourcesInformation? information)
{
if (!information.HasValue)
if(!information.HasValue)
return null;
POWResourcesInformation decoded = information.Value;
if (decoded.DataType != 1)
if(decoded.DataType != 1)
return null;
StringBuilder sb = new StringBuilder();
@@ -541,13 +541,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC
public static string Prettify(byte[] response)
{
if (response == null)
if(response == null)
return null;
if (response.Length < 12)
if(response.Length < 12)
return null;
switch (response[2] & 0xE0)
switch(response[2] & 0xE0)
{
case 0x00:
return Prettify000b(Decode000b(response));