mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Reformatted.
This commit is contained in:
690
ATA/Identify.cs
690
ATA/Identify.cs
File diff suppressed because it is too large
Load Diff
@@ -61,10 +61,10 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
#region Public methods
|
||||
public static BurstCuttingArea? Decode(byte[] BCAResponse)
|
||||
{
|
||||
if (BCAResponse == null)
|
||||
if(BCAResponse == null)
|
||||
return null;
|
||||
|
||||
if (BCAResponse.Length != 68)
|
||||
if(BCAResponse.Length != 68)
|
||||
{
|
||||
DicConsole.DebugWriteLine("BD BCA decoder", "Found incorrect Blu-ray BCA size ({0} bytes)", BCAResponse.Length);
|
||||
return null;
|
||||
@@ -85,19 +85,19 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
|
||||
public static string Prettify(BurstCuttingArea? BCAResponse)
|
||||
{
|
||||
if (BCAResponse == null)
|
||||
if(BCAResponse == null)
|
||||
return null;
|
||||
|
||||
BurstCuttingArea response = BCAResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sb.AppendFormat("Blu-ray Burst Cutting Area in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.BCA, 80));
|
||||
|
||||
@@ -61,10 +61,10 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
#region Public methods
|
||||
public static CartridgeStatus? Decode(byte[] CSResponse)
|
||||
{
|
||||
if (CSResponse == null)
|
||||
if(CSResponse == null)
|
||||
return null;
|
||||
|
||||
if (CSResponse.Length != 8)
|
||||
if(CSResponse.Length != 8)
|
||||
{
|
||||
DicConsole.DebugWriteLine("BD Cartridge Status decoder", "Found incorrect Blu-ray Cartridge Status size ({0} bytes)", CSResponse.Length);
|
||||
return null;
|
||||
@@ -78,9 +78,9 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
decoded.Reserved1 = CSResponse[2];
|
||||
decoded.Reserved2 = CSResponse[3];
|
||||
decoded.Cartridge = Convert.ToBoolean(CSResponse[4] & 0x80);
|
||||
decoded.OUT = Convert.ToBoolean(CSResponse[4]&0x40);
|
||||
decoded.OUT = Convert.ToBoolean(CSResponse[4] & 0x40);
|
||||
decoded.Reserved3 = (byte)((CSResponse[4] & 0x38) >> 3);
|
||||
decoded.OUT = Convert.ToBoolean(CSResponse[4]&0x04);
|
||||
decoded.OUT = Convert.ToBoolean(CSResponse[4] & 0x04);
|
||||
decoded.Reserved4 = (byte)(CSResponse[4] & 0x03);
|
||||
decoded.Reserved5 = CSResponse[5];
|
||||
decoded.Reserved6 = CSResponse[6];
|
||||
@@ -91,14 +91,14 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
|
||||
public static string Prettify(CartridgeStatus? CSResponse)
|
||||
{
|
||||
if (CSResponse == null)
|
||||
if(CSResponse == null)
|
||||
return null;
|
||||
|
||||
CartridgeStatus response = CSResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
@@ -113,26 +113,26 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
sb.AppendFormat("Reserved6 = 0x{0:X8}", response.Reserved6).AppendLine();
|
||||
if(response.Reserved7 != 0)
|
||||
sb.AppendFormat("Reserved7 = 0x{0:X8}", response.Reserved7).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (response.Cartridge)
|
||||
if(response.Cartridge)
|
||||
{
|
||||
sb.AppendLine("Media is inserted in a cartridge");
|
||||
if (response.OUT)
|
||||
if(response.OUT)
|
||||
sb.AppendLine("Media has been taken out, or inserted in, the cartridge");
|
||||
if (response.CWP)
|
||||
if(response.CWP)
|
||||
sb.AppendLine("Media is write protected");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine("Media is not in a cartridge");
|
||||
|
||||
#if DEBUG
|
||||
if (response.OUT)
|
||||
#if DEBUG
|
||||
if(response.OUT)
|
||||
sb.AppendLine("Media has out bit marked, shouldn't");
|
||||
if (response.CWP)
|
||||
if(response.CWP)
|
||||
sb.AppendLine("Media has write protection bit marked, shouldn't");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
#region Public methods
|
||||
public static DiscDefinitionStructure? Decode(byte[] DDSResponse)
|
||||
{
|
||||
if (DDSResponse == null)
|
||||
if(DDSResponse == null)
|
||||
return null;
|
||||
|
||||
DiscDefinitionStructure decoded = new DiscDefinitionStructure();
|
||||
@@ -79,7 +79,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
decoded.Reserved1 = DDSResponse[2];
|
||||
decoded.Reserved2 = DDSResponse[3];
|
||||
decoded.Signature = BigEndianBitConverter.ToUInt16(DDSResponse, 4);
|
||||
if (decoded.Signature != DDSIdentifier)
|
||||
if(decoded.Signature != DDSIdentifier)
|
||||
{
|
||||
DicConsole.DebugWriteLine("BD DDS decoder", "Found incorrect DDS signature (0x{0:X4})", decoded.Signature);
|
||||
return null;
|
||||
@@ -114,7 +114,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
|
||||
public static string Prettify(DiscDefinitionStructure? DDSResponse)
|
||||
{
|
||||
if (DDSResponse == null)
|
||||
if(DDSResponse == null)
|
||||
return null;
|
||||
|
||||
DiscDefinitionStructure response = DDSResponse.Value;
|
||||
@@ -138,7 +138,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
sb.AppendFormat("Blu-ray DDS Disc Type Specific Data in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.DiscTypeSpecificData, 80));
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
@@ -157,7 +157,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
sb.AppendFormat("Reserved8 = 0x{0:X2}", response.Reserved8).AppendLine();
|
||||
if(response.Reserved9 != 0)
|
||||
sb.AppendFormat("Reserved9 = 0x{0:X8}", response.Reserved9).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -73,10 +73,10 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
#region Public methods
|
||||
public static DiscInformation? Decode(byte[] DIResponse)
|
||||
{
|
||||
if (DIResponse == null)
|
||||
if(DIResponse == null)
|
||||
return null;
|
||||
|
||||
if (DIResponse.Length != 4100)
|
||||
if(DIResponse.Length != 4100)
|
||||
{
|
||||
DicConsole.DebugWriteLine("BD Disc Information decoder", "Found incorrect Blu-ray Disc Information size ({0} bytes)", DIResponse.Length);
|
||||
return null;
|
||||
@@ -93,15 +93,15 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
int offset = 4;
|
||||
List<DiscInformationUnits> units = new List<DiscInformationUnits>();
|
||||
|
||||
while (true)
|
||||
while(true)
|
||||
{
|
||||
if (offset >= 100)
|
||||
if(offset >= 100)
|
||||
break;
|
||||
|
||||
DiscInformationUnits unit = new DiscInformationUnits();
|
||||
unit.Signature = BigEndianBitConverter.ToUInt16(DIResponse, 0 + offset);
|
||||
|
||||
if (unit.Signature != DIUIdentifier)
|
||||
if(unit.Signature != DIUIdentifier)
|
||||
break;
|
||||
|
||||
unit.Format = DIResponse[2 + offset];
|
||||
@@ -113,7 +113,7 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
unit.DiscTypeIdentifier = new byte[3];
|
||||
Array.Copy(DIResponse, 8 + offset, unit.DiscTypeIdentifier, 0, 3);
|
||||
unit.DiscSizeClassVersion = DIResponse[11 + offset];
|
||||
switch (Encoding.ASCII.GetString(unit.DiscTypeIdentifier))
|
||||
switch(Encoding.ASCII.GetString(unit.DiscTypeIdentifier))
|
||||
{
|
||||
case DiscTypeBDROM:
|
||||
{
|
||||
@@ -146,10 +146,10 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
offset += unit.Length;
|
||||
}
|
||||
|
||||
if (units.Count > 0)
|
||||
if(units.Count > 0)
|
||||
{
|
||||
decoded.Units = new DiscInformationUnits[units.Count];
|
||||
for (int i = 0; i < units.Count; i++)
|
||||
for(int i = 0; i < units.Count; i++)
|
||||
decoded.Units[i] = units[i];
|
||||
}
|
||||
|
||||
@@ -158,24 +158,24 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
|
||||
public static string Prettify(DiscInformation? DIResponse)
|
||||
{
|
||||
if (DIResponse == null)
|
||||
if(DIResponse == null)
|
||||
return null;
|
||||
|
||||
DiscInformation response = DIResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (DiscInformationUnits unit in response.Units)
|
||||
foreach(DiscInformationUnits unit in response.Units)
|
||||
{
|
||||
sb.AppendFormat("DI Unit Sequence: {0}", unit.Sequence).AppendLine();
|
||||
sb.AppendFormat("DI Unit Format: 0x{0:X2}", unit.Format).AppendLine();
|
||||
sb.AppendFormat("There are {0} per block", unit.UnitsPerBlock).AppendLine();
|
||||
if (Encoding.ASCII.GetString(unit.DiscTypeIdentifier) != DiscTypeBDROM)
|
||||
if(Encoding.ASCII.GetString(unit.DiscTypeIdentifier) != DiscTypeBDROM)
|
||||
sb.AppendFormat("Legacy value: 0x{0:X2}", unit.Legacy).AppendLine();
|
||||
sb.AppendFormat("DI Unit is {0} bytes", unit.Length).AppendLine();
|
||||
sb.AppendFormat("Disc type identifier: \"{0}\"", Encoding.ASCII.GetString(unit.DiscTypeIdentifier)).AppendLine();
|
||||
sb.AppendFormat("Disc size/class/version: {0}", unit.DiscSizeClassVersion).AppendLine();
|
||||
if (Encoding.ASCII.GetString(unit.DiscTypeIdentifier) == DiscTypeBDR ||
|
||||
if(Encoding.ASCII.GetString(unit.DiscTypeIdentifier) == DiscTypeBDR ||
|
||||
Encoding.ASCII.GetString(unit.DiscTypeIdentifier) == DiscTypeBDRE)
|
||||
{
|
||||
sb.AppendFormat("Disc manufacturer ID: \"{0}\"", Encoding.ASCII.GetString(unit.ManufacturerID)).AppendLine();
|
||||
|
||||
@@ -61,10 +61,10 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
#region Public methods
|
||||
public static SpareAreaInformation? Decode(byte[] SAIResponse)
|
||||
{
|
||||
if (SAIResponse == null)
|
||||
if(SAIResponse == null)
|
||||
return null;
|
||||
|
||||
if (SAIResponse.Length != 16)
|
||||
if(SAIResponse.Length != 16)
|
||||
{
|
||||
DicConsole.DebugWriteLine("BD Spare Area Information decoder", "Found incorrect Blu-ray Spare Area Information size ({0} bytes)", SAIResponse.Length);
|
||||
return null;
|
||||
@@ -86,21 +86,21 @@ namespace DiscImageChef.Decoders.Bluray
|
||||
|
||||
public static string Prettify(SpareAreaInformation? SAIResponse)
|
||||
{
|
||||
if (SAIResponse == null)
|
||||
if(SAIResponse == null)
|
||||
return null;
|
||||
|
||||
SpareAreaInformation response = SAIResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
if(response.Reserved3 != 0)
|
||||
sb.AppendFormat("Reserved3 = 0x{0:X8}", response.Reserved3).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
sb.AppendFormat("{0} free spare blocks", response.FreeSpareBlocks).AppendLine();
|
||||
sb.AppendFormat("{0} allocated spare blocks", response.AllocatedSpareBlocks).AppendLine();
|
||||
|
||||
|
||||
256
CD/ATIP.cs
256
CD/ATIP.cs
@@ -224,14 +224,14 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static CDATIP? Decode(byte[] CDATIPResponse)
|
||||
{
|
||||
if (CDATIPResponse == null)
|
||||
if(CDATIPResponse == null)
|
||||
return null;
|
||||
|
||||
CDATIP decoded = new CDATIP();
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
if (CDATIPResponse.Length != 32 && CDATIPResponse.Length != 28)
|
||||
if(CDATIPResponse.Length != 32 && CDATIPResponse.Length != 28)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD ATIP decoder", "Expected CD ATIP size (32 bytes) is not received size ({0} bytes), not decoding", CDATIPResponse.Length);
|
||||
return null;
|
||||
@@ -276,7 +276,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
decoded.Reserved8 = CDATIPResponse[23];
|
||||
decoded.Reserved9 = CDATIPResponse[27];
|
||||
|
||||
if (CDATIPResponse.Length >= 32)
|
||||
if(CDATIPResponse.Length >= 32)
|
||||
{
|
||||
decoded.S4Values = new byte[3];
|
||||
Array.Copy(CDATIPResponse, 28, decoded.S4Values, 0, 3);
|
||||
@@ -288,21 +288,21 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static string Prettify(CDATIP? CDATIPResponse)
|
||||
{
|
||||
if (CDATIPResponse == null)
|
||||
if(CDATIPResponse == null)
|
||||
return null;
|
||||
|
||||
CDATIP response = CDATIPResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (response.DDCD)
|
||||
if(response.DDCD)
|
||||
{
|
||||
sb.AppendFormat("Indicative Target Writing Power: 0x{0:X2}", response.ITWP).AppendLine();
|
||||
if (response.DiscType)
|
||||
if(response.DiscType)
|
||||
sb.AppendLine("Disc is DDCD-RW");
|
||||
else
|
||||
sb.AppendLine("Disc is DDCD-R");
|
||||
switch (response.ReferenceSpeed)
|
||||
switch(response.ReferenceSpeed)
|
||||
{
|
||||
case 2:
|
||||
sb.AppendLine("Reference speed is 4x");
|
||||
@@ -321,9 +321,9 @@ namespace DiscImageChef.Decoders.CD
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("Indicative Target Writing Power: 0x{0:X2}", response.ITWP & 0x07).AppendLine();
|
||||
if (response.DiscType)
|
||||
if(response.DiscType)
|
||||
{
|
||||
switch (response.DiscSubType)
|
||||
switch(response.DiscSubType)
|
||||
{
|
||||
case 0:
|
||||
sb.AppendLine("Disc is CD-RW");
|
||||
@@ -353,7 +353,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
sb.AppendFormat("Unknown CD-RW disc subtype: {0}", response.DiscSubType).AppendLine();
|
||||
break;
|
||||
}
|
||||
switch (response.ReferenceSpeed)
|
||||
switch(response.ReferenceSpeed)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendLine("Reference speed is 2x");
|
||||
@@ -366,7 +366,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
else
|
||||
{
|
||||
sb.AppendLine("Disc is CD-R");
|
||||
switch (response.DiscSubType)
|
||||
switch(response.DiscSubType)
|
||||
{
|
||||
case 0:
|
||||
sb.AppendLine("Disc is normal speed (CLV) CD-R");
|
||||
@@ -398,7 +398,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
}
|
||||
|
||||
if (response.URU)
|
||||
if(response.URU)
|
||||
sb.AppendLine("Disc use is unrestricted");
|
||||
else
|
||||
sb.AppendLine("Disc use is restricted");
|
||||
@@ -415,13 +415,13 @@ namespace DiscImageChef.Decoders.CD
|
||||
sb.AppendFormat("S4 value: 0x{0:X6}", (response.S4Values[0] << 16) + (response.S4Values[1] << 8) + response.S4Values[2]).AppendLine();
|
||||
}
|
||||
|
||||
if (response.LeadInStartMin == 97)
|
||||
if(response.LeadInStartMin == 97)
|
||||
{
|
||||
int type = response.LeadInStartFrame % 10;
|
||||
int frm = response.LeadInStartFrame - type;
|
||||
string manufacturer = "";
|
||||
|
||||
if (response.DiscType)
|
||||
if(response.DiscType)
|
||||
sb.AppendLine("Disc uses phase change");
|
||||
else
|
||||
{
|
||||
@@ -431,287 +431,287 @@ namespace DiscImageChef.Decoders.CD
|
||||
sb.AppendLine("Disc uses short strategy type dye (Phthalocyanine, etc...)");
|
||||
}
|
||||
|
||||
switch (response.LeadInStartSec)
|
||||
switch(response.LeadInStartSec)
|
||||
{
|
||||
case 15:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "TDK Corporation";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Ritek Co.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Mitsubishi Chemical Corporation";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "NAN-YA Plastics Corporation";
|
||||
break;
|
||||
case 16:
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Shenzen SG&Gast Digital Optical Discs";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Grand Advance Technology Ltd.";
|
||||
break;
|
||||
case 17:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Moser Baer India Limited";
|
||||
break;
|
||||
case 18:
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Wealth Fair Investment Ltd.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Taroko International Co. Ltd.";
|
||||
break;
|
||||
case 20:
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "CDA Datenträger Albrechts GmbH";
|
||||
break;
|
||||
case 21:
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Grupo Condor S.L.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Bestdisc Technology Corporation";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "Optical Disc Manufacturing Equipment";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Sound Sound Multi-Media Development Ltd.";
|
||||
break;
|
||||
case 22:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Woongjin Media Corp.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Seantram Technology Inc.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Advanced Digital Media";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "EXIMPO";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "CIS Technology Inc.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Hong Kong Digital Technology Co., Ltd.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Acer Media Technology, Inc.";
|
||||
break;
|
||||
case 23:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Matsushita Electric Industrial Co., Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Doremi Media Co., Ltd.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Nacar Media s.r.l.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Audio Distributors Co., Ltd.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "Victor Company of Japan, Ltd.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Optrom Inc.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Customer Pressing Oosterhout";
|
||||
break;
|
||||
case 24:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Taiyo Yuden Company Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "SONY Corporation";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Computer Support Italy s.r.l.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Unitech Japan Inc.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "kdg mediatech AG";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Guann Yinn Co., Ltd.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Harmonic Hall Optical Disc Ltd.";
|
||||
break;
|
||||
case 25:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "MPO";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Hitachi Maxell, Ltd.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Infodisc Technology Co. Ltd.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "Vivastar AG";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "AMS Technology Inc.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Xcitec Inc.";
|
||||
break;
|
||||
case 26:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Fornet International Pte Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "POSTECH Corporation";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "SKC Co., Ltd.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Optical Disc Corporation";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "FUJI Photo Film Co., Ltd.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Lead Data Inc.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "CMC Magnetics Corporation";
|
||||
break;
|
||||
case 27:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Digital Storage Technology Co., Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Plasmon Data systems Ltd.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Princo Corporation";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Pioneer Video Corporation";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "Kodak Japan Ltd.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Mitsui Chemicals, Inc.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Ricoh Company Ltd.";
|
||||
break;
|
||||
case 28:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Opti.Me.S. S.p.A.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Gigastore Corporation";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Multi Media Masters & Machinary SA";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Auvistar Industry Co., Ltd.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "King Pro Mediatek Inc.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Delphi Technology Inc.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Friendly CD-Tek Co.";
|
||||
break;
|
||||
case 29:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Taeil Media Co., Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Vanguard Disc Inc.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Unidisc Technology Co., Ltd.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Hile Optical Disc Technology Corp.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "Viva Magnetics Ltd.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "General Magnetics Ltd.";
|
||||
break;
|
||||
case 30:
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "CDA Datenträger Albrechts GmbH";
|
||||
break;
|
||||
case 31:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Ritek Co.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Grand Advance Technology Ltd.";
|
||||
break;
|
||||
case 32:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "TDK Corporation";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Prodisc Technology Inc.";
|
||||
break;
|
||||
case 34:
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Mitsubishi Chemical Corporation";
|
||||
break;
|
||||
case 42:
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Advanced Digital Media";
|
||||
break;
|
||||
case 45:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Fornet International Pte Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Unitech Japan Inc.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Acer Media Technology, Inc.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "CIS Technology Inc.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Guann Yinn Co., Ltd.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Xcitec Inc.";
|
||||
break;
|
||||
case 46:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Taiyo Yuden Company Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Hong Kong Digital Technology Co., Ltd.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Multi Media Masters & Machinary SA";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Computer Support Italy s.r.l.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "FUJI Photo Film Co., Ltd.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Auvistar Industry Co., Ltd.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "CMC Magnetics Corporation";
|
||||
break;
|
||||
case 47:
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Hitachi Maxell, Ltd.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Princo Corporation";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "POSTECH Corporation";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Ritek Co.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Prodisc Technology Inc.";
|
||||
break;
|
||||
case 48:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "Ricoh Company Ltd.";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Kodak Japan Ltd.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Plasmon Data systems Ltd.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Pioneer Video Corporation";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "Digital Storage Technology Co., Ltd.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Mitsui Chemicals, Inc.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Lead Data Inc.";
|
||||
break;
|
||||
case 49:
|
||||
if (frm == 00)
|
||||
if(frm == 00)
|
||||
manufacturer = "TDK Corporation";
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Gigastore Corporation";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "King Pro Mediatek Inc.";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "Opti.Me.S. S.p.A.";
|
||||
if (frm == 40)
|
||||
if(frm == 40)
|
||||
manufacturer = "Victor Company of Japan, Ltd.";
|
||||
if (frm == 60)
|
||||
if(frm == 60)
|
||||
manufacturer = "Matsushita Electric Industrial Co., Ltd.";
|
||||
break;
|
||||
case 50:
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Vanguard Disc Inc.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Mitsubishi Chemical Corporation";
|
||||
if (frm == 30)
|
||||
if(frm == 30)
|
||||
manufacturer = "CDA Datenträger Albrechts GmbH";
|
||||
break;
|
||||
case 51:
|
||||
if (frm == 10)
|
||||
if(frm == 10)
|
||||
manufacturer = "Grand Advance Technology Ltd.";
|
||||
if (frm == 20)
|
||||
if(frm == 20)
|
||||
manufacturer = "Infodisc Technology Co. Ltd.";
|
||||
if (frm == 50)
|
||||
if(frm == 50)
|
||||
manufacturer = "Hile Optical Disc Technology Corp.";
|
||||
break;
|
||||
}
|
||||
|
||||
if (manufacturer != "")
|
||||
if(manufacturer != "")
|
||||
sb.AppendFormat("Disc manufactured by: {0}", manufacturer).AppendLine();
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static CDText? Decode(byte[] CDTextResponse)
|
||||
{
|
||||
if (CDTextResponse == null)
|
||||
if(CDTextResponse == null)
|
||||
return null;
|
||||
|
||||
CDText decoded = new CDText();
|
||||
@@ -205,16 +205,16 @@ namespace DiscImageChef.Decoders.CD
|
||||
decoded.Reserved2 = CDTextResponse[3];
|
||||
decoded.DataPacks = new CDTextPack[(decoded.DataLength - 2) / 18];
|
||||
|
||||
if (decoded.DataLength == 2)
|
||||
if(decoded.DataLength == 2)
|
||||
return null;
|
||||
|
||||
if (decoded.DataLength + 2 != CDTextResponse.Length)
|
||||
if(decoded.DataLength + 2 != CDTextResponse.Length)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD-TEXT decoder", "Expected CD-TEXT size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTextResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ((decoded.DataLength - 2) / 18); i++)
|
||||
for(int i = 0; i < ((decoded.DataLength - 2) / 18); i++)
|
||||
{
|
||||
decoded.DataPacks[i].HeaderID1 = CDTextResponse[0 + i * 18 + 4];
|
||||
decoded.DataPacks[i].HeaderID2 = CDTextResponse[1 + i * 18 + 4];
|
||||
@@ -232,22 +232,22 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static string Prettify(CDText? CDTextResponse)
|
||||
{
|
||||
if (CDTextResponse == null)
|
||||
if(CDTextResponse == null)
|
||||
return null;
|
||||
|
||||
CDText response = CDTextResponse.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
foreach (CDTextPack descriptor in response.DataPacks)
|
||||
foreach(CDTextPack descriptor in response.DataPacks)
|
||||
{
|
||||
if ((descriptor.HeaderID1 & 0x80) != 0x80)
|
||||
if((descriptor.HeaderID1 & 0x80) != 0x80)
|
||||
{
|
||||
// Ignore NOPs
|
||||
if((descriptor.HeaderID1 & 0x80) != 0)
|
||||
@@ -255,12 +255,12 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (descriptor.HeaderID1)
|
||||
switch(descriptor.HeaderID1)
|
||||
{
|
||||
case 0x80:
|
||||
{
|
||||
sb.Append("CD-Text pack contains title for ");
|
||||
if (descriptor.HeaderID2 == 0x00)
|
||||
if(descriptor.HeaderID2 == 0x00)
|
||||
sb.AppendLine("album");
|
||||
else
|
||||
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
|
||||
@@ -269,7 +269,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
case 0x81:
|
||||
{
|
||||
sb.Append("CD-Text pack contains performer for ");
|
||||
if (descriptor.HeaderID2 == 0x00)
|
||||
if(descriptor.HeaderID2 == 0x00)
|
||||
sb.AppendLine("album");
|
||||
else
|
||||
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
|
||||
@@ -278,7 +278,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
case 0x82:
|
||||
{
|
||||
sb.Append("CD-Text pack contains songwriter for ");
|
||||
if (descriptor.HeaderID2 == 0x00)
|
||||
if(descriptor.HeaderID2 == 0x00)
|
||||
sb.AppendLine("album");
|
||||
else
|
||||
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
|
||||
@@ -286,7 +286,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
case 0x83:
|
||||
{
|
||||
if (descriptor.HeaderID2 == 0x00)
|
||||
if(descriptor.HeaderID2 == 0x00)
|
||||
sb.AppendLine("album");
|
||||
else
|
||||
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
|
||||
@@ -295,7 +295,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
case 0x84:
|
||||
{
|
||||
sb.Append("CD-Text pack contains arranger for ");
|
||||
if (descriptor.HeaderID2 == 0x00)
|
||||
if(descriptor.HeaderID2 == 0x00)
|
||||
sb.AppendLine("album");
|
||||
else
|
||||
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
|
||||
@@ -304,7 +304,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
case 0x85:
|
||||
{
|
||||
sb.Append("CD-Text pack contains content provider's message for ");
|
||||
if (descriptor.HeaderID2 == 0x00)
|
||||
if(descriptor.HeaderID2 == 0x00)
|
||||
sb.AppendLine("album");
|
||||
else
|
||||
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
|
||||
@@ -344,7 +344,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
case 0x8E:
|
||||
{
|
||||
if (descriptor.HeaderID2 == 0x00)
|
||||
if(descriptor.HeaderID2 == 0x00)
|
||||
sb.AppendLine("CD-Text pack contains UPC");
|
||||
else
|
||||
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
|
||||
@@ -357,7 +357,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
}
|
||||
|
||||
switch (descriptor.HeaderID1)
|
||||
switch(descriptor.HeaderID1)
|
||||
{
|
||||
case 0x80:
|
||||
case 0x81:
|
||||
@@ -369,7 +369,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
case 0x87:
|
||||
case 0x8E:
|
||||
{
|
||||
if (descriptor.DBCC)
|
||||
if(descriptor.DBCC)
|
||||
sb.AppendLine("Double Byte Character Code is used");
|
||||
sb.AppendFormat("Block number {0}", descriptor.BlockNumber).AppendLine();
|
||||
sb.AppendFormat("Character position {0}", descriptor.CharacterPosition).AppendLine();
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static CDFullTOC? Decode(byte[] CDFullTOCResponse)
|
||||
{
|
||||
if (CDFullTOCResponse == null)
|
||||
if(CDFullTOCResponse == null)
|
||||
return null;
|
||||
|
||||
CDFullTOC decoded = new CDFullTOC();
|
||||
@@ -164,13 +164,13 @@ namespace DiscImageChef.Decoders.CD
|
||||
decoded.LastCompleteSession = CDFullTOCResponse[3];
|
||||
decoded.TrackDescriptors = new TrackDataDescriptor[(decoded.DataLength - 2) / 11];
|
||||
|
||||
if (decoded.DataLength + 2 != CDFullTOCResponse.Length)
|
||||
if(decoded.DataLength + 2 != CDFullTOCResponse.Length)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD full TOC decoder", "Expected CDFullTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDFullTOCResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ((decoded.DataLength - 2) / 11); i++)
|
||||
for(int i = 0; i < ((decoded.DataLength - 2) / 11); i++)
|
||||
{
|
||||
decoded.TrackDescriptors[i].SessionNumber = CDFullTOCResponse[0 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDFullTOCResponse[1 + i * 11 + 4] & 0xF0) >> 4);
|
||||
@@ -193,7 +193,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static string Prettify(CDFullTOC? CDFullTOCResponse)
|
||||
{
|
||||
if (CDFullTOCResponse == null)
|
||||
if(CDFullTOCResponse == null)
|
||||
return null;
|
||||
|
||||
CDFullTOC response = CDFullTOCResponse.Value;
|
||||
@@ -204,9 +204,9 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine();
|
||||
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
|
||||
foreach (TrackDataDescriptor descriptor in response.TrackDescriptors)
|
||||
foreach(TrackDataDescriptor descriptor in response.TrackDescriptors)
|
||||
{
|
||||
if ((descriptor.CONTROL & 0x08) == 0x08 ||
|
||||
if((descriptor.CONTROL & 0x08) == 0x08 ||
|
||||
(descriptor.ADR != 1 && descriptor.ADR != 5 && descriptor.ADR != 4 && descriptor.ADR != 6) ||
|
||||
descriptor.TNO != 0)
|
||||
{
|
||||
@@ -233,19 +233,19 @@ namespace DiscImageChef.Decoders.CD
|
||||
lastSession = descriptor.SessionNumber;
|
||||
}
|
||||
|
||||
switch (descriptor.ADR)
|
||||
switch(descriptor.ADR)
|
||||
{
|
||||
case 1:
|
||||
case 4:
|
||||
{
|
||||
switch (descriptor.POINT)
|
||||
switch(descriptor.POINT)
|
||||
{
|
||||
case 0xA0:
|
||||
{
|
||||
if (descriptor.ADR == 4)
|
||||
if(descriptor.ADR == 4)
|
||||
{
|
||||
sb.AppendFormat("First video track number: {0}", descriptor.PMIN).AppendLine();
|
||||
switch (descriptor.PSEC)
|
||||
switch(descriptor.PSEC)
|
||||
{
|
||||
case 0x10:
|
||||
sb.AppendLine("CD-V single in NTSC format with digital stereo sound");
|
||||
@@ -276,7 +276,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("First track number: {0} (", descriptor.PMIN);
|
||||
switch ((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
{
|
||||
case TOC_CONTROL.TwoChanNoPreEmph:
|
||||
sb.Append(StereoNoPre);
|
||||
@@ -305,12 +305,12 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
case 0xA1:
|
||||
{
|
||||
if (descriptor.ADR == 4)
|
||||
if(descriptor.ADR == 4)
|
||||
sb.AppendFormat("Last video track number: {0}", descriptor.PMIN).AppendLine();
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("Last track number: {0} (", descriptor.PMIN);
|
||||
switch ((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
{
|
||||
case TOC_CONTROL.TwoChanNoPreEmph:
|
||||
sb.Append(StereoNoPre);
|
||||
@@ -344,7 +344,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
sb.AppendFormat("Lead-out start position: {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
|
||||
//sb.AppendFormat("Absolute time: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
|
||||
|
||||
switch ((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
{
|
||||
case TOC_CONTROL.TwoChanNoPreEmph:
|
||||
case TOC_CONTROL.TwoChanPreEmph:
|
||||
@@ -372,15 +372,15 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (descriptor.POINT >= 0x01 && descriptor.POINT <= 0x63)
|
||||
if(descriptor.POINT >= 0x01 && descriptor.POINT <= 0x63)
|
||||
{
|
||||
if (descriptor.ADR == 4)
|
||||
if(descriptor.ADR == 4)
|
||||
sb.AppendFormat("Video track {3} starts at: {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, descriptor.POINT).AppendLine();
|
||||
else
|
||||
{
|
||||
string type = "Audio";
|
||||
|
||||
if ((TOC_CONTROL)(descriptor.CONTROL & 0x0D) == TOC_CONTROL.DataTrack ||
|
||||
if((TOC_CONTROL)(descriptor.CONTROL & 0x0D) == TOC_CONTROL.DataTrack ||
|
||||
(TOC_CONTROL)(descriptor.CONTROL & 0x0D) == TOC_CONTROL.DataTrackIncremental)
|
||||
type = "Data";
|
||||
|
||||
@@ -389,7 +389,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
else
|
||||
sb.AppendFormat("{4} track {3} starts at: {0:D2}:{1:D2}:{2:D2} (", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, descriptor.POINT, type);
|
||||
|
||||
switch ((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
{
|
||||
case TOC_CONTROL.TwoChanNoPreEmph:
|
||||
sb.Append(StereoNoPre);
|
||||
@@ -436,11 +436,11 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
switch (descriptor.POINT)
|
||||
switch(descriptor.POINT)
|
||||
{
|
||||
case 0xB0:
|
||||
{
|
||||
if (descriptor.PHOUR > 0)
|
||||
if(descriptor.PHOUR > 0)
|
||||
{
|
||||
sb.AppendFormat("Start of next possible program in the recordable area of the disc: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
|
||||
sb.AppendFormat("Maximum start of outermost Lead-out in the recordable area of the disc: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, descriptor.PHOUR).AppendLine();
|
||||
@@ -474,7 +474,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
case 0xC0:
|
||||
{
|
||||
sb.AppendFormat("Optimum recording power: 0x{0:X2}", descriptor.Min).AppendLine();
|
||||
if (descriptor.PHOUR > 0)
|
||||
if(descriptor.PHOUR > 0)
|
||||
sb.AppendFormat("Start time of the first Lead-in area in the disc: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, descriptor.PHOUR).AppendLine();
|
||||
else
|
||||
sb.AppendFormat("Start time of the first Lead-in area in the disc: {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
|
||||
@@ -494,7 +494,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
case 0xCF:
|
||||
{
|
||||
if (descriptor.PHOUR > 0)
|
||||
if(descriptor.PHOUR > 0)
|
||||
{
|
||||
sb.AppendFormat("Start position of outer part lead-in area: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, descriptor.PHOUR).AppendLine();
|
||||
sb.AppendFormat("Stop position of inner part lead-out area: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
|
||||
@@ -508,7 +508,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (descriptor.POINT >= 0x01 && descriptor.POINT <= 0x40)
|
||||
if(descriptor.POINT >= 0x01 && descriptor.POINT <= 0x40)
|
||||
{
|
||||
sb.AppendFormat("Start time for interval that should be skipped: {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
|
||||
sb.AppendFormat("Ending time for interval that should be skipped: {0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine();
|
||||
|
||||
28
CD/PMA.cs
28
CD/PMA.cs
@@ -139,7 +139,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static CDPMA? Decode(byte[] CDPMAResponse)
|
||||
{
|
||||
if (CDPMAResponse == null)
|
||||
if(CDPMAResponse == null)
|
||||
return null;
|
||||
|
||||
CDPMA decoded = new CDPMA();
|
||||
@@ -151,13 +151,13 @@ namespace DiscImageChef.Decoders.CD
|
||||
decoded.Reserved2 = CDPMAResponse[3];
|
||||
decoded.PMADescriptors = new CDPMADescriptors[(decoded.DataLength - 2) / 11];
|
||||
|
||||
if (decoded.DataLength + 2 != CDPMAResponse.Length)
|
||||
if(decoded.DataLength + 2 != CDPMAResponse.Length)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD PMA decoder", "Expected CDPMA size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDPMAResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ((decoded.DataLength - 2) / 11); i++)
|
||||
for(int i = 0; i < ((decoded.DataLength - 2) / 11); i++)
|
||||
{
|
||||
decoded.PMADescriptors[i].Reserved = CDPMAResponse[0 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].ADR = (byte)((CDPMAResponse[1 + i * 11 + 4] & 0xF0) >> 4);
|
||||
@@ -179,34 +179,34 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static string Prettify(CDPMA? CDPMAResponse)
|
||||
{
|
||||
if (CDPMAResponse == null)
|
||||
if(CDPMAResponse == null)
|
||||
return null;
|
||||
|
||||
CDPMA response = CDPMAResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
foreach (CDPMADescriptors descriptor in response.PMADescriptors)
|
||||
foreach(CDPMADescriptors descriptor in response.PMADescriptors)
|
||||
{
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(descriptor.Reserved != 0)
|
||||
sb.AppendFormat("Reserved = 0x{0:X2}", descriptor.Reserved).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch (descriptor.ADR)
|
||||
switch(descriptor.ADR)
|
||||
{
|
||||
case 1:
|
||||
if (descriptor.POINT > 0)
|
||||
if(descriptor.POINT > 0)
|
||||
{
|
||||
sb.AppendFormat("Track {0}", descriptor.POINT);
|
||||
switch ((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
{
|
||||
case TOC_CONTROL.TwoChanNoPreEmph:
|
||||
sb.Append(" (Stereo audio track with no pre-emphasis)");
|
||||
@@ -227,11 +227,11 @@ namespace DiscImageChef.Decoders.CD
|
||||
sb.Append(" (Data track, recorded incrementally)");
|
||||
break;
|
||||
}
|
||||
if (descriptor.PHOUR > 0)
|
||||
if(descriptor.PHOUR > 0)
|
||||
sb.AppendFormat(" starts at {3}:{0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, descriptor.PHOUR);
|
||||
else
|
||||
sb.AppendFormat(" starts at {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME);
|
||||
if (descriptor.PHOUR > 0)
|
||||
if(descriptor.PHOUR > 0)
|
||||
sb.AppendFormat(" and ends at {3}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR);
|
||||
else
|
||||
sb.AppendFormat(" and ends at {0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame);
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static CDSessionInfo? Decode(byte[] CDSessionInfoResponse)
|
||||
{
|
||||
if (CDSessionInfoResponse == null)
|
||||
if(CDSessionInfoResponse == null)
|
||||
return null;
|
||||
|
||||
CDSessionInfo decoded = new CDSessionInfo();
|
||||
@@ -126,13 +126,13 @@ namespace DiscImageChef.Decoders.CD
|
||||
decoded.LastCompleteSession = CDSessionInfoResponse[3];
|
||||
decoded.TrackDescriptors = new TrackDataDescriptor[(decoded.DataLength - 2) / 8];
|
||||
|
||||
if (decoded.DataLength + 2 != CDSessionInfoResponse.Length)
|
||||
if(decoded.DataLength + 2 != CDSessionInfoResponse.Length)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD Session Info decoder", "Expected CDSessionInfo size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDSessionInfoResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ((decoded.DataLength - 2) / 8); i++)
|
||||
for(int i = 0; i < ((decoded.DataLength - 2) / 8); i++)
|
||||
{
|
||||
decoded.TrackDescriptors[i].Reserved1 = CDSessionInfoResponse[0 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDSessionInfoResponse[1 + i * 8 + 4] & 0xF0) >> 4);
|
||||
@@ -147,7 +147,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static string Prettify(CDSessionInfo? CDSessionInfoResponse)
|
||||
{
|
||||
if (CDSessionInfoResponse == null)
|
||||
if(CDSessionInfoResponse == null)
|
||||
return null;
|
||||
|
||||
CDSessionInfo response = CDSessionInfoResponse.Value;
|
||||
@@ -156,7 +156,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine();
|
||||
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
|
||||
foreach (TrackDataDescriptor descriptor in response.TrackDescriptors)
|
||||
foreach(TrackDataDescriptor descriptor in response.TrackDescriptors)
|
||||
{
|
||||
sb.AppendFormat("First track number in last complete session: {0}", descriptor.TrackNumber).AppendLine();
|
||||
sb.AppendFormat("Track starts at LBA {0}, or MSF {1:X2}:{2:X2}:{3:X2}", descriptor.TrackStartAddress,
|
||||
@@ -164,7 +164,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
|
||||
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
|
||||
|
||||
switch ((TOC_ADR)descriptor.ADR)
|
||||
switch((TOC_ADR)descriptor.ADR)
|
||||
{
|
||||
case TOC_ADR.NoInformation:
|
||||
sb.AppendLine("Q subchannel mode not given");
|
||||
@@ -184,7 +184,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
sb.AppendFormat("Reserved flags 0x{0:X2} set", descriptor.CONTROL).AppendLine();
|
||||
else
|
||||
{
|
||||
switch ((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
{
|
||||
case TOC_CONTROL.TwoChanNoPreEmph:
|
||||
sb.AppendLine("Stereo audio track with no pre-emphasis");
|
||||
@@ -206,17 +206,17 @@ namespace DiscImageChef.Decoders.CD
|
||||
break;
|
||||
}
|
||||
|
||||
if ((descriptor.CONTROL & (byte)TOC_CONTROL.CopyPermissionMask) == (byte)TOC_CONTROL.CopyPermissionMask)
|
||||
if((descriptor.CONTROL & (byte)TOC_CONTROL.CopyPermissionMask) == (byte)TOC_CONTROL.CopyPermissionMask)
|
||||
sb.AppendLine("Digital copy of track is permitted");
|
||||
else
|
||||
sb.AppendLine("Digital copy of track is prohibited");
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(descriptor.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", descriptor.Reserved1).AppendLine();
|
||||
if(descriptor.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", descriptor.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
|
||||
22
CD/TOC.cs
22
CD/TOC.cs
@@ -116,7 +116,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static CDTOC? Decode(byte[] CDTOCResponse)
|
||||
{
|
||||
if (CDTOCResponse == null)
|
||||
if(CDTOCResponse == null)
|
||||
return null;
|
||||
|
||||
CDTOC decoded = new CDTOC();
|
||||
@@ -128,13 +128,13 @@ namespace DiscImageChef.Decoders.CD
|
||||
decoded.LastTrack = CDTOCResponse[3];
|
||||
decoded.TrackDescriptors = new CDTOCTrackDataDescriptor[(decoded.DataLength - 2) / 8];
|
||||
|
||||
if (decoded.DataLength + 2 != CDTOCResponse.Length)
|
||||
if(decoded.DataLength + 2 != CDTOCResponse.Length)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CD TOC decoder", "Expected CDTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTOCResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ((decoded.DataLength - 2) / 8); i++)
|
||||
for(int i = 0; i < ((decoded.DataLength - 2) / 8); i++)
|
||||
{
|
||||
decoded.TrackDescriptors[i].Reserved1 = CDTOCResponse[0 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDTOCResponse[1 + i * 8 + 4] & 0xF0) >> 4);
|
||||
@@ -149,7 +149,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
public static string Prettify(CDTOC? CDTOCResponse)
|
||||
{
|
||||
if (CDTOCResponse == null)
|
||||
if(CDTOCResponse == null)
|
||||
return null;
|
||||
|
||||
CDTOC response = CDTOCResponse.Value;
|
||||
@@ -158,9 +158,9 @@ namespace DiscImageChef.Decoders.CD
|
||||
|
||||
sb.AppendFormat("First track number in first complete session: {0}", response.FirstTrack).AppendLine();
|
||||
sb.AppendFormat("Last track number in last complete session: {0}", response.LastTrack).AppendLine();
|
||||
foreach (CDTOCTrackDataDescriptor descriptor in response.TrackDescriptors)
|
||||
foreach(CDTOCTrackDataDescriptor descriptor in response.TrackDescriptors)
|
||||
{
|
||||
if (descriptor.TrackNumber == 0xAA)
|
||||
if(descriptor.TrackNumber == 0xAA)
|
||||
sb.AppendLine("Track number: Lead-Out");
|
||||
else
|
||||
sb.AppendFormat("Track number: {0}", descriptor.TrackNumber).AppendLine();
|
||||
@@ -169,7 +169,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
|
||||
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
|
||||
|
||||
switch ((TOC_ADR)descriptor.ADR)
|
||||
switch((TOC_ADR)descriptor.ADR)
|
||||
{
|
||||
case TOC_ADR.NoInformation:
|
||||
sb.AppendLine("Q subchannel mode not given");
|
||||
@@ -195,7 +195,7 @@ namespace DiscImageChef.Decoders.CD
|
||||
sb.AppendFormat("Reserved flags 0x{0:X2} set", descriptor.CONTROL).AppendLine();
|
||||
else
|
||||
{
|
||||
switch ((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
switch((TOC_CONTROL)(descriptor.CONTROL & 0x0D))
|
||||
{
|
||||
case TOC_CONTROL.TwoChanNoPreEmph:
|
||||
sb.AppendLine("Stereo audio track with no pre-emphasis");
|
||||
@@ -217,17 +217,17 @@ namespace DiscImageChef.Decoders.CD
|
||||
break;
|
||||
}
|
||||
|
||||
if ((descriptor.CONTROL & (byte)TOC_CONTROL.CopyPermissionMask) == (byte)TOC_CONTROL.CopyPermissionMask)
|
||||
if((descriptor.CONTROL & (byte)TOC_CONTROL.CopyPermissionMask) == (byte)TOC_CONTROL.CopyPermissionMask)
|
||||
sb.AppendLine("Digital copy of track is permitted");
|
||||
else
|
||||
sb.AppendLine("Digital copy of track is prohibited");
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(descriptor.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", descriptor.Reserved1).AppendLine();
|
||||
if(descriptor.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", descriptor.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length != 8)
|
||||
if(response.Length != 8)
|
||||
return null;
|
||||
|
||||
LeadInCopyright cmi = new LeadInCopyright();
|
||||
@@ -144,13 +144,13 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static string PrettifyLeadInCopyright(LeadInCopyright? cmi)
|
||||
{
|
||||
if (cmi == null)
|
||||
if(cmi == null)
|
||||
return null;
|
||||
|
||||
LeadInCopyright decoded = cmi.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
switch (decoded.CopyrightType)
|
||||
switch(decoded.CopyrightType)
|
||||
{
|
||||
case CopyrightType.NoProtection:
|
||||
sb.AppendLine("Disc has no encryption.");
|
||||
@@ -169,31 +169,31 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
}
|
||||
|
||||
if (decoded.CopyrightType == 0)
|
||||
if(decoded.CopyrightType == 0)
|
||||
return sb.ToString();
|
||||
|
||||
if (decoded.RegionInformation == 0xFF)
|
||||
if(decoded.RegionInformation == 0xFF)
|
||||
sb.AppendLine("Disc cannot be played in any region at all.");
|
||||
else if (decoded.RegionInformation == 0x00)
|
||||
else if(decoded.RegionInformation == 0x00)
|
||||
sb.AppendLine("Disc can be played in any region.");
|
||||
else
|
||||
{
|
||||
sb.Append("Disc can be played in the following regions:");
|
||||
if ((decoded.RegionInformation & 0x01) != 0x01)
|
||||
if((decoded.RegionInformation & 0x01) != 0x01)
|
||||
sb.Append(" 0");
|
||||
if ((decoded.RegionInformation & 0x02) != 0x02)
|
||||
if((decoded.RegionInformation & 0x02) != 0x02)
|
||||
sb.Append(" 1");
|
||||
if ((decoded.RegionInformation & 0x04) != 0x04)
|
||||
if((decoded.RegionInformation & 0x04) != 0x04)
|
||||
sb.Append(" 2");
|
||||
if ((decoded.RegionInformation & 0x08) != 0x08)
|
||||
if((decoded.RegionInformation & 0x08) != 0x08)
|
||||
sb.Append(" 3");
|
||||
if ((decoded.RegionInformation & 0x10) != 0x10)
|
||||
if((decoded.RegionInformation & 0x10) != 0x10)
|
||||
sb.Append(" 4");
|
||||
if ((decoded.RegionInformation & 0x20) != 0x20)
|
||||
if((decoded.RegionInformation & 0x20) != 0x20)
|
||||
sb.Append(" 5");
|
||||
if ((decoded.RegionInformation & 0x40) != 0x40)
|
||||
if((decoded.RegionInformation & 0x40) != 0x40)
|
||||
sb.Append(" 6");
|
||||
if ((decoded.RegionInformation & 0x80) != 0x80)
|
||||
if((decoded.RegionInformation & 0x80) != 0x80)
|
||||
sb.Append(" 7");
|
||||
}
|
||||
|
||||
|
||||
@@ -128,10 +128,10 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static MediumStatus? Decode(byte[] response)
|
||||
{
|
||||
if (response == null)
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length != 8)
|
||||
if(response.Length != 8)
|
||||
return null;
|
||||
|
||||
MediumStatus status = new MediumStatus();
|
||||
@@ -155,25 +155,25 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static string Prettify(MediumStatus? status)
|
||||
{
|
||||
if (status == null)
|
||||
if(status == null)
|
||||
return null;
|
||||
|
||||
MediumStatus decoded = status.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (decoded.PWP)
|
||||
if(decoded.PWP)
|
||||
sb.AppendLine("Disc surface is set to write protected status");
|
||||
|
||||
if (decoded.Cartridge)
|
||||
if(decoded.Cartridge)
|
||||
{
|
||||
sb.AppendLine("Disc comes in a cartridge");
|
||||
if (decoded.OUT)
|
||||
if(decoded.OUT)
|
||||
sb.AppendLine("Disc has been extracted from the cartridge");
|
||||
if (decoded.CWP)
|
||||
if(decoded.CWP)
|
||||
sb.AppendLine("Cartridge is set to write protected");
|
||||
}
|
||||
|
||||
switch (decoded.DiscType)
|
||||
switch(decoded.DiscType)
|
||||
{
|
||||
case 0:
|
||||
sb.AppendLine("Disc shall not be written without a cartridge");
|
||||
@@ -186,9 +186,9 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
}
|
||||
|
||||
if (decoded.MSWI)
|
||||
if(decoded.MSWI)
|
||||
{
|
||||
switch (decoded.RAMSWI)
|
||||
switch(decoded.RAMSWI)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
||||
40
DVD/DDS.cs
40
DVD/DDS.cs
@@ -201,17 +201,17 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static DiscDefinitionStructure? Decode(byte[] response)
|
||||
{
|
||||
if (response == null)
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length != 2052)
|
||||
if(response.Length != 2052)
|
||||
return null;
|
||||
|
||||
DiscDefinitionStructure dds = new DiscDefinitionStructure();
|
||||
|
||||
dds.Identifier = (ushort)((response[4] << 8) + response[5]);
|
||||
|
||||
if (dds.Identifier != 0x0A0A)
|
||||
if(dds.Identifier != 0x0A0A)
|
||||
return null;
|
||||
|
||||
// Common to both DVD-RAM versions
|
||||
@@ -226,7 +226,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
dds.Groups = (ushort)((response[12] << 8) + response[13]);
|
||||
|
||||
// ECMA-272
|
||||
if (dds.Groups == 24)
|
||||
if(dds.Groups == 24)
|
||||
{
|
||||
dds.PartialCertification |= (response[7] & 0x40) == 0x40;
|
||||
dds.FormattingOnlyAGroup |= (response[7] & 0x20) == 0x20;
|
||||
@@ -234,7 +234,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
dds.Reserved = new byte[6];
|
||||
Array.Copy(response, 14, dds.Reserved, 0, 6);
|
||||
dds.GroupCertificationFlags = new GroupCertificationFlag[24];
|
||||
for (int i = 0; i < 24; i++)
|
||||
for(int i = 0; i < 24; i++)
|
||||
{
|
||||
dds.GroupCertificationFlags[i].InProcess |= (response[20 + i] & 0x80) == 0x80;
|
||||
dds.GroupCertificationFlags[i].PartialCertification |= (response[20 + i] & 0x40) == 0x40;
|
||||
@@ -245,7 +245,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// ECMA-330
|
||||
if (dds.Groups == 1)
|
||||
if(dds.Groups == 1)
|
||||
{
|
||||
dds.Reserved4 = (byte)((response[7] & 0x7C) >> 2);
|
||||
dds.Reserved = new byte[68];
|
||||
@@ -256,7 +256,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
dds.LSN0Location = (uint)((response[93] << 16) + (response[94] << 8) + response[95]);
|
||||
dds.StartLSNForZone = new uint[dds.Zones];
|
||||
|
||||
for (int i = 0; i < dds.Zones; i++)
|
||||
for(int i = 0; i < dds.Zones; i++)
|
||||
dds.StartLSNForZone[i] = (uint)((response[260 + i * 4 + 1] << 16) + (response[260 + i * 4 + 2] << 8) + response[260 + i * 4 + 3]);
|
||||
}
|
||||
|
||||
@@ -265,53 +265,53 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static string Prettify(DiscDefinitionStructure? dds)
|
||||
{
|
||||
if (dds == null)
|
||||
if(dds == null)
|
||||
return null;
|
||||
|
||||
DiscDefinitionStructure decoded = dds.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (decoded.InProcess)
|
||||
if(decoded.InProcess)
|
||||
{
|
||||
sb.AppendLine("Formatting in progress.");
|
||||
if (decoded.Groups == 24)
|
||||
if(decoded.Groups == 24)
|
||||
{
|
||||
if (decoded.PartialCertification)
|
||||
if(decoded.PartialCertification)
|
||||
sb.AppendLine("Formatting is only using partial certification");
|
||||
if (decoded.FormattingOnlyAGroup)
|
||||
if(decoded.FormattingOnlyAGroup)
|
||||
sb.AppendLine("Only a group is being formatted");
|
||||
}
|
||||
}
|
||||
|
||||
if (decoded.UserCertification)
|
||||
if(decoded.UserCertification)
|
||||
sb.AppendLine("Disc has been certified by an user");
|
||||
if (decoded.ManufacturerCertification)
|
||||
if(decoded.ManufacturerCertification)
|
||||
sb.AppendLine("Disc has been certified by a manufacturer");
|
||||
|
||||
sb.AppendFormat("DDS has been updated {0} times", decoded.UpdateCount).AppendLine();
|
||||
|
||||
if (decoded.Groups == 24)
|
||||
if(decoded.Groups == 24)
|
||||
{
|
||||
for (int i = 0; i < decoded.GroupCertificationFlags.Length; i++)
|
||||
for(int i = 0; i < decoded.GroupCertificationFlags.Length; i++)
|
||||
{
|
||||
if(decoded.GroupCertificationFlags[i].InProcess)
|
||||
{
|
||||
sb.AppendFormat("Group {0} is being formatted", i).AppendLine();
|
||||
if (decoded.GroupCertificationFlags[i].PartialCertification)
|
||||
if(decoded.GroupCertificationFlags[i].PartialCertification)
|
||||
sb.AppendFormat("Group {0} is being certified partially", i).AppendLine();
|
||||
}
|
||||
if (decoded.GroupCertificationFlags[i].UserCertification)
|
||||
if(decoded.GroupCertificationFlags[i].UserCertification)
|
||||
sb.AppendFormat("Group {0} has been certified by an user", i).AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
if (decoded.Groups == 1)
|
||||
if(decoded.Groups == 1)
|
||||
{
|
||||
sb.AppendFormat("Disc has {0} zones", decoded.Zones).AppendLine();
|
||||
sb.AppendFormat("Primary Spare Area stats at PSN {0:X}h and ends at PSN {1:X}h, inclusively", decoded.SpareAreaFirstPSN, decoded.SpareAreaLastPSN).AppendLine();
|
||||
sb.AppendFormat("LSN 0 is at PSN {0:X}h", decoded.LSN0Location).AppendLine();
|
||||
|
||||
for (int i = 0; i < decoded.StartLSNForZone.Length; i++)
|
||||
for(int i = 0; i < decoded.StartLSNForZone.Length; i++)
|
||||
sb.AppendFormat("Zone {0} starts at LSN {1}", i, decoded.StartLSNForZone[i]).AppendLine();
|
||||
}
|
||||
|
||||
|
||||
100
DVD/PFI.cs
100
DVD/PFI.cs
@@ -1054,10 +1054,10 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static PhysicalFormatInformation? Decode(byte[] response)
|
||||
{
|
||||
if (response == null)
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length < 2052)
|
||||
if(response.Length < 2052)
|
||||
return null;
|
||||
|
||||
PhysicalFormatInformation pfi = new PhysicalFormatInformation();
|
||||
@@ -1084,17 +1084,17 @@ namespace DiscImageChef.Decoders.DVD
|
||||
pfi.BCA |= (response[20] & 0x80) == 0x80;
|
||||
|
||||
// UMD
|
||||
if (pfi.DiskCategory == DiskCategory.UMD)
|
||||
if(pfi.DiskCategory == DiskCategory.UMD)
|
||||
{
|
||||
pfi.MediaAttribute = (ushort)((response[21] << 8) + response[22]);
|
||||
}
|
||||
|
||||
// DVD-RAM
|
||||
if (pfi.DiskCategory == DiskCategory.DVDRAM)
|
||||
if(pfi.DiskCategory == DiskCategory.DVDRAM)
|
||||
{
|
||||
pfi.DiscType = (DVDRAMDiscType)response[36];
|
||||
|
||||
if (pfi.PartVersion == 1)
|
||||
if(pfi.PartVersion == 1)
|
||||
{
|
||||
pfi.Velocity = response[52];
|
||||
pfi.ReadPower = response[53];
|
||||
@@ -1115,7 +1115,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
pfi.LastPulseEndGroove = response[68];
|
||||
pfi.BiasPowerDurationGroove = response[69];
|
||||
}
|
||||
else if (pfi.PartVersion == 6)
|
||||
else if(pfi.PartVersion == 6)
|
||||
{
|
||||
pfi.Velocity = response[504];
|
||||
pfi.ReadPower = response[505];
|
||||
@@ -1187,7 +1187,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// DVD-R and DVD-RW
|
||||
if ((pfi.DiskCategory == DiskCategory.DVDR &&
|
||||
if((pfi.DiskCategory == DiskCategory.DVDR &&
|
||||
pfi.PartVersion < 6) ||
|
||||
(pfi.DiskCategory == DiskCategory.DVDRW &&
|
||||
pfi.PartVersion < 3))
|
||||
@@ -1197,7 +1197,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// DVD+RW
|
||||
if (pfi.DiskCategory == DiskCategory.DVDPRW)
|
||||
if(pfi.DiskCategory == DiskCategory.DVDPRW)
|
||||
{
|
||||
pfi.RecordingVelocity = response[36];
|
||||
pfi.ReadPowerMaxVelocity = response[37];
|
||||
@@ -1221,7 +1221,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// DVD+R, DVD+RW, DVD+R DL and DVD+RW DL
|
||||
if (pfi.DiskCategory == DiskCategory.DVDPR ||
|
||||
if(pfi.DiskCategory == DiskCategory.DVDPR ||
|
||||
pfi.DiskCategory == DiskCategory.DVDPRW ||
|
||||
pfi.DiskCategory == DiskCategory.DVDPRDL ||
|
||||
pfi.DiskCategory == DiskCategory.DVDPRWDL)
|
||||
@@ -1240,7 +1240,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// DVD+RW
|
||||
if (pfi.DiskCategory == DiskCategory.DVDPRW &&
|
||||
if(pfi.DiskCategory == DiskCategory.DVDPRW &&
|
||||
pfi.PartVersion == 2)
|
||||
{
|
||||
pfi.TopFirstPulseDuration = response[55];
|
||||
@@ -1251,7 +1251,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// DVD+R and DVD+R DL
|
||||
if (pfi.DiskCategory == DiskCategory.DVDPR ||
|
||||
if(pfi.DiskCategory == DiskCategory.DVDPR ||
|
||||
pfi.DiskCategory == DiskCategory.DVDPRDL)
|
||||
{
|
||||
pfi.PrimaryVelocity = response[36];
|
||||
@@ -1281,13 +1281,13 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// DVD+R DL
|
||||
if (pfi.DiskCategory == DiskCategory.DVDPRDL)
|
||||
if(pfi.DiskCategory == DiskCategory.DVDPRDL)
|
||||
{
|
||||
pfi.LayerStructure = (DVDLayerStructure)((response[34] & 0xC0) >> 6);
|
||||
}
|
||||
|
||||
// DVD+RW DL
|
||||
if (pfi.DiskCategory == DiskCategory.DVDPRWDL)
|
||||
if(pfi.DiskCategory == DiskCategory.DVDPRWDL)
|
||||
{
|
||||
pfi.BasicPrimaryVelocity = response[36];
|
||||
pfi.MaxReadPowerPrimaryVelocity = response[37];
|
||||
@@ -1310,7 +1310,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
// DVD-R DL and DVD-RW DL
|
||||
if ((pfi.DiskCategory == DiskCategory.DVDR &&
|
||||
if((pfi.DiskCategory == DiskCategory.DVDR &&
|
||||
pfi.PartVersion == 6) ||
|
||||
(pfi.DiskCategory == DiskCategory.DVDRW &&
|
||||
pfi.PartVersion == 3))
|
||||
@@ -1340,14 +1340,14 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static string Prettify(PhysicalFormatInformation? pfi)
|
||||
{
|
||||
if (pfi == null)
|
||||
if(pfi == null)
|
||||
return null;
|
||||
|
||||
PhysicalFormatInformation decoded = pfi.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
string sizeString;
|
||||
switch (decoded.DiscSize)
|
||||
switch(decoded.DiscSize)
|
||||
{
|
||||
case DVDSize.Eighty:
|
||||
sizeString = "80mm";
|
||||
@@ -1362,18 +1362,18 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
string categorySentence = "Disc is a {0} {1} version {2}";
|
||||
|
||||
switch (decoded.DiskCategory)
|
||||
switch(decoded.DiskCategory)
|
||||
{
|
||||
case DiskCategory.DVDROM:
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD-ROM", decoded.PartVersion).AppendLine();
|
||||
if (decoded.DiscSize == DVDSize.OneTwenty && decoded.PartVersion == 1)
|
||||
if(decoded.DiscSize == DVDSize.OneTwenty && decoded.PartVersion == 1)
|
||||
sb.AppendLine("Disc claims conformation to ECMA-267");
|
||||
if (decoded.DiscSize == DVDSize.Eighty && decoded.PartVersion == 1)
|
||||
if(decoded.DiscSize == DVDSize.Eighty && decoded.PartVersion == 1)
|
||||
sb.AppendLine("Disc claims conformation to ECMA-268");
|
||||
break;
|
||||
case DiskCategory.DVDRAM:
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD-RAM", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-272");
|
||||
@@ -1388,7 +1388,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD-R DL", decoded.PartVersion).AppendLine();
|
||||
else
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD-R", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-279");
|
||||
@@ -1406,7 +1406,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD-RW DL", decoded.PartVersion).AppendLine();
|
||||
else
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD-RW", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 2:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-338");
|
||||
@@ -1421,7 +1421,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
sb.AppendFormat(categorySentence, "60mm", "UMD", decoded.PartVersion).AppendLine();
|
||||
else
|
||||
sb.AppendFormat(categorySentence, "invalid size", "UMD", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 0:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-365");
|
||||
@@ -1430,7 +1430,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
case DiskCategory.DVDPRW:
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD+RW", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-274");
|
||||
@@ -1445,7 +1445,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
case DiskCategory.DVDPR:
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD+R", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-349");
|
||||
@@ -1454,7 +1454,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
case DiskCategory.DVDPRWDL:
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD+RW DL", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-374");
|
||||
@@ -1463,7 +1463,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
case DiskCategory.DVDPRDL:
|
||||
sb.AppendFormat(categorySentence, sizeString, "DVD+R DL", decoded.PartVersion).AppendLine();
|
||||
switch (decoded.PartVersion)
|
||||
switch(decoded.PartVersion)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendLine("Disc claims conformation to ECMA-364");
|
||||
@@ -1471,11 +1471,11 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
break;
|
||||
case DiskCategory.Nintendo:
|
||||
if (decoded.PartVersion == 15)
|
||||
if(decoded.PartVersion == 15)
|
||||
{
|
||||
if (decoded.DiscSize == DVDSize.Eighty)
|
||||
if(decoded.DiscSize == DVDSize.Eighty)
|
||||
sb.AppendLine("Disc is a Nintendo Gamecube Optical Disc (GOD)");
|
||||
else if (decoded.DiscSize == DVDSize.OneTwenty)
|
||||
else if(decoded.DiscSize == DVDSize.OneTwenty)
|
||||
sb.AppendLine("Disc is a Nintendo Wii Optical Disc (WOD)");
|
||||
else
|
||||
goto default;
|
||||
@@ -1500,7 +1500,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
}
|
||||
|
||||
switch (decoded.MaximumRate)
|
||||
switch(decoded.MaximumRate)
|
||||
{
|
||||
case MaximumRateField.TwoMbps:
|
||||
sb.AppendLine("Disc maximum transfer rate is 2,52 Mbit/sec.");
|
||||
@@ -1526,12 +1526,12 @@ namespace DiscImageChef.Decoders.DVD
|
||||
}
|
||||
|
||||
sb.AppendFormat("Disc has {0} layers", decoded.Layers + 1).AppendLine();
|
||||
if (decoded.TrackPath && decoded.Layers == 1)
|
||||
if(decoded.TrackPath && decoded.Layers == 1)
|
||||
sb.AppendLine("Layers are in parallel track path");
|
||||
else if (!decoded.TrackPath && decoded.Layers == 1)
|
||||
else if(!decoded.TrackPath && decoded.Layers == 1)
|
||||
sb.AppendLine("Layers are in opposite track path");
|
||||
|
||||
switch (decoded.LinearDensity)
|
||||
switch(decoded.LinearDensity)
|
||||
{
|
||||
case LinearDensityField.TwoSix:
|
||||
sb.AppendLine("Pitch size is 0,267 μm/bit");
|
||||
@@ -1559,7 +1559,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
}
|
||||
|
||||
switch (decoded.TrackDensity)
|
||||
switch(decoded.TrackDensity)
|
||||
{
|
||||
case TrackDensityField.Seven:
|
||||
sb.AppendLine("Track size is 0,74 μm");
|
||||
@@ -1581,13 +1581,13 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
}
|
||||
|
||||
if (decoded.DataAreaStartPSN > 0)
|
||||
if(decoded.DataAreaStartPSN > 0)
|
||||
{
|
||||
if (decoded.DataAreaEndPSN > 0)
|
||||
if(decoded.DataAreaEndPSN > 0)
|
||||
{
|
||||
sb.AppendFormat("Data area starts at PSN {0:X}h", decoded.DataAreaStartPSN).AppendLine();
|
||||
sb.AppendFormat("Data area ends at PSN {0:X}h", decoded.DataAreaEndPSN).AppendLine();
|
||||
if (decoded.Layers == 1 && !decoded.TrackPath)
|
||||
if(decoded.Layers == 1 && !decoded.TrackPath)
|
||||
sb.AppendFormat("Layer 0 ends at PSN {0:X}h", decoded.Layer0EndPSN).AppendLine();
|
||||
}
|
||||
else
|
||||
@@ -1596,15 +1596,15 @@ namespace DiscImageChef.Decoders.DVD
|
||||
else
|
||||
sb.AppendLine("Disc is empty");
|
||||
|
||||
if (decoded.BCA)
|
||||
if(decoded.BCA)
|
||||
sb.AppendLine("Disc has a burst cutting area");
|
||||
|
||||
if (decoded.DiskCategory == DiskCategory.UMD)
|
||||
if(decoded.DiskCategory == DiskCategory.UMD)
|
||||
sb.AppendFormat("Media attribute is {0}", decoded.MediaAttribute).AppendLine();
|
||||
|
||||
if (decoded.DiskCategory == DiskCategory.DVDRAM)
|
||||
if(decoded.DiskCategory == DiskCategory.DVDRAM)
|
||||
{
|
||||
switch (decoded.DiscType)
|
||||
switch(decoded.DiscType)
|
||||
{
|
||||
case DVDRAMDiscType.Cased:
|
||||
sb.AppendLine("Disc shall be recorded with a case");
|
||||
@@ -1617,14 +1617,14 @@ namespace DiscImageChef.Decoders.DVD
|
||||
break;
|
||||
}
|
||||
|
||||
if (decoded.PartVersion == 6)
|
||||
if(decoded.PartVersion == 6)
|
||||
{
|
||||
sb.AppendFormat("Disc manufacturer is {0}", decoded.DiskManufacturer).AppendLine();
|
||||
sb.AppendFormat("Disc manufacturer supplementary information is {0}", decoded.DiskManufacturerSupplementary).AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
if ((decoded.DiskCategory == DiskCategory.DVDR &&
|
||||
if((decoded.DiskCategory == DiskCategory.DVDR &&
|
||||
decoded.PartVersion < 6) ||
|
||||
(decoded.DiskCategory == DiskCategory.DVDRW &&
|
||||
decoded.PartVersion < 3))
|
||||
@@ -1633,12 +1633,12 @@ namespace DiscImageChef.Decoders.DVD
|
||||
sb.AppendFormat("Next Border-In first sector is PSN {0:X}h", decoded.NextBorderInSector).AppendLine();
|
||||
}
|
||||
|
||||
if (decoded.DiskCategory == DiskCategory.DVDPR ||
|
||||
if(decoded.DiskCategory == DiskCategory.DVDPR ||
|
||||
decoded.DiskCategory == DiskCategory.DVDPRW ||
|
||||
decoded.DiskCategory == DiskCategory.DVDPRDL ||
|
||||
decoded.DiskCategory == DiskCategory.DVDPRWDL)
|
||||
{
|
||||
if (decoded.VCPS)
|
||||
if(decoded.VCPS)
|
||||
sb.AppendLine("Disc contains extended information for VCPS");
|
||||
sb.AppendFormat("Disc application code is {0}", decoded.ApplicationCode).AppendLine();
|
||||
sb.AppendFormat("Disc manufacturer is {0}", decoded.DiskManufacturerID).AppendLine();
|
||||
@@ -1646,18 +1646,18 @@ namespace DiscImageChef.Decoders.DVD
|
||||
sb.AppendFormat("Disc product revision is {0}", decoded.ProductRevision).AppendLine();
|
||||
}
|
||||
|
||||
if ((decoded.DiskCategory == DiskCategory.DVDR &&
|
||||
if((decoded.DiskCategory == DiskCategory.DVDR &&
|
||||
decoded.PartVersion >= 6) ||
|
||||
(decoded.DiskCategory == DiskCategory.DVDRW &&
|
||||
decoded.PartVersion >= 3))
|
||||
{
|
||||
sb.AppendFormat("Current RMD in extra Border zone starts at PSN {0:X}h", decoded.CurrentRMDExtraBorderPSN).AppendLine();
|
||||
sb.AppendFormat("PFI in extra Border zone starts at PSN {0:X}h", decoded.PFIExtraBorderPSN).AppendLine();
|
||||
if (!decoded.PreRecordedControlDataInv)
|
||||
if(!decoded.PreRecordedControlDataInv)
|
||||
sb.AppendLine("Control Data Zone is pre-recorded");
|
||||
if (decoded.PreRecordedLeadIn)
|
||||
if(decoded.PreRecordedLeadIn)
|
||||
sb.AppendLine("Lead-In is pre-recorded");
|
||||
if (decoded.PreRecordedLeadOut)
|
||||
if(decoded.PreRecordedLeadOut)
|
||||
sb.AppendLine("Lead-Out is pre-recorded");
|
||||
}
|
||||
|
||||
|
||||
@@ -93,10 +93,10 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static SpareAreaInformation? Decode(byte[] response)
|
||||
{
|
||||
if (response == null)
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length != 16)
|
||||
if(response.Length != 16)
|
||||
return null;
|
||||
|
||||
SpareAreaInformation sai = new SpareAreaInformation();
|
||||
@@ -113,7 +113,7 @@ namespace DiscImageChef.Decoders.DVD
|
||||
|
||||
public static string Prettify(SpareAreaInformation? sai)
|
||||
{
|
||||
if (sai == null)
|
||||
if(sai == null)
|
||||
return null;
|
||||
|
||||
SpareAreaInformation decoded = sai.Value;
|
||||
|
||||
@@ -62,14 +62,14 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
ushort len = (ushort)((response[0] << 8) + response[1]);
|
||||
|
||||
if (len + 2 != response.Length)
|
||||
if(len + 2 != response.Length)
|
||||
return null;
|
||||
|
||||
List<Capability> caps = new List<Capability>();
|
||||
|
||||
uint offset = 4;
|
||||
|
||||
while (offset < response.Length)
|
||||
while(offset < response.Length)
|
||||
{
|
||||
Capability cap = new Capability();
|
||||
cap.FormatCode = response[offset];
|
||||
|
||||
18
SCSI/EVPD.cs
18
SCSI/EVPD.cs
@@ -49,13 +49,13 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// <param name="page">Page 0x00.</param>
|
||||
public static byte[] DecodePage00(byte[] page)
|
||||
{
|
||||
if (page == null)
|
||||
if(page == null)
|
||||
return null;
|
||||
|
||||
if (page[1] != 0)
|
||||
if(page[1] != 0)
|
||||
return null;
|
||||
|
||||
if (page.Length != page[3] + 4)
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
byte[] decoded = new byte[page.Length - 4];
|
||||
@@ -72,13 +72,13 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// <param name="page">Page 0x01-0x7F.</param>
|
||||
public static string DecodeASCIIPage(byte[] page)
|
||||
{
|
||||
if (page == null)
|
||||
if(page == null)
|
||||
return null;
|
||||
|
||||
if (page[1] == 0 || page[1] > 0x7F)
|
||||
if(page[1] == 0 || page[1] > 0x7F)
|
||||
return null;
|
||||
|
||||
if (page.Length != page[3] + 4)
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
byte[] ascii = new byte[page[4]];
|
||||
@@ -95,13 +95,13 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// <param name="page">Page 0x80.</param>
|
||||
public static string DecodePage80(byte[] page)
|
||||
{
|
||||
if (page == null)
|
||||
if(page == null)
|
||||
return null;
|
||||
|
||||
if (page[1] != 0x80)
|
||||
if(page[1] != 0x80)
|
||||
return null;
|
||||
|
||||
if (page.Length != page[3] + 4)
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
byte[] ascii = new byte[page.Length - 4];
|
||||
|
||||
138
SCSI/Inquiry.cs
138
SCSI/Inquiry.cs
@@ -58,16 +58,16 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static SCSIInquiry? Decode(byte[] SCSIInquiryResponse)
|
||||
{
|
||||
if (SCSIInquiryResponse == null)
|
||||
if(SCSIInquiryResponse == null)
|
||||
return null;
|
||||
|
||||
if (SCSIInquiryResponse.Length < 36 && SCSIInquiryResponse.Length != 5)
|
||||
if(SCSIInquiryResponse.Length < 36 && SCSIInquiryResponse.Length != 5)
|
||||
{
|
||||
DicConsole.DebugWriteLine("SCSI INQUIRY decoder", "INQUIRY response is {0} bytes, less than minimum of 36 bytes, decoded data can be incorrect, not decoding.", SCSIInquiryResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (SCSIInquiryResponse.Length != SCSIInquiryResponse[4] + 5)
|
||||
if(SCSIInquiryResponse.Length != SCSIInquiryResponse[4] + 5)
|
||||
{
|
||||
DicConsole.DebugWriteLine("SCSI INQUIRY decoder", "INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, not decoding.", SCSIInquiryResponse.Length, SCSIInquiryResponse[4] + 4);
|
||||
return null;
|
||||
@@ -75,23 +75,23 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
SCSIInquiry decoded = new SCSIInquiry();
|
||||
|
||||
if (SCSIInquiryResponse.Length >= 1)
|
||||
if(SCSIInquiryResponse.Length >= 1)
|
||||
{
|
||||
decoded.PeripheralQualifier = (byte)((SCSIInquiryResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (byte)(SCSIInquiryResponse[0] & 0x1F);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 2)
|
||||
if(SCSIInquiryResponse.Length >= 2)
|
||||
{
|
||||
decoded.RMB = Convert.ToBoolean((SCSIInquiryResponse[1] & 0x80));
|
||||
decoded.DeviceTypeModifier = (byte)(SCSIInquiryResponse[1] & 0x7F);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 3)
|
||||
if(SCSIInquiryResponse.Length >= 3)
|
||||
{
|
||||
decoded.ISOVersion = (byte)((SCSIInquiryResponse[2] & 0xC0) >> 6);
|
||||
decoded.ECMAVersion = (byte)((SCSIInquiryResponse[2] & 0x38) >> 3);
|
||||
decoded.ANSIVersion = (byte)(SCSIInquiryResponse[2] & 0x07);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 4)
|
||||
if(SCSIInquiryResponse.Length >= 4)
|
||||
{
|
||||
decoded.AERC = Convert.ToBoolean((SCSIInquiryResponse[3] & 0x80));
|
||||
decoded.TrmTsk = Convert.ToBoolean((SCSIInquiryResponse[3] & 0x40));
|
||||
@@ -99,9 +99,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
decoded.HiSup = Convert.ToBoolean((SCSIInquiryResponse[3] & 0x10));
|
||||
decoded.ResponseDataFormat = (byte)(SCSIInquiryResponse[3] & 0x07);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 5)
|
||||
if(SCSIInquiryResponse.Length >= 5)
|
||||
decoded.AdditionalLength = SCSIInquiryResponse[4];
|
||||
if (SCSIInquiryResponse.Length >= 6)
|
||||
if(SCSIInquiryResponse.Length >= 6)
|
||||
{
|
||||
decoded.SCCS = Convert.ToBoolean((SCSIInquiryResponse[5] & 0x80));
|
||||
decoded.ACC = Convert.ToBoolean((SCSIInquiryResponse[5] & 0x40));
|
||||
@@ -110,7 +110,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
decoded.Reserved2 = (byte)((SCSIInquiryResponse[5] & 0x06) >> 1);
|
||||
decoded.Protect = Convert.ToBoolean((SCSIInquiryResponse[5] & 0x01));
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 7)
|
||||
if(SCSIInquiryResponse.Length >= 7)
|
||||
{
|
||||
decoded.BQue = Convert.ToBoolean((SCSIInquiryResponse[6] & 0x80));
|
||||
decoded.EncServ = Convert.ToBoolean((SCSIInquiryResponse[6] & 0x40));
|
||||
@@ -121,7 +121,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
decoded.Addr32 = Convert.ToBoolean((SCSIInquiryResponse[6] & 0x02));
|
||||
decoded.Addr16 = Convert.ToBoolean((SCSIInquiryResponse[6] & 0x01));
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 8)
|
||||
if(SCSIInquiryResponse.Length >= 8)
|
||||
{
|
||||
decoded.RelAddr = Convert.ToBoolean((SCSIInquiryResponse[7] & 0x80));
|
||||
decoded.WBus32 = Convert.ToBoolean((SCSIInquiryResponse[7] & 0x40));
|
||||
@@ -132,61 +132,61 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
decoded.CmdQue = Convert.ToBoolean((SCSIInquiryResponse[7] & 0x02));
|
||||
decoded.SftRe = Convert.ToBoolean((SCSIInquiryResponse[7] & 0x01));
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 16)
|
||||
if(SCSIInquiryResponse.Length >= 16)
|
||||
{
|
||||
decoded.VendorIdentification = new byte[8];
|
||||
Array.Copy(SCSIInquiryResponse, 8, decoded.VendorIdentification, 0, 8);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 32)
|
||||
if(SCSIInquiryResponse.Length >= 32)
|
||||
{
|
||||
decoded.ProductIdentification = new byte[16];
|
||||
Array.Copy(SCSIInquiryResponse, 16, decoded.ProductIdentification, 0, 16);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 36)
|
||||
if(SCSIInquiryResponse.Length >= 36)
|
||||
{
|
||||
decoded.ProductRevisionLevel = new byte[4];
|
||||
Array.Copy(SCSIInquiryResponse, 32, decoded.ProductRevisionLevel, 0, 4);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 56)
|
||||
if(SCSIInquiryResponse.Length >= 56)
|
||||
{
|
||||
decoded.VendorSpecific = new byte[20];
|
||||
Array.Copy(SCSIInquiryResponse, 36, decoded.VendorSpecific, 0, 20);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 57)
|
||||
if(SCSIInquiryResponse.Length >= 57)
|
||||
{
|
||||
decoded.Reserved3 = (byte)((SCSIInquiryResponse[56] & 0xF0) >> 4);
|
||||
decoded.Clocking = (byte)((SCSIInquiryResponse[56] & 0x0C) >> 2);
|
||||
decoded.QAS = Convert.ToBoolean((SCSIInquiryResponse[56] & 0x02));
|
||||
decoded.IUS = Convert.ToBoolean((SCSIInquiryResponse[56] & 0x01));
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 58)
|
||||
if(SCSIInquiryResponse.Length >= 58)
|
||||
decoded.Reserved4 = SCSIInquiryResponse[57];
|
||||
if (SCSIInquiryResponse.Length >= 60)
|
||||
if(SCSIInquiryResponse.Length >= 60)
|
||||
{
|
||||
int descriptorsNo;
|
||||
|
||||
if (SCSIInquiryResponse.Length >= 74)
|
||||
if(SCSIInquiryResponse.Length >= 74)
|
||||
descriptorsNo = 8;
|
||||
else
|
||||
descriptorsNo = (SCSIInquiryResponse.Length - 58) / 2;
|
||||
|
||||
decoded.VersionDescriptors = new ushort[descriptorsNo];
|
||||
for (int i = 0; i < descriptorsNo; i++)
|
||||
for(int i = 0; i < descriptorsNo; i++)
|
||||
{
|
||||
decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + (i * 2));
|
||||
}
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 75 && SCSIInquiryResponse.Length < 96)
|
||||
if(SCSIInquiryResponse.Length >= 75 && SCSIInquiryResponse.Length < 96)
|
||||
{
|
||||
decoded.Reserved5 = new byte[SCSIInquiryResponse.Length - 74];
|
||||
Array.Copy(SCSIInquiryResponse, 74, decoded.Reserved5, 0, SCSIInquiryResponse.Length - 74);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 96)
|
||||
if(SCSIInquiryResponse.Length >= 96)
|
||||
{
|
||||
decoded.Reserved5 = new byte[22];
|
||||
Array.Copy(SCSIInquiryResponse, 74, decoded.Reserved5, 0, 22);
|
||||
}
|
||||
if (SCSIInquiryResponse.Length > 96)
|
||||
if(SCSIInquiryResponse.Length > 96)
|
||||
{
|
||||
decoded.VendorSpecific2 = new byte[SCSIInquiryResponse.Length - 96];
|
||||
Array.Copy(SCSIInquiryResponse, 96, decoded.VendorSpecific2, 0, SCSIInquiryResponse.Length - 96);
|
||||
@@ -197,7 +197,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static string Prettify(SCSIInquiry? SCSIInquiryResponse)
|
||||
{
|
||||
if (SCSIInquiryResponse == null)
|
||||
if(SCSIInquiryResponse == null)
|
||||
return null;
|
||||
|
||||
SCSIInquiry response = SCSIInquiryResponse.Value;
|
||||
@@ -207,7 +207,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("Device vendor: {0}", VendorString.Prettify(StringHandlers.CToString(response.VendorIdentification).Trim())).AppendLine();
|
||||
sb.AppendFormat("Device name: {0}", StringHandlers.CToString(response.ProductIdentification).Trim()).AppendLine();
|
||||
sb.AppendFormat("Device release level: {0}", StringHandlers.CToString(response.ProductRevisionLevel).Trim()).AppendLine();
|
||||
switch ((PeripheralQualifiers)response.PeripheralQualifier)
|
||||
switch((PeripheralQualifiers)response.PeripheralQualifier)
|
||||
{
|
||||
case PeripheralQualifiers.Supported:
|
||||
sb.AppendLine("Device is connected and supported.");
|
||||
@@ -226,7 +226,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((PeripheralDeviceTypes)response.PeripheralDeviceType)
|
||||
switch((PeripheralDeviceTypes)response.PeripheralDeviceType)
|
||||
{
|
||||
case PeripheralDeviceTypes.DirectAccess: //0x00,
|
||||
sb.AppendLine("Direct-access device");
|
||||
@@ -302,7 +302,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((ANSIVersions)response.ANSIVersion)
|
||||
switch((ANSIVersions)response.ANSIVersion)
|
||||
{
|
||||
case ANSIVersions.ANSINoVersion:
|
||||
sb.AppendLine("Device does not claim to comply with any SCSI ANSI standard");
|
||||
@@ -330,7 +330,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((ECMAVersions)response.ECMAVersion)
|
||||
switch((ECMAVersions)response.ECMAVersion)
|
||||
{
|
||||
case ECMAVersions.ECMANoVersion:
|
||||
sb.AppendLine("Device does not claim to comply with any SCSI ECMA standard");
|
||||
@@ -343,7 +343,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((ISOVersions)response.ISOVersion)
|
||||
switch((ISOVersions)response.ISOVersion)
|
||||
{
|
||||
case ISOVersions.ISONoVersion:
|
||||
sb.AppendLine("Device does not claim to comply with any SCSI ISO/IEC standard");
|
||||
@@ -356,64 +356,64 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
if (response.RMB)
|
||||
if(response.RMB)
|
||||
sb.AppendLine("Device is removable");
|
||||
if (response.AERC)
|
||||
if(response.AERC)
|
||||
sb.AppendLine("Device supports Asynchronous Event Reporting Capability");
|
||||
if (response.TrmTsk)
|
||||
if(response.TrmTsk)
|
||||
sb.AppendLine("Device supports TERMINATE TASK command");
|
||||
if (response.NormACA)
|
||||
if(response.NormACA)
|
||||
sb.AppendLine("Device supports setting Normal ACA");
|
||||
if (response.HiSup)
|
||||
if(response.HiSup)
|
||||
sb.AppendLine("Device supports LUN hierarchical addressing");
|
||||
if (response.SCCS)
|
||||
if(response.SCCS)
|
||||
sb.AppendLine("Device contains an embedded storage array controller");
|
||||
if (response.ACC)
|
||||
if(response.ACC)
|
||||
sb.AppendLine("Device contains an Access Control Coordinator");
|
||||
if (response.ThreePC)
|
||||
if(response.ThreePC)
|
||||
sb.AppendLine("Device supports third-party copy commands");
|
||||
if (response.Protect)
|
||||
if(response.Protect)
|
||||
sb.AppendLine("Device supports protection information");
|
||||
if (response.BQue)
|
||||
if(response.BQue)
|
||||
sb.AppendLine("Device supports basic queueing");
|
||||
if (response.EncServ)
|
||||
if(response.EncServ)
|
||||
sb.AppendLine("Device contains an embedded enclosure services component");
|
||||
if (response.MultiP)
|
||||
if(response.MultiP)
|
||||
sb.AppendLine("Multi-port device");
|
||||
if (response.MChngr)
|
||||
if(response.MChngr)
|
||||
sb.AppendLine("Device contains or is attached to a medium changer");
|
||||
if (response.ACKREQQ)
|
||||
if(response.ACKREQQ)
|
||||
sb.AppendLine("Device supports request and acknowledge handshakes");
|
||||
if (response.Addr32)
|
||||
if(response.Addr32)
|
||||
sb.AppendLine("Device supports 32-bit wide SCSI addresses");
|
||||
if (response.Addr16)
|
||||
if(response.Addr16)
|
||||
sb.AppendLine("Device supports 16-bit wide SCSI addresses");
|
||||
if (response.RelAddr)
|
||||
if(response.RelAddr)
|
||||
sb.AppendLine("Device supports relative addressing");
|
||||
if (response.WBus32)
|
||||
if(response.WBus32)
|
||||
sb.AppendLine("Device supports 32-bit wide data transfers");
|
||||
if (response.WBus16)
|
||||
if(response.WBus16)
|
||||
sb.AppendLine("Device supports 16-bit wide data transfers");
|
||||
if (response.Sync)
|
||||
if(response.Sync)
|
||||
sb.AppendLine("Device supports synchronous data transfer");
|
||||
if (response.Linked)
|
||||
if(response.Linked)
|
||||
sb.AppendLine("Device supports linked commands");
|
||||
if (response.TranDis)
|
||||
if(response.TranDis)
|
||||
sb.AppendLine("Device supports CONTINUE TASK and TARGET TRANSFER DISABLE commands");
|
||||
if (response.QAS)
|
||||
if(response.QAS)
|
||||
sb.AppendLine("Device supports Quick Arbitration and Selection");
|
||||
if (response.CmdQue)
|
||||
if(response.CmdQue)
|
||||
sb.AppendLine("Device supports TCQ queue");
|
||||
if (response.IUS)
|
||||
if(response.IUS)
|
||||
sb.AppendLine("Device supports information unit transfers");
|
||||
if (response.SftRe)
|
||||
if(response.SftRe)
|
||||
sb.AppendLine("Device implements RESET as a soft reset");
|
||||
#if DEBUG
|
||||
if (response.VS1)
|
||||
#if DEBUG
|
||||
if(response.VS1)
|
||||
sb.AppendLine("Vendor specific bit 5 on byte 6 of INQUIRY response is set");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch ((TGPSValues)response.TPGS)
|
||||
switch((TGPSValues)response.TPGS)
|
||||
{
|
||||
case TGPSValues.NotSupported:
|
||||
sb.AppendLine("Device does not support assymetrical access");
|
||||
@@ -432,7 +432,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
switch ((SPIClocking)response.Clocking)
|
||||
switch((SPIClocking)response.Clocking)
|
||||
{
|
||||
case SPIClocking.ST:
|
||||
sb.AppendLine("Device supports only ST clocking");
|
||||
@@ -451,11 +451,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
if (response.VersionDescriptors != null)
|
||||
if(response.VersionDescriptors != null)
|
||||
{
|
||||
foreach (UInt16 VersionDescriptor in response.VersionDescriptors)
|
||||
foreach(UInt16 VersionDescriptor in response.VersionDescriptors)
|
||||
{
|
||||
switch (VersionDescriptor)
|
||||
switch(VersionDescriptor)
|
||||
{
|
||||
case 0xFFFF:
|
||||
case 0x0000:
|
||||
@@ -1871,7 +1871,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.DeviceTypeModifier != 0)
|
||||
sb.AppendFormat("Vendor's device type modifier = 0x{0:X2}", response.DeviceTypeModifier).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
@@ -1881,7 +1881,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(response.Reserved4 != 0)
|
||||
sb.AppendFormat("Reserved byte 57 = 0x{0:X2}", response.Reserved4).AppendLine();
|
||||
|
||||
if (response.Reserved5 != null)
|
||||
if(response.Reserved5 != null)
|
||||
{
|
||||
sb.AppendLine("Reserved bytes 74 to 95");
|
||||
sb.AppendLine("============================================================");
|
||||
@@ -1889,7 +1889,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendLine("============================================================");
|
||||
}
|
||||
|
||||
if (response.VendorSpecific != null)
|
||||
if(response.VendorSpecific != null)
|
||||
{
|
||||
sb.AppendLine("Vendor-specific bytes 36 to 55");
|
||||
sb.AppendLine("============================================================");
|
||||
@@ -1897,14 +1897,14 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendLine("============================================================");
|
||||
}
|
||||
|
||||
if (response.VendorSpecific2 != null)
|
||||
if(response.VendorSpecific2 != null)
|
||||
{
|
||||
sb.AppendFormat("Vendor-specific bytes 96 to {0}", response.AdditionalLength+4).AppendLine();
|
||||
sb.AppendFormat("Vendor-specific bytes 96 to {0}", response.AdditionalLength + 4).AppendLine();
|
||||
sb.AppendLine("============================================================");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VendorSpecific2, 60));
|
||||
sb.AppendLine("============================================================");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static AACSVolumeIdentifier? DecodeAACSVolumeIdentifier(byte[] AACSVIResponse)
|
||||
{
|
||||
if (AACSVIResponse == null)
|
||||
if(AACSVIResponse == null)
|
||||
return null;
|
||||
|
||||
AACSVolumeIdentifier decoded = new AACSVolumeIdentifier();
|
||||
@@ -242,19 +242,19 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyAACSVolumeIdentifier(AACSVolumeIdentifier? AACSVIResponse)
|
||||
{
|
||||
if (AACSVIResponse == null)
|
||||
if(AACSVIResponse == null)
|
||||
return null;
|
||||
|
||||
AACSVolumeIdentifier response = AACSVIResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
sb.AppendFormat("AACS Volume Identifier in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VolumeIdentifier, 80));
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static AACSMediaSerialNumber? DecodeAACSMediaSerialNumber(byte[] AACSMSNResponse)
|
||||
{
|
||||
if (AACSMSNResponse == null)
|
||||
if(AACSMSNResponse == null)
|
||||
return null;
|
||||
|
||||
AACSMediaSerialNumber decoded = new AACSMediaSerialNumber();
|
||||
@@ -288,19 +288,19 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyAACSMediaSerialNumber(AACSMediaSerialNumber? AACSMSNResponse)
|
||||
{
|
||||
if (AACSMSNResponse == null)
|
||||
if(AACSMSNResponse == null)
|
||||
return null;
|
||||
|
||||
AACSMediaSerialNumber response = AACSMSNResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
sb.AppendFormat("AACS Media Serial Number in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaSerialNumber, 80));
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static AACSMediaIdentifier? DecodeAACSMediaIdentifier(byte[] AACSMIResponse)
|
||||
{
|
||||
if (AACSMIResponse == null)
|
||||
if(AACSMIResponse == null)
|
||||
return null;
|
||||
|
||||
AACSMediaIdentifier decoded = new AACSMediaIdentifier();
|
||||
@@ -334,19 +334,19 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyAACSMediaIdentifier(AACSMediaIdentifier? AACSMIResponse)
|
||||
{
|
||||
if (AACSMIResponse == null)
|
||||
if(AACSMIResponse == null)
|
||||
return null;
|
||||
|
||||
AACSMediaIdentifier response = AACSMIResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
sb.AppendFormat("AACS Media Identifier in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaIdentifier, 80));
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static AACSMediaKeyBlock? DecodeAACSMediaKeyBlock(byte[] AACSMKBResponse)
|
||||
{
|
||||
if (AACSMKBResponse == null)
|
||||
if(AACSMKBResponse == null)
|
||||
return null;
|
||||
|
||||
AACSMediaKeyBlock decoded = new AACSMediaKeyBlock();
|
||||
@@ -380,17 +380,17 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyAACSMediaKeyBlock(AACSMediaKeyBlock? AACSMKBResponse)
|
||||
{
|
||||
if (AACSMKBResponse == null)
|
||||
if(AACSMKBResponse == null)
|
||||
return null;
|
||||
|
||||
AACSMediaKeyBlock response = AACSMKBResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved != 0)
|
||||
sb.AppendFormat("Reserved = 0x{0:X2}", response.Reserved).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
sb.AppendFormat("Total number of media key blocks available to transfer {0}", response.TotalPacks).AppendLine();
|
||||
sb.AppendFormat("AACS Media Key Blocks in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaKeyBlockPacks, 80));
|
||||
@@ -406,7 +406,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static AACSDataKeys? DecodeAACSDataKeys(byte[] AACSDKResponse)
|
||||
{
|
||||
if (AACSDKResponse == null)
|
||||
if(AACSDKResponse == null)
|
||||
return null;
|
||||
|
||||
AACSDataKeys decoded = new AACSDataKeys();
|
||||
@@ -425,19 +425,19 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyAACSDataKeys(AACSDataKeys? AACSDKResponse)
|
||||
{
|
||||
if (AACSDKResponse == null)
|
||||
if(AACSDKResponse == null)
|
||||
return null;
|
||||
|
||||
AACSDataKeys response = AACSDKResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
sb.AppendFormat("AACS Data Keys in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.DataKeys, 80));
|
||||
|
||||
@@ -452,7 +452,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static AACSLBAExtentsResponse? DecodeAACSLBAExtents(byte[] AACSLBAExtsResponse)
|
||||
{
|
||||
if (AACSLBAExtsResponse == null)
|
||||
if(AACSLBAExtsResponse == null)
|
||||
return null;
|
||||
|
||||
AACSLBAExtentsResponse decoded = new AACSLBAExtentsResponse();
|
||||
@@ -463,12 +463,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
decoded.Reserved = AACSLBAExtsResponse[2];
|
||||
decoded.MaxLBAExtents = AACSLBAExtsResponse[3];
|
||||
|
||||
if ((AACSLBAExtsResponse.Length - 4) % 16 != 0)
|
||||
if((AACSLBAExtsResponse.Length - 4) % 16 != 0)
|
||||
return decoded;
|
||||
|
||||
decoded.Extents = new AACSLBAExtent[(AACSLBAExtsResponse.Length - 4) / 16];
|
||||
|
||||
for (int i = 0; i < (AACSLBAExtsResponse.Length - 4) / 16; i++)
|
||||
for(int i = 0; i < (AACSLBAExtsResponse.Length - 4) / 16; i++)
|
||||
{
|
||||
decoded.Extents[i].Reserved = new byte[8];
|
||||
Array.Copy(AACSLBAExtsResponse, 0 + i * 16 + 4, decoded.Extents[i].Reserved, 0, 8);
|
||||
@@ -481,16 +481,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyAACSLBAExtents(AACSLBAExtentsResponse? AACSLBAExtsResponse)
|
||||
{
|
||||
if (AACSLBAExtsResponse == null)
|
||||
if(AACSLBAExtsResponse == null)
|
||||
return null;
|
||||
|
||||
AACSLBAExtentsResponse response = AACSLBAExtsResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (response.MaxLBAExtents == 0)
|
||||
if(response.MaxLBAExtents == 0)
|
||||
{
|
||||
if (response.DataLength > 2)
|
||||
if(response.DataLength > 2)
|
||||
sb.AppendLine("Drive can store 256 LBA Extents");
|
||||
else
|
||||
sb.AppendLine("Drive cannot store LBA Extents");
|
||||
@@ -498,7 +498,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
else
|
||||
sb.AppendFormat("Drive can store {0} LBA Extents", response.MaxLBAExtents).AppendLine();
|
||||
|
||||
for (int i = 0; i < response.Extents.Length; i++)
|
||||
for(int i = 0; i < response.Extents.Length; i++)
|
||||
sb.AppendFormat("LBA Extent {0} starts at LBA {1} and goes for {2} sectors", i, response.Extents[i].StartLBA, response.Extents[i].LBACount);
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static CPRMMediaKeyBlock? DecodeCPRMMediaKeyBlock(byte[] CPRMMKBResponse)
|
||||
{
|
||||
if (CPRMMKBResponse == null)
|
||||
if(CPRMMKBResponse == null)
|
||||
return null;
|
||||
|
||||
CPRMMediaKeyBlock decoded = new CPRMMediaKeyBlock();
|
||||
@@ -102,17 +102,17 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyCPRMMediaKeyBlock(CPRMMediaKeyBlock? CPRMMKBResponse)
|
||||
{
|
||||
if (CPRMMKBResponse == null)
|
||||
if(CPRMMKBResponse == null)
|
||||
return null;
|
||||
|
||||
CPRMMediaKeyBlock response = CPRMMKBResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved != 0)
|
||||
sb.AppendFormat("Reserved = 0x{0:X2}", response.Reserved).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
sb.AppendFormat("Total number of CPRM Media Key Blocks available to transfer: {0}", response.TotalPacks).AppendLine();
|
||||
sb.AppendFormat("CPRM Media Key Blocks in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MKBPackData, 80));
|
||||
|
||||
@@ -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,10 +324,10 @@ 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];
|
||||
@@ -340,17 +340,17 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
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,7 +414,7 @@ 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();
|
||||
@@ -430,21 +430,21 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
(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));
|
||||
|
||||
1044
SCSI/MMC/Features.cs
1044
SCSI/MMC/Features.cs
File diff suppressed because it is too large
Load Diff
@@ -108,10 +108,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static RecognizedFormatLayers? DecodeFormatLayers(byte[] FormatLayersResponse)
|
||||
{
|
||||
if (FormatLayersResponse == null)
|
||||
if(FormatLayersResponse == null)
|
||||
return null;
|
||||
|
||||
if (FormatLayersResponse.Length < 8)
|
||||
if(FormatLayersResponse.Length < 8)
|
||||
return null;
|
||||
|
||||
RecognizedFormatLayers decoded = new RecognizedFormatLayers();
|
||||
@@ -129,7 +129,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
decoded.FormatLayers = new UInt16[(FormatLayersResponse.Length - 6) / 2];
|
||||
|
||||
for (int i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++)
|
||||
for(int i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++)
|
||||
{
|
||||
decoded.FormatLayers[i] = BigEndianBitConverter.ToUInt16(FormatLayersResponse, i * 2 + 6);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyFormatLayers(RecognizedFormatLayers? FormatLayersResponse)
|
||||
{
|
||||
if (FormatLayersResponse == null)
|
||||
if(FormatLayersResponse == null)
|
||||
return null;
|
||||
|
||||
RecognizedFormatLayers response = FormatLayersResponse.Value;
|
||||
@@ -148,52 +148,52 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
sb.AppendFormat("{0} format layers recognized", response.NumberOfLayers);
|
||||
|
||||
for (int i = 0; i < response.FormatLayers.Length; i++)
|
||||
for(int i = 0; i < response.FormatLayers.Length; i++)
|
||||
{
|
||||
switch (response.FormatLayers[i])
|
||||
switch(response.FormatLayers[i])
|
||||
{
|
||||
case (UInt16)FormatLayerTypeCodes.BDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type Blu-ray", i).AppendLine();
|
||||
if (response.DefaultFormatLayer == i)
|
||||
if(response.DefaultFormatLayer == i)
|
||||
sb.AppendLine("This is the default layer.");
|
||||
if (response.OnlineFormatLayer == i)
|
||||
if(response.OnlineFormatLayer == i)
|
||||
sb.AppendLine("This is the layer actually in use.");
|
||||
break;
|
||||
}
|
||||
case (UInt16)FormatLayerTypeCodes.CDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type CD", i).AppendLine();
|
||||
if (response.DefaultFormatLayer == i)
|
||||
if(response.DefaultFormatLayer == i)
|
||||
sb.AppendLine("This is the default layer.");
|
||||
if (response.OnlineFormatLayer == i)
|
||||
if(response.OnlineFormatLayer == i)
|
||||
sb.AppendLine("This is the layer actually in use.");
|
||||
break;
|
||||
}
|
||||
case (UInt16)FormatLayerTypeCodes.DVDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type DVD", i).AppendLine();
|
||||
if (response.DefaultFormatLayer == i)
|
||||
if(response.DefaultFormatLayer == i)
|
||||
sb.AppendLine("This is the default layer.");
|
||||
if (response.OnlineFormatLayer == i)
|
||||
if(response.OnlineFormatLayer == i)
|
||||
sb.AppendLine("This is the layer actually in use.");
|
||||
break;
|
||||
}
|
||||
case (UInt16)FormatLayerTypeCodes.HDDVDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type HD DVD", i).AppendLine();
|
||||
if (response.DefaultFormatLayer == i)
|
||||
if(response.DefaultFormatLayer == i)
|
||||
sb.AppendLine("This is the default layer.");
|
||||
if (response.OnlineFormatLayer == i)
|
||||
if(response.OnlineFormatLayer == i)
|
||||
sb.AppendLine("This is the layer actually in use.");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of unknown type 0x{1:X4}", i, response.FormatLayers[i]).AppendLine();
|
||||
if (response.DefaultFormatLayer == i)
|
||||
if(response.DefaultFormatLayer == i)
|
||||
sb.AppendLine("This is the default layer.");
|
||||
if (response.OnlineFormatLayer == i)
|
||||
if(response.OnlineFormatLayer == i)
|
||||
sb.AppendLine("This is the layer actually in use.");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static WriteProtectionStatus? DecodeWriteProtectionStatus(byte[] WPSResponse)
|
||||
{
|
||||
if (WPSResponse == null)
|
||||
if(WPSResponse == null)
|
||||
return null;
|
||||
|
||||
WriteProtectionStatus decoded = new WriteProtectionStatus();
|
||||
@@ -142,23 +142,23 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static string PrettifyWriteProtectionStatus(WriteProtectionStatus? WPSResponse)
|
||||
{
|
||||
if (WPSResponse == null)
|
||||
if(WPSResponse == null)
|
||||
return null;
|
||||
|
||||
WriteProtectionStatus response = WPSResponse.Value;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (response.MSWI)
|
||||
if(response.MSWI)
|
||||
sb.AppendLine("Writing inhibited by media specific reason");
|
||||
if (response.CWP)
|
||||
if(response.CWP)
|
||||
sb.AppendLine("Cartridge sets write protection");
|
||||
if (response.PWP)
|
||||
if(response.PWP)
|
||||
sb.AppendLine("Media surface sets write protection");
|
||||
if (response.SWPP)
|
||||
if(response.SWPP)
|
||||
sb.AppendLine("Software write protection is set until power down");
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
@@ -171,7 +171,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
sb.AppendFormat("Reserved5 = 0x{0:X2}", response.Reserved5).AppendLine();
|
||||
if(response.Reserved6 != 0)
|
||||
sb.AppendFormat("Reserved6 = 0x{0:X2}", response.Reserved6).AppendLine();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
1230
SCSI/Modes.cs
1230
SCSI/Modes.cs
File diff suppressed because it is too large
Load Diff
@@ -45,47 +45,47 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
byte[] hdr;
|
||||
|
||||
if (header.BlockDescriptors != null)
|
||||
if(header.BlockDescriptors != null)
|
||||
hdr = new byte[4 + header.BlockDescriptors.Length * 8];
|
||||
else
|
||||
hdr = new byte[4];
|
||||
|
||||
hdr[1] = (byte)header.MediumType;
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
if (header.WriteProtected)
|
||||
if(header.WriteProtected)
|
||||
hdr[2] += 0x80;
|
||||
if (header.DPOFUA)
|
||||
if(header.DPOFUA)
|
||||
hdr[2] += 0x10;
|
||||
}
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.SequentialAccess)
|
||||
if(deviceType == PeripheralDeviceTypes.SequentialAccess)
|
||||
{
|
||||
if (header.WriteProtected)
|
||||
if(header.WriteProtected)
|
||||
hdr[2] += 0x80;
|
||||
hdr[2] += (byte)(header.Speed & 0x0F);
|
||||
hdr[2] += (byte)((header.BufferedMode << 4) & 0x70);
|
||||
}
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.PrinterDevice)
|
||||
if(deviceType == PeripheralDeviceTypes.PrinterDevice)
|
||||
hdr[2] += (byte)((header.BufferedMode << 4) & 0x70);
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.OpticalDevice)
|
||||
if(deviceType == PeripheralDeviceTypes.OpticalDevice)
|
||||
{
|
||||
if (header.WriteProtected)
|
||||
if(header.WriteProtected)
|
||||
hdr[2] += 0x80;
|
||||
if (header.EBC)
|
||||
if(header.EBC)
|
||||
hdr[2] += 0x01;
|
||||
if (header.DPOFUA)
|
||||
if(header.DPOFUA)
|
||||
hdr[2] += 0x10;
|
||||
}
|
||||
|
||||
if (header.BlockDescriptors != null)
|
||||
if(header.BlockDescriptors != null)
|
||||
{
|
||||
hdr[3] = (byte)(header.BlockDescriptors.Length * 8);
|
||||
|
||||
for (int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
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);
|
||||
@@ -103,9 +103,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
public static byte[] EncodeMode6(DecodedMode mode, PeripheralDeviceTypes deviceType)
|
||||
{
|
||||
int modeSize = 0;
|
||||
if (mode.Pages != null)
|
||||
if(mode.Pages != null)
|
||||
{
|
||||
foreach (ModePage page in mode.Pages)
|
||||
foreach(ModePage page in mode.Pages)
|
||||
modeSize += page.PageResponse.Length;
|
||||
}
|
||||
|
||||
@@ -115,10 +115,10 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
Array.Copy(hdr, 0, md, 0, hdr.Length);
|
||||
|
||||
if (mode.Pages != null)
|
||||
if(mode.Pages != null)
|
||||
{
|
||||
int offset = hdr.Length;
|
||||
foreach (ModePage page in mode.Pages)
|
||||
foreach(ModePage page in mode.Pages)
|
||||
{
|
||||
Array.Copy(page.PageResponse, 0, md, offset, page.PageResponse.Length);
|
||||
offset += page.PageResponse.Length;
|
||||
@@ -132,9 +132,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
public static byte[] EncodeMode10(DecodedMode mode, PeripheralDeviceTypes deviceType)
|
||||
{
|
||||
int modeSize = 0;
|
||||
if (mode.Pages != null)
|
||||
if(mode.Pages != null)
|
||||
{
|
||||
foreach (ModePage page in mode.Pages)
|
||||
foreach(ModePage page in mode.Pages)
|
||||
modeSize += page.PageResponse.Length;
|
||||
}
|
||||
|
||||
@@ -144,10 +144,10 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
Array.Copy(hdr, 0, md, 0, hdr.Length);
|
||||
|
||||
if (mode.Pages != null)
|
||||
if(mode.Pages != null)
|
||||
{
|
||||
int offset = hdr.Length;
|
||||
foreach (ModePage page in mode.Pages)
|
||||
foreach(ModePage page in mode.Pages)
|
||||
{
|
||||
Array.Copy(page.PageResponse, 0, md, offset, page.PageResponse.Length);
|
||||
offset += page.PageResponse.Length;
|
||||
@@ -166,9 +166,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
byte[] hdr;
|
||||
|
||||
if (header.BlockDescriptors != null)
|
||||
if(header.BlockDescriptors != null)
|
||||
{
|
||||
if (longLBA)
|
||||
if(longLBA)
|
||||
hdr = new byte[8 + header.BlockDescriptors.Length * 16];
|
||||
else
|
||||
hdr = new byte[8 + header.BlockDescriptors.Length * 8];
|
||||
@@ -178,43 +178,43 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
hdr[2] = (byte)header.MediumType;
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
if (header.WriteProtected)
|
||||
if(header.WriteProtected)
|
||||
hdr[3] += 0x80;
|
||||
if (header.DPOFUA)
|
||||
if(header.DPOFUA)
|
||||
hdr[3] += 0x10;
|
||||
}
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.SequentialAccess)
|
||||
if(deviceType == PeripheralDeviceTypes.SequentialAccess)
|
||||
{
|
||||
if (header.WriteProtected)
|
||||
if(header.WriteProtected)
|
||||
hdr[3] += 0x80;
|
||||
hdr[3] += (byte)(header.Speed & 0x0F);
|
||||
hdr[3] += (byte)((header.BufferedMode << 4) & 0x70);
|
||||
}
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.PrinterDevice)
|
||||
if(deviceType == PeripheralDeviceTypes.PrinterDevice)
|
||||
hdr[3] += (byte)((header.BufferedMode << 4) & 0x70);
|
||||
|
||||
if (deviceType == PeripheralDeviceTypes.OpticalDevice)
|
||||
if(deviceType == PeripheralDeviceTypes.OpticalDevice)
|
||||
{
|
||||
if (header.WriteProtected)
|
||||
if(header.WriteProtected)
|
||||
hdr[3] += 0x80;
|
||||
if (header.EBC)
|
||||
if(header.EBC)
|
||||
hdr[3] += 0x01;
|
||||
if (header.DPOFUA)
|
||||
if(header.DPOFUA)
|
||||
hdr[3] += 0x10;
|
||||
}
|
||||
|
||||
if (longLBA)
|
||||
if(longLBA)
|
||||
hdr[4] += 0x01;
|
||||
|
||||
if (header.BlockDescriptors != null)
|
||||
if(header.BlockDescriptors != null)
|
||||
{
|
||||
if (longLBA)
|
||||
if(longLBA)
|
||||
{
|
||||
for (int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
byte[] temp = BitConverter.GetBytes(header.BlockDescriptors[i].Blocks);
|
||||
hdr[7 + i * 16 + 8] = temp[0];
|
||||
@@ -233,9 +233,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
if (deviceType != PeripheralDeviceTypes.DirectAccess)
|
||||
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);
|
||||
@@ -259,23 +259,23 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
pg[0] = 0x01;
|
||||
pg[1] = 6;
|
||||
|
||||
if (page.PS)
|
||||
if(page.PS)
|
||||
pg[0] += 0x80;
|
||||
if (page.AWRE)
|
||||
if(page.AWRE)
|
||||
pg[2] += 0x80;
|
||||
if (page.ARRE)
|
||||
if(page.ARRE)
|
||||
pg[2] += 0x40;
|
||||
if (page.TB)
|
||||
if(page.TB)
|
||||
pg[2] += 0x20;
|
||||
if (page.RC)
|
||||
if(page.RC)
|
||||
pg[2] += 0x10;
|
||||
if (page.EER)
|
||||
if(page.EER)
|
||||
pg[2] += 0x08;
|
||||
if (page.PER)
|
||||
if(page.PER)
|
||||
pg[2] += 0x04;
|
||||
if (page.DTE)
|
||||
if(page.DTE)
|
||||
pg[2] += 0x02;
|
||||
if (page.DCR)
|
||||
if(page.DCR)
|
||||
pg[2] += 0x01;
|
||||
|
||||
pg[3] = page.ReadRetryCount;
|
||||
@@ -301,7 +301,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
pg[0] = 0x01;
|
||||
pg[1] = 10;
|
||||
|
||||
if (page.PS)
|
||||
if(page.PS)
|
||||
pg[0] += 0x80;
|
||||
pg[2] = page.Parameter;
|
||||
pg[3] = page.ReadRetryCount;
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
public static BlockLimitsData? Decode(byte[] response)
|
||||
{
|
||||
if (response == null)
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length != 6)
|
||||
if(response.Length != 6)
|
||||
return null;
|
||||
|
||||
BlockLimitsData dec = new BlockLimitsData();
|
||||
@@ -77,22 +77,22 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
public static string Prettify(BlockLimitsData? decoded)
|
||||
{
|
||||
if (decoded == null)
|
||||
if(decoded == null)
|
||||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (decoded.Value.maxBlockLen == decoded.Value.minBlockLen)
|
||||
if(decoded.Value.maxBlockLen == decoded.Value.minBlockLen)
|
||||
sb.AppendFormat("Device's block size is fixed at {0} bytes", decoded.Value.minBlockLen).AppendLine();
|
||||
else
|
||||
{
|
||||
if (decoded.Value.maxBlockLen > 0)
|
||||
if(decoded.Value.maxBlockLen > 0)
|
||||
sb.AppendFormat("Device's maximum block size is {0} bytes", decoded.Value.maxBlockLen).AppendLine();
|
||||
else
|
||||
sb.AppendLine("Device does not specify a maximum block size");
|
||||
sb.AppendFormat("Device's minimum block size is {0} bytes", decoded.Value.minBlockLen).AppendLine();
|
||||
|
||||
if (decoded.Value.granularity > 0)
|
||||
if(decoded.Value.granularity > 0)
|
||||
sb.AppendFormat("Device's needs a block size granularity of 2^{0} ({1}) bytes", decoded.Value.granularity, Math.Pow(2, (double)decoded.Value.granularity)).AppendLine();
|
||||
}
|
||||
|
||||
|
||||
@@ -94,22 +94,22 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
public static DensitySupportHeader? DecodeDensity(byte[] response)
|
||||
{
|
||||
if (response == null)
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length <= 56)
|
||||
if(response.Length <= 56)
|
||||
return null;
|
||||
|
||||
ushort responseLen = (ushort)((response[0] << 8) + response[1] + 2);
|
||||
|
||||
if (response.Length != responseLen)
|
||||
if(response.Length != responseLen)
|
||||
return null;
|
||||
|
||||
List<DensitySupportDescriptor> descriptors = new List<DensitySupportDescriptor>();
|
||||
int offset = 4;
|
||||
byte[] tmp;
|
||||
|
||||
while (offset < response.Length)
|
||||
while(offset < response.Length)
|
||||
{
|
||||
DensitySupportDescriptor descriptor = new DensitySupportDescriptor();
|
||||
descriptor.primaryCode = response[offset + 0];
|
||||
@@ -134,7 +134,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
Array.Copy(response, offset + 32, tmp, 0, 20);
|
||||
descriptor.description = StringHandlers.CToString(tmp).Trim();
|
||||
|
||||
if (descriptor.lenvalid)
|
||||
if(descriptor.lenvalid)
|
||||
offset += descriptor.len + 5;
|
||||
else
|
||||
offset += 52;
|
||||
@@ -152,23 +152,23 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
public static string PrettifyDensity(DensitySupportHeader? density)
|
||||
{
|
||||
if (density == null)
|
||||
if(density == null)
|
||||
return null;
|
||||
|
||||
DensitySupportHeader decoded = density.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (DensitySupportDescriptor descriptor in decoded.descriptors)
|
||||
foreach(DensitySupportDescriptor descriptor in decoded.descriptors)
|
||||
{
|
||||
sb.AppendFormat("Density \"{0}\" defined by \"{1}\".", descriptor.name, descriptor.organization).AppendLine();
|
||||
sb.AppendFormat("\tPrimary code: {0:X2}h", descriptor.primaryCode).AppendLine();
|
||||
if(descriptor.primaryCode != descriptor.secondaryCode)
|
||||
sb.AppendFormat("\tSecondary code: {0:X2}h", descriptor.secondaryCode).AppendLine();
|
||||
if (descriptor.writable)
|
||||
if(descriptor.writable)
|
||||
sb.AppendLine("\tDrive can write this density");
|
||||
if (descriptor.duplicate)
|
||||
if(descriptor.duplicate)
|
||||
sb.AppendLine("\tThis descriptor is duplicated");
|
||||
if (descriptor.defaultDensity)
|
||||
if(descriptor.defaultDensity)
|
||||
sb.AppendLine("\tThis is the default density on the drive");
|
||||
sb.AppendFormat("\tDensity has {0} bits per mm, with {1} tracks in a {2} mm width tape",
|
||||
descriptor.bpmm, descriptor.tracks, (double)((double)descriptor.width / (double)10)).AppendLine();
|
||||
@@ -187,28 +187,28 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
public static MediaTypeSupportHeader? DecodeMediumType(byte[] response)
|
||||
{
|
||||
if (response == null)
|
||||
if(response == null)
|
||||
return null;
|
||||
|
||||
if (response.Length <= 60)
|
||||
if(response.Length <= 60)
|
||||
return null;
|
||||
|
||||
ushort responseLen = (ushort)((response[0] << 8) + response[1] + 2);
|
||||
|
||||
if (response.Length != responseLen)
|
||||
if(response.Length != responseLen)
|
||||
return null;
|
||||
|
||||
List<MediaTypeSupportDescriptor> descriptors = new List<MediaTypeSupportDescriptor>();
|
||||
int offset = 4;
|
||||
byte[] tmp;
|
||||
|
||||
while (offset < response.Length)
|
||||
while(offset < response.Length)
|
||||
{
|
||||
MediaTypeSupportDescriptor descriptor = new MediaTypeSupportDescriptor();
|
||||
descriptor.mediumType = response[offset + 0];
|
||||
descriptor.reserved1 = response[offset + 1];
|
||||
descriptor.len = (ushort)((response[offset + 2] << 8) + response[offset + 3]);
|
||||
if (descriptor.len != 52)
|
||||
if(descriptor.len != 52)
|
||||
return null;
|
||||
descriptor.numberOfCodes = response[offset + 4];
|
||||
descriptor.densityCodes = new byte[9];
|
||||
@@ -242,20 +242,20 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
public static string PrettifyMediumType(MediaTypeSupportHeader? mediumType)
|
||||
{
|
||||
if (mediumType == null)
|
||||
if(mediumType == null)
|
||||
return null;
|
||||
|
||||
MediaTypeSupportHeader decoded = mediumType.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (MediaTypeSupportDescriptor descriptor in decoded.descriptors)
|
||||
foreach(MediaTypeSupportDescriptor descriptor in decoded.descriptors)
|
||||
{
|
||||
sb.AppendFormat("Medium type \"{0}\" defined by \"{1}\".", descriptor.name, descriptor.organization).AppendLine();
|
||||
sb.AppendFormat("\tMedium type code: {0:X2}h", descriptor.mediumType).AppendLine();
|
||||
if (descriptor.numberOfCodes > 0)
|
||||
if(descriptor.numberOfCodes > 0)
|
||||
{
|
||||
sb.AppendFormat("\tMedium supports following density codes:");
|
||||
for (int i = 0; i < descriptor.numberOfCodes; i++)
|
||||
for(int i = 0; i < descriptor.numberOfCodes; i++)
|
||||
sb.AppendFormat(" {0:X2}h", descriptor.densityCodes[i]);
|
||||
sb.AppendLine();
|
||||
}
|
||||
|
||||
290
SCSI/Sense.cs
290
SCSI/Sense.cs
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
public static string Prettify(string SCSIVendorString)
|
||||
{
|
||||
switch (SCSIVendorString)
|
||||
switch(SCSIVendorString)
|
||||
{
|
||||
case "0B4C":
|
||||
return "MOOSIK Ltd.";
|
||||
|
||||
32
Xbox/DMI.cs
32
Xbox/DMI.cs
@@ -44,9 +44,9 @@ namespace DiscImageChef.Decoders.Xbox
|
||||
{
|
||||
public static bool IsXbox(byte[] dmi)
|
||||
{
|
||||
if (dmi == null)
|
||||
if(dmi == null)
|
||||
return false;
|
||||
if (dmi.Length != 2052)
|
||||
if(dmi.Length != 2052)
|
||||
return false;
|
||||
|
||||
// TODO: Need to implement it
|
||||
@@ -55,9 +55,9 @@ namespace DiscImageChef.Decoders.Xbox
|
||||
|
||||
public static bool IsXbox360(byte[] dmi)
|
||||
{
|
||||
if (dmi == null)
|
||||
if(dmi == null)
|
||||
return false;
|
||||
if (dmi.Length != 2052)
|
||||
if(dmi.Length != 2052)
|
||||
return false;
|
||||
|
||||
uint signature = BitConverter.ToUInt32(dmi, 0x7EC);
|
||||
@@ -112,7 +112,7 @@ namespace DiscImageChef.Decoders.Xbox
|
||||
public static Xbox360DMI? DecodeXbox360(byte[] response)
|
||||
{
|
||||
bool isX360 = IsXbox360(response);
|
||||
if (!isX360)
|
||||
if(!isX360)
|
||||
return null;
|
||||
|
||||
Xbox360DMI dmi = new Xbox360DMI();
|
||||
@@ -129,7 +129,7 @@ namespace DiscImageChef.Decoders.Xbox
|
||||
Array.Copy(response, 68, tmp, 0, 16);
|
||||
dmi.CatalogNumber = StringHandlers.CToString(tmp);
|
||||
|
||||
if (dmi.CatalogNumber == null || dmi.CatalogNumber.Length < 13)
|
||||
if(dmi.CatalogNumber == null || dmi.CatalogNumber.Length < 13)
|
||||
return null;
|
||||
|
||||
return dmi;
|
||||
@@ -137,45 +137,45 @@ namespace DiscImageChef.Decoders.Xbox
|
||||
|
||||
public static string PrettifyXbox360(Xbox360DMI? dmi)
|
||||
{
|
||||
if (dmi == null)
|
||||
if(dmi == null)
|
||||
return null;
|
||||
|
||||
Xbox360DMI decoded = dmi.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("Catalogue number: ");
|
||||
for (int i = 0; i < 2; i++)
|
||||
for(int i = 0; i < 2; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append("-");
|
||||
for (int i = 2; i < 6; i++)
|
||||
for(int i = 2; i < 6; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append("-");
|
||||
for (int i = 6; i < 8; i++)
|
||||
for(int i = 6; i < 8; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append("-");
|
||||
|
||||
if(decoded.CatalogNumber.Length == 13)
|
||||
{
|
||||
for (int i = 8; i < 10; i++)
|
||||
for(int i = 8; i < 10; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append("-");
|
||||
for (int i = 10; i < 13; i++)
|
||||
for(int i = 10; i < 13; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
}
|
||||
else if(decoded.CatalogNumber.Length == 14)
|
||||
{
|
||||
for (int i = 8; i < 11; i++)
|
||||
for(int i = 8; i < 11; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append("-");
|
||||
for (int i = 11; i < 14; i++)
|
||||
for(int i = 11; i < 14; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 8; i < decoded.CatalogNumber.Length - 3; i++)
|
||||
for(int i = 8; i < decoded.CatalogNumber.Length - 3; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
sb.Append("-");
|
||||
for (int i = decoded.CatalogNumber.Length - 3; i < decoded.CatalogNumber.Length; i++)
|
||||
for(int i = decoded.CatalogNumber.Length - 3; i < decoded.CatalogNumber.Length; i++)
|
||||
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
|
||||
}
|
||||
sb.AppendLine();
|
||||
|
||||
Reference in New Issue
Block a user