From 7a9b2a7dd573a0fa548be1684879b12118f969ad Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Tue, 19 Apr 2016 02:11:47 +0100 Subject: [PATCH] Reformatted. --- ATA/Identify.cs | 718 ++++++++-------- Blu-ray/BCA.cs | 10 +- Blu-ray/Cartridge.cs | 28 +- Blu-ray/DDS.cs | 10 +- Blu-ray/DI.cs | 24 +- Blu-ray/Spare.cs | 10 +- CD/ATIP.cs | 256 +++--- CD/CDTextOnLeadIn.cs | 38 +- CD/FullTOC.cs | 46 +- CD/PMA.cs | 28 +- CD/Session.cs | 20 +- CD/TOC.cs | 24 +- DVD/CSS&CPRM.cs | 28 +- DVD/Cartridge.cs | 20 +- DVD/DDS.cs | 40 +- DVD/PFI.cs | 108 +-- DVD/Spare.cs | 6 +- SCSI/DiscStructureCapabilities.cs | 4 +- SCSI/EVPD.cs | 22 +- SCSI/Inquiry.cs | 140 ++-- SCSI/MMC/AACS.cs | 54 +- SCSI/MMC/CPRM.cs | 8 +- SCSI/MMC/DiscInformation.cs | 70 +- SCSI/MMC/Features.cs | 1044 +++++++++++------------ SCSI/MMC/Hybrid.cs | 32 +- SCSI/MMC/WriteProtect.cs | 16 +- SCSI/Modes.cs | 1272 ++++++++++++++--------------- SCSI/ModesEncoders.cs | 98 +-- SCSI/SSC/BlockLimits.cs | 12 +- SCSI/SSC/DensitySupport.cs | 40 +- SCSI/Sense.cs | 294 +++---- SCSI/Types.cs | 2 +- SCSI/VendorString.cs | 2 +- Xbox/DMI.cs | 32 +- 34 files changed, 2278 insertions(+), 2278 deletions(-) diff --git a/ATA/Identify.cs b/ATA/Identify.cs index c86f16a..69f8039 100644 --- a/ATA/Identify.cs +++ b/ATA/Identify.cs @@ -58,7 +58,7 @@ namespace DiscImageChef.Decoders.ATA /// public static class Identify { - [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi, Pack=2)] + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)] public struct IdentifyDevice { /// @@ -126,7 +126,7 @@ namespace DiscImageChef.Decoders.ATA /// Words 10 to 19 /// Device serial number, right justified, padded with spaces /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] public string SerialNumber; /// /// Word 20 @@ -153,13 +153,13 @@ namespace DiscImageChef.Decoders.ATA /// Words 23 to 26 /// Firmware revision, left justified, padded with spaces /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=8)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] public string FirmwareRevision; /// /// Words 27 to 46 /// Model number, left justified, padded with spaces /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=40)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string Model; /// /// Word 47 bits 7 to 0 @@ -567,7 +567,7 @@ namespace DiscImageChef.Decoders.ATA /// Words 121 to 125 /// Reserved /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst=5)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public ushort[] ReservedWords121; /// @@ -594,7 +594,7 @@ namespace DiscImageChef.Decoders.ATA /// /// Words 129 to 159 /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst=31)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)] public ushort[] ReservedWords129; /// @@ -611,7 +611,7 @@ namespace DiscImageChef.Decoders.ATA /// Words 161 to 167 /// Reserved for CFA /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst=7)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] public ushort[] ReservedCFA; /// @@ -629,7 +629,7 @@ namespace DiscImageChef.Decoders.ATA /// Words 170 to 173 /// Additional product identifier /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=8)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] public string AdditionalPID; /// @@ -647,13 +647,13 @@ namespace DiscImageChef.Decoders.ATA /// Words 176 to 195 /// Current media serial number /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=40)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string MediaSerial; /// /// Words 196 to 205 /// Current media manufacturer /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] public string MediaManufacturer; /// @@ -767,7 +767,7 @@ namespace DiscImageChef.Decoders.ATA /// Words 224 to 229 /// Reserved for CE-ATA /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst=6)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public ushort[] ReservedCEATA224; /// @@ -790,7 +790,7 @@ namespace DiscImageChef.Decoders.ATA /// /// Words 236 to 254 /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst=19)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)] public ushort[] ReservedWords; /// @@ -1853,10 +1853,10 @@ namespace DiscImageChef.Decoders.ATA public static IdentifyDevice? Decode(byte[] IdentifyDeviceResponse) { - if (IdentifyDeviceResponse == null) + if(IdentifyDeviceResponse == null) return null; - - if (IdentifyDeviceResponse.Length != 512) + + if(IdentifyDeviceResponse.Length != 512) { DicConsole.DebugWriteLine("ATA/ATAPI IDENTIFY decoder", "IDENTIFY response is different than 512 bytes, not decoding."); return null; @@ -1870,28 +1870,28 @@ namespace DiscImageChef.Decoders.ATA ATAID.WWN = DescrambleWWN(ATAID.WWN); ATAID.WWNExtension = DescrambleWWN(ATAID.WWNExtension); - ATAID.SerialNumber = DescrambleATAString(IdentifyDeviceResponse, 10*2, 20); - ATAID.FirmwareRevision = DescrambleATAString(IdentifyDeviceResponse, 23*2, 8); - ATAID.Model = DescrambleATAString(IdentifyDeviceResponse, 27*2, 40); - ATAID.AdditionalPID = DescrambleATAString(IdentifyDeviceResponse, 170*2, 8); - ATAID.MediaSerial = DescrambleATAString(IdentifyDeviceResponse, 176*2, 40); - ATAID.MediaManufacturer = DescrambleATAString(IdentifyDeviceResponse, 196*2, 20); + ATAID.SerialNumber = DescrambleATAString(IdentifyDeviceResponse, 10 * 2, 20); + ATAID.FirmwareRevision = DescrambleATAString(IdentifyDeviceResponse, 23 * 2, 8); + ATAID.Model = DescrambleATAString(IdentifyDeviceResponse, 27 * 2, 40); + ATAID.AdditionalPID = DescrambleATAString(IdentifyDeviceResponse, 170 * 2, 8); + ATAID.MediaSerial = DescrambleATAString(IdentifyDeviceResponse, 176 * 2, 40); + ATAID.MediaManufacturer = DescrambleATAString(IdentifyDeviceResponse, 196 * 2, 20); return ATAID; } public static string Prettify(byte[] IdentifyDeviceResponse) { - if (IdentifyDeviceResponse.Length != 512) + if(IdentifyDeviceResponse.Length != 512) return null; - + IdentifyDevice? decoded = Decode(IdentifyDeviceResponse); return Prettify(decoded); } public static string Prettify(IdentifyDevice? IdentifyDeviceResponse) { - if (IdentifyDeviceResponse == null) + if(IdentifyDeviceResponse == null) return null; StringBuilder sb = new StringBuilder(); @@ -1900,14 +1900,14 @@ namespace DiscImageChef.Decoders.ATA bool cfa = false; IdentifyDevice ATAID = IdentifyDeviceResponse.Value; - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.NonMagnetic)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.NonMagnetic)) { - if ((ushort)ATAID.GeneralConfiguration != 0x848A) + if((ushort)ATAID.GeneralConfiguration != 0x848A) { //if (ATAID.CommandSet.HasFlag(CommandSetBit.Packet)) //{ - atapi = true; - cfa = false; + atapi = true; + cfa = false; //} } else @@ -1917,34 +1917,34 @@ namespace DiscImageChef.Decoders.ATA } } - if (atapi && !cfa) + if(atapi && !cfa) sb.AppendLine("ATAPI device"); - else if (!atapi && cfa) + else if(!atapi && cfa) sb.AppendLine("CompactFlash device"); else sb.AppendLine("ATA device"); - if (ATAID.Model != "") + if(ATAID.Model != "") sb.AppendFormat("Model: {0}", ATAID.Model).AppendLine(); - if (ATAID.FirmwareRevision != "") + if(ATAID.FirmwareRevision != "") sb.AppendFormat("Firmware revision: {0}", ATAID.FirmwareRevision).AppendLine(); - if (ATAID.SerialNumber != "") + if(ATAID.SerialNumber != "") sb.AppendFormat("Serial #: {0}", ATAID.SerialNumber).AppendLine(); - if (ATAID.AdditionalPID != "") + if(ATAID.AdditionalPID != "") sb.AppendFormat("Additional product ID: {0}", ATAID.AdditionalPID).AppendLine(); - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) && + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) && !ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeClear)) { - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.MediaSerial)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.MediaSerial)) { - if (ATAID.MediaManufacturer != "") + if(ATAID.MediaManufacturer != "") sb.AppendFormat("Media manufacturer: {0}", ATAID.MediaManufacturer).AppendLine(); - if (ATAID.MediaSerial != "") + if(ATAID.MediaSerial != "") sb.AppendFormat("Media serial #: {0}", ATAID.MediaSerial).AppendLine(); } - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.WWN)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.WWN)) { sb.AppendFormat("World Wide Name: {0:X16}", ATAID.WWN).AppendLine(); } @@ -1952,7 +1952,7 @@ namespace DiscImageChef.Decoders.ATA bool ata1 = false, ata2 = false, ata3 = false, ata4 = false, ata5 = false, ata6 = false, ata7 = false, acs = false, acs2 = false, acs3 = false, acs4 = false; - if ((ushort)ATAID.MajorVersion == 0x0000 || (ushort)ATAID.MajorVersion == 0xFFFF) + if((ushort)ATAID.MajorVersion == 0x0000 || (ushort)ATAID.MajorVersion == 0xFFFF) { // Obsolete in ATA-2, if present, device supports ATA-1 ata1 |= ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.FastIDE) || @@ -1961,15 +1961,15 @@ namespace DiscImageChef.Decoders.ATA ata2 |= ATAID.ExtendedIdentify.HasFlag(ExtendedIdentifyBit.Words64to70Valid); - if (!ata1 && !ata2 && !atapi && !cfa) + if(!ata1 && !ata2 && !atapi && !cfa) ata2 = true; - + ata4 |= atapi; ata3 |= cfa; - if (cfa && ata1) + if(cfa && ata1) ata1 = false; - if (cfa && ata2) + if(cfa && ata2) ata2 = false; ata5 |= ATAID.Signature == 0xA5; @@ -1992,89 +1992,89 @@ namespace DiscImageChef.Decoders.ATA int maxatalevel = 0; int minatalevel = 255; sb.Append("Supported ATA versions: "); - if (ata1) + if(ata1) { sb.Append("ATA-1 "); maxatalevel = 1; - if (minatalevel > 1) + if(minatalevel > 1) minatalevel = 1; } - if (ata2) + if(ata2) { sb.Append("ATA-2 "); maxatalevel = 2; - if (minatalevel > 2) + if(minatalevel > 2) minatalevel = 2; } - if (ata3) + if(ata3) { sb.Append("ATA-3 "); maxatalevel = 3; - if (minatalevel > 3) + if(minatalevel > 3) minatalevel = 3; } - if (ata4) + if(ata4) { sb.Append("ATA/ATAPI-4 "); maxatalevel = 4; - if (minatalevel > 4) + if(minatalevel > 4) minatalevel = 4; } - if (ata5) + if(ata5) { sb.Append("ATA/ATAPI-5 "); maxatalevel = 5; - if (minatalevel > 5) + if(minatalevel > 5) minatalevel = 5; } - if (ata6) + if(ata6) { sb.Append("ATA/ATAPI-6 "); maxatalevel = 6; - if (minatalevel > 6) + if(minatalevel > 6) minatalevel = 6; } - if (ata7) + if(ata7) { sb.Append("ATA/ATAPI-7 "); maxatalevel = 7; - if (minatalevel > 7) + if(minatalevel > 7) minatalevel = 7; } - if (acs) + if(acs) { sb.Append("ATA8-ACS "); maxatalevel = 8; - if (minatalevel > 8) + if(minatalevel > 8) minatalevel = 8; } - if (acs2) + if(acs2) { sb.Append("ATA8-ACS2 "); maxatalevel = 9; - if (minatalevel > 9) + if(minatalevel > 9) minatalevel = 9; } - if (acs3) + if(acs3) { sb.Append("ATA8-ACS3 "); maxatalevel = 10; - if (minatalevel > 10) + if(minatalevel > 10) minatalevel = 10; } - if (acs4) + if(acs4) { sb.Append("ATA8-ACS4 "); maxatalevel = 11; - if (minatalevel > 11) + if(minatalevel > 11) minatalevel = 11; } sb.AppendLine(); sb.Append("Maximum ATA revision supported: "); - if (maxatalevel >= 3) + if(maxatalevel >= 3) { - switch (ATAID.MinorVersion) + switch(ATAID.MinorVersion) { case 0x0000: case 0xFFFF: @@ -2224,31 +2224,31 @@ namespace DiscImageChef.Decoders.ATA } } - switch ((ATAID.TransportMajorVersion & 0xF000) >> 12) + switch((ATAID.TransportMajorVersion & 0xF000) >> 12) { case 0x0: sb.Append("Parallel ATA device: "); - if ((ATAID.TransportMajorVersion & 0x0002) == 0x0002) + if((ATAID.TransportMajorVersion & 0x0002) == 0x0002) sb.Append("ATA/ATAPI-7 "); - if ((ATAID.TransportMajorVersion & 0x0001) == 0x0001) + if((ATAID.TransportMajorVersion & 0x0001) == 0x0001) sb.Append("ATA8-APT "); sb.AppendLine(); break; case 0x1: sb.Append("Serial ATA device: "); - if ((ATAID.TransportMajorVersion & 0x0001) == 0x0001) + if((ATAID.TransportMajorVersion & 0x0001) == 0x0001) sb.Append("ATA8-AST "); - if ((ATAID.TransportMajorVersion & 0x0002) == 0x0002) + if((ATAID.TransportMajorVersion & 0x0002) == 0x0002) sb.Append("SATA 1.0a "); - if ((ATAID.TransportMajorVersion & 0x0004) == 0x0004) + if((ATAID.TransportMajorVersion & 0x0004) == 0x0004) sb.Append("SATA II Extensions "); - if ((ATAID.TransportMajorVersion & 0x0008) == 0x0008) + if((ATAID.TransportMajorVersion & 0x0008) == 0x0008) sb.Append("SATA 2.5 "); - if ((ATAID.TransportMajorVersion & 0x0010) == 0x0010) + if((ATAID.TransportMajorVersion & 0x0010) == 0x0010) sb.Append("SATA 2.6 "); - if ((ATAID.TransportMajorVersion & 0x0020) == 0x0020) + if((ATAID.TransportMajorVersion & 0x0020) == 0x0020) sb.Append("SATA 3.0 "); - if ((ATAID.TransportMajorVersion & 0x0040) == 0x0040) + if((ATAID.TransportMajorVersion & 0x0040) == 0x0040) sb.Append("SATA 3.1 "); sb.AppendLine(); break; @@ -2260,10 +2260,10 @@ namespace DiscImageChef.Decoders.ATA break; } - if (atapi) + if(atapi) { // Bits 12 to 8, SCSI Peripheral Device Type - switch ((SCSI.PeripheralDeviceTypes)(((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8)) + switch((SCSI.PeripheralDeviceTypes)(((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8)) { case SCSI.PeripheralDeviceTypes.DirectAccess: //0x00, sb.AppendLine("ATAPI Direct-access device"); @@ -2334,7 +2334,7 @@ namespace DiscImageChef.Decoders.ATA } // ATAPI DRQ behaviour - switch (((ushort)ATAID.GeneralConfiguration & 0x60) >> 5) + switch(((ushort)ATAID.GeneralConfiguration & 0x60) >> 5) { case 0: sb.AppendLine("Device shall set DRQ within 3 ms of receiving PACKET"); @@ -2351,7 +2351,7 @@ namespace DiscImageChef.Decoders.ATA } // ATAPI PACKET size - switch ((ushort)ATAID.GeneralConfiguration & 0x03) + switch((ushort)ATAID.GeneralConfiguration & 0x03) { case 0: sb.AppendLine("ATAPI device uses 12 byte command packet"); @@ -2364,74 +2364,74 @@ namespace DiscImageChef.Decoders.ATA break; } } - else if (!cfa) + else if(!cfa) { - if (minatalevel >= 5) + if(minatalevel >= 5) { - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.IncompleteResponse)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.IncompleteResponse)) sb.AppendLine("Incomplete identify response"); } - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.NonMagnetic)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.NonMagnetic)) sb.AppendLine("Device uses non-magnetic media"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.Removable)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.Removable)) sb.AppendLine("Device is removable"); - - if (minatalevel <= 5) + + if(minatalevel <= 5) { - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.Fixed)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.Fixed)) sb.AppendLine("Device is fixed"); } - if (ata1) + if(ata1) { - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.SlowIDE)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.SlowIDE)) sb.AppendLine("Device transfer rate is <= 5 Mb/s"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.FastIDE)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.FastIDE)) sb.AppendLine("Device transfer rate is > 5 Mb/s but <= 10 Mb/s"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.UltraFastIDE)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.UltraFastIDE)) sb.AppendLine("Device transfer rate is > 10 Mb/s"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.SoftSector)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.SoftSector)) sb.AppendLine("Device is soft sectored"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.HardSector)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.HardSector)) sb.AppendLine("Device is hard sectored"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.NotMFM)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.NotMFM)) sb.AppendLine("Device is not MFM encoded"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.FormatGapReq)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.FormatGapReq)) sb.AppendLine("Format speed tolerance gap is required"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.TrackOffset)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.TrackOffset)) sb.AppendLine("Track offset option is available"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.DataStrobeOffset)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.DataStrobeOffset)) sb.AppendLine("Data strobe offset option is available"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.RotationalSpeedTolerance)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.RotationalSpeedTolerance)) sb.AppendLine("Rotational speed tolerance is higher than 0,5%"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.SpindleControl)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.SpindleControl)) sb.AppendLine("Spindle motor control is implemented"); - if (ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.HighHeadSwitch)) + if(ATAID.GeneralConfiguration.HasFlag(GeneralConfigurationBit.HighHeadSwitch)) sb.AppendLine("Head switch time is bigger than 15 µs."); } } - if (ATAID.NominalRotationRate != 0x0000 && + if(ATAID.NominalRotationRate != 0x0000 && ATAID.NominalRotationRate != 0xFFFF) { - if (ATAID.NominalRotationRate == 0x0001) + if(ATAID.NominalRotationRate == 0x0001) sb.AppendLine("Device does not rotate."); else sb.AppendFormat("Device rotate at {0} rpm", ATAID.NominalRotationRate).AppendLine(); } uint logicalsectorsize = 0; - if (!atapi) + if(!atapi) { uint physicalsectorsize; - if ((ATAID.PhysLogSectorSize & 0x8000) == 0x0000 && + if((ATAID.PhysLogSectorSize & 0x8000) == 0x0000 && (ATAID.PhysLogSectorSize & 0x4000) == 0x4000) { - if ((ATAID.PhysLogSectorSize & 0x1000) == 0x1000) + if((ATAID.PhysLogSectorSize & 0x1000) == 0x1000) { - if (ATAID.LogicalSectorWords <= 255 || ATAID.LogicalAlignment == 0xFFFF) + if(ATAID.LogicalSectorWords <= 255 || ATAID.LogicalAlignment == 0xFFFF) logicalsectorsize = 512; else logicalsectorsize = ATAID.LogicalSectorWords * 2; @@ -2439,7 +2439,7 @@ namespace DiscImageChef.Decoders.ATA else logicalsectorsize = 512; - if ((ATAID.PhysLogSectorSize & 0x2000) == 0x2000) + if((ATAID.PhysLogSectorSize & 0x2000) == 0x2000) { physicalsectorsize = logicalsectorsize * (uint)Math.Pow(2, (double)(ATAID.PhysLogSectorSize & 0xF)); } @@ -2455,14 +2455,14 @@ namespace DiscImageChef.Decoders.ATA sb.AppendFormat("Physical sector size: {0} bytes", physicalsectorsize).AppendLine(); sb.AppendFormat("Logical sector size: {0} bytes", logicalsectorsize).AppendLine(); - if ((logicalsectorsize != physicalsectorsize) && + if((logicalsectorsize != physicalsectorsize) && (ATAID.LogicalAlignment & 0x8000) == 0x0000 && (ATAID.LogicalAlignment & 0x4000) == 0x4000) { sb.AppendFormat("Logical sector starts at offset {0} from physical sector", ATAID.LogicalAlignment & 0x3FFF).AppendLine(); } - if (minatalevel <= 5) + if(minatalevel <= 5) { sb.AppendFormat("Cylinders: {0} max., {1} current", ATAID.Cylinders, ATAID.CurrentCylinders).AppendLine(); sb.AppendFormat("Heads: {0} max., {1} current", ATAID.Heads, ATAID.CurrentHeads).AppendLine(); @@ -2471,30 +2471,30 @@ namespace DiscImageChef.Decoders.ATA ATAID.CurrentSectors).AppendLine(); } - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport)) { sb.AppendFormat("{0} sectors in 28-bit LBA mode", ATAID.LBASectors).AppendLine(); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48)) { sb.AppendFormat("{0} sectors in 48-bit LBA mode", ATAID.LBA48Sectors).AppendLine(); } - if (minatalevel <= 5) + if(minatalevel <= 5) { sb.AppendFormat("Device size in CHS mode: {0} bytes, {1} Mb, {2} MiB", (ulong)ATAID.CurrentSectors * logicalsectorsize, ((ulong)ATAID.CurrentSectors * logicalsectorsize) / 1000 / 1000, ((ulong)ATAID.CurrentSectors * 512) / 1024 / 1024).AppendLine(); } - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport)) { - if ((((ulong)ATAID.LBASectors * logicalsectorsize) / 1024 / 1024) > 1000000) + if((((ulong)ATAID.LBASectors * logicalsectorsize) / 1024 / 1024) > 1000000) { sb.AppendFormat("Device size in 28-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", (ulong)ATAID.LBASectors * logicalsectorsize, ((ulong)ATAID.LBASectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000, ((ulong)ATAID.LBASectors * 512) / 1024 / 1024 / 1024 / 1024).AppendLine(); } - else if ((((ulong)ATAID.LBASectors * logicalsectorsize) / 1024 / 1024) > 1000) + else if((((ulong)ATAID.LBASectors * logicalsectorsize) / 1024 / 1024) > 1000) { sb.AppendFormat("Device size in 28-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", (ulong)ATAID.LBASectors * logicalsectorsize, ((ulong)ATAID.LBASectors * logicalsectorsize) / 1000 / 1000 / 1000, ((ulong)ATAID.LBASectors * 512) / 1024 / 1024 / 1024).AppendLine(); @@ -2505,17 +2505,17 @@ namespace DiscImageChef.Decoders.ATA ((ulong)ATAID.LBASectors * logicalsectorsize) / 1000 / 1000, ((ulong)ATAID.LBASectors * 512) / 1024 / 1024).AppendLine(); } } - - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48)) + + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48)) { - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.ExtSectors)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ExtSectors)) { - if ((((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000000) + if((((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000000) { sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", (ulong)ATAID.ExtendedUserSectors * logicalsectorsize, ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000, ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024).AppendLine(); } - else if ((((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000) + else if((((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024) > 1000) { sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", (ulong)ATAID.ExtendedUserSectors * logicalsectorsize, ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000, ((ulong)ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024).AppendLine(); @@ -2528,12 +2528,12 @@ namespace DiscImageChef.Decoders.ATA } else { - if ((((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000000) + if((((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000000) { sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", (ulong)ATAID.LBA48Sectors * logicalsectorsize, ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000, ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024).AppendLine(); } - else if ((((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000) + else if((((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024) > 1000) { sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", (ulong)ATAID.LBA48Sectors * logicalsectorsize, ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000 / 1000, ((ulong)ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024).AppendLine(); @@ -2546,9 +2546,9 @@ namespace DiscImageChef.Decoders.ATA } } - if (ata1 || cfa) + if(ata1 || cfa) { - if (cfa) + if(cfa) { sb.AppendFormat("{0} sectors in card", ATAID.SectorsPerCard).AppendLine(); } @@ -2558,10 +2558,10 @@ namespace DiscImageChef.Decoders.ATA sb.AppendFormat("{0} bytes per unformatted sector", ATAID.UnformattedBPS).AppendLine(); } } - if ((ushort)ATAID.SpecificConfiguration != 0x0000 && + if((ushort)ATAID.SpecificConfiguration != 0x0000 && (ushort)ATAID.SpecificConfiguration != 0xFFFF) { - switch (ATAID.SpecificConfiguration) + switch(ATAID.SpecificConfiguration) { case SpecificConfigurationEnum.RequiresSetIncompleteResponse: sb.AppendLine("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete."); @@ -2585,7 +2585,7 @@ namespace DiscImageChef.Decoders.ATA if(ATAID.BufferSize != 0x0000 && ATAID.BufferSize != 0xFFFF && ATAID.BufferType != 0x0000 && ATAID.BufferType != 0xFFFF) { - switch (ATAID.BufferType) + switch(ATAID.BufferType) { case 1: sb.AppendFormat("{0} KiB of single ported single sector buffer", (ATAID.BufferSize * 512) / 1024).AppendLine(); @@ -2602,61 +2602,61 @@ namespace DiscImageChef.Decoders.ATA } } - if (ATAID.EccBytes != 0x0000 && ATAID.EccBytes != 0xFFFF) + if(ATAID.EccBytes != 0x0000 && ATAID.EccBytes != 0xFFFF) sb.AppendFormat("READ/WRITE LONG has {0} extra bytes", ATAID.EccBytes).AppendLine(); sb.AppendLine(); sb.Append("Device capabilities:"); - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.StandardStanbyTimer)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.StandardStanbyTimer)) sb.AppendLine().Append("Standby time values are standard"); - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.IORDY)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.IORDY)) { sb.AppendLine().Append("IORDY is supported"); - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.CanDisableIORDY)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.CanDisableIORDY)) sb.Append(" and can be disabled"); } - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.DMASupport)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.DMASupport)) sb.AppendLine().Append("DMA is supported"); - if (ATAID.Capabilities2.HasFlag(CapabilitiesBit2.MustBeSet) && + if(ATAID.Capabilities2.HasFlag(CapabilitiesBit2.MustBeSet) && !ATAID.Capabilities2.HasFlag(CapabilitiesBit2.MustBeClear)) { - if (ATAID.Capabilities2.HasFlag(CapabilitiesBit2.SpecificStandbyTimer)) + if(ATAID.Capabilities2.HasFlag(CapabilitiesBit2.SpecificStandbyTimer)) sb.AppendLine().Append("Device indicates a specific minimum standby timer value"); } - if (ATAID.Capabilities3.HasFlag(CapabilitiesBit3.MultipleValid)) + if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.MultipleValid)) { sb.AppendLine().AppendFormat("A maximum of {0} sectors can be transferred per interrupt on READ/WRITE MULTIPLE", ATAID.MultipleSectorNumber); sb.AppendLine().AppendFormat("Device supports setting a maximum of {0} sectors", ATAID.MultipleMaxSectors); } - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.PhysicalAlignment1) || + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.PhysicalAlignment1) || ATAID.Capabilities.HasFlag(CapabilitiesBit.PhysicalAlignment0)) { sb.AppendLine().AppendFormat("Long Physical Alignment setting is {0}", (ushort)ATAID.Capabilities & 0x03); } - if (ata1) + if(ata1) { - if (ATAID.TrustedComputing.HasFlag(TrustedComputingBit.TrustedComputing)) + if(ATAID.TrustedComputing.HasFlag(TrustedComputingBit.TrustedComputing)) sb.AppendLine().Append("Device supports doubleword I/O"); } if(atapi) { - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.InterleavedDMA)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.InterleavedDMA)) sb.AppendLine().Append("ATAPI device supports interleaved DMA"); - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.CommandQueue)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.CommandQueue)) sb.AppendLine().Append("ATAPI device supports command queueing"); - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.OverlapOperation)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.OverlapOperation)) sb.AppendLine().Append("ATAPI device supports overlapped operations"); - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.RequiresATASoftReset)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.RequiresATASoftReset)) sb.AppendLine().Append("ATAPI device requires ATA software reset"); } - if (minatalevel <= 3) + if(minatalevel <= 3) { sb.AppendLine().AppendFormat("PIO timing mode: {0}", ATAID.PIOTransferTimingMode); sb.AppendLine().AppendFormat("DMA timing mode: {0}", ATAID.DMATransferTimingMode); @@ -2696,7 +2696,7 @@ namespace DiscImageChef.Decoders.ATA sb.Append("PIO7 "); } - if (minatalevel <= 3 && !atapi) + if(minatalevel <= 3 && !atapi) { sb.AppendLine().Append("Single-word DMA: "); if(ATAID.DMASupported.HasFlag(TransferMode.Mode0)) @@ -2849,122 +2849,122 @@ namespace DiscImageChef.Decoders.ATA sb.Append("(active) "); } - if (ATAID.MinMDMACycleTime != 0 && ATAID.RecMDMACycleTime != 0) + if(ATAID.MinMDMACycleTime != 0 && ATAID.RecMDMACycleTime != 0) { sb.AppendLine().AppendFormat("At minimum {0} ns. transfer cycle time per word in MDMA, " + "{1} ns. recommended", ATAID.MinMDMACycleTime, ATAID.RecMDMACycleTime); } - if (ATAID.MinPIOCycleTimeNoFlow != 0) + if(ATAID.MinPIOCycleTimeNoFlow != 0) { sb.AppendLine().AppendFormat("At minimum {0} ns. transfer cycle time per word in PIO, " + "without flow control", ATAID.MinPIOCycleTimeNoFlow); } - if (ATAID.MinPIOCycleTimeFlow != 0) + if(ATAID.MinPIOCycleTimeFlow != 0) { sb.AppendLine().AppendFormat("At minimum {0} ns. transfer cycle time per word in PIO, " + "with IORDY flow control", ATAID.MinPIOCycleTimeFlow); } - if (ATAID.MaxQueueDepth != 0) + if(ATAID.MaxQueueDepth != 0) { - sb.AppendLine().AppendFormat("{0} depth of queue maximum", ATAID.MaxQueueDepth+1); + sb.AppendLine().AppendFormat("{0} depth of queue maximum", ATAID.MaxQueueDepth + 1); } - if (atapi) + if(atapi) { - if (ATAID.PacketBusRelease != 0) + if(ATAID.PacketBusRelease != 0) sb.AppendLine().AppendFormat("{0} ns. typical to release bus from receipt of PACKET", ATAID.PacketBusRelease); - if (ATAID.ServiceBusyClear != 0) + if(ATAID.ServiceBusyClear != 0) sb.AppendLine().AppendFormat("{0} ns. typical to clear BSY bit from receipt of SERVICE", ATAID.ServiceBusyClear); } - if (((ATAID.TransportMajorVersion & 0xF000) >> 12) == 0x1 || + if(((ATAID.TransportMajorVersion & 0xF000) >> 12) == 0x1 || ((ATAID.TransportMajorVersion & 0xF000) >> 12) == 0xE) { - if (!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear)) + if(!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear)) { - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed)) { sb.AppendLine().Append("SATA 1.5Gb/s is supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed)) { sb.AppendLine().Append("SATA 3.0Gb/s is supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed)) { sb.AppendLine().Append("SATA 6.0Gb/s is supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PowerReceipt)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PowerReceipt)) { sb.AppendLine().Append("Receipt of host initiated power management requests is supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter)) { sb.AppendLine().Append("PHY Event counters are supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.HostSlumbTrans)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.HostSlumbTrans)) { sb.AppendLine().Append("Supports host automatic partial to slumber transitions is supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.DevSlumbTrans)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.DevSlumbTrans)) { sb.AppendLine().Append("Supports device automatic partial to slumber transitions is supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ)) { sb.AppendLine().Append("NCQ is supported"); - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority)) { sb.AppendLine().Append("NCQ priority is supported"); } - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ)) { sb.AppendLine().Append("Unload is supported with outstanding NCQ commands"); } } } - if (!ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.Clear)) + if(!ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.Clear)) { - if (!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) && + if(!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) && ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ)) { - if (ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt)) + if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt)) { sb.AppendLine().Append("NCQ queue management is supported"); } - if (ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream)) + if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream)) { sb.AppendLine().Append("NCQ streaming is supported"); } } - if (atapi) + if(atapi) { - if (ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect)) + if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect)) { sb.AppendLine().Append("ATAPI device supports host environment detection"); } - if (ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.DevAttSlimline)) + if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.DevAttSlimline)) { sb.AppendLine().Append("ATAPI device supports attention on slimline connected devices"); } } //sb.AppendFormat("Negotiated speed = {0}", ((ushort)ATAID.SATACapabilities2 & 0x000E) >> 1); - } + } } - if (ATAID.InterseekDelay != 0x0000 && ATAID.InterseekDelay != 0xFFFF) + if(ATAID.InterseekDelay != 0x0000 && ATAID.InterseekDelay != 0xFFFF) { sb.AppendLine().AppendFormat("{0} microseconds of interseek delay for ISO-7779 accoustic testing", ATAID.InterseekDelay); } - if ((ushort)ATAID.DeviceFormFactor != 0x0000 && (ushort)ATAID.DeviceFormFactor != 0xFFFF) + if((ushort)ATAID.DeviceFormFactor != 0x0000 && (ushort)ATAID.DeviceFormFactor != 0xFFFF) { - switch (ATAID.DeviceFormFactor) + switch(ATAID.DeviceFormFactor) { case DeviceFormFactorEnum.FiveAndQuarter: sb.AppendLine().Append("Device nominal size is 5.25\""); @@ -2987,20 +2987,20 @@ namespace DiscImageChef.Decoders.ATA } } - if (atapi) + if(atapi) { - if (ATAID.ATAPIByteCount > 0) + if(ATAID.ATAPIByteCount > 0) sb.AppendLine().AppendFormat("{0} bytes count limit for ATAPI", ATAID.ATAPIByteCount); } - if (cfa) + if(cfa) { - if ((ATAID.CFAPowerMode & 0x8000) == 0x8000) + if((ATAID.CFAPowerMode & 0x8000) == 0x8000) { sb.AppendLine().Append("CompactFlash device supports power mode 1"); - if ((ATAID.CFAPowerMode & 0x2000) == 0x2000) + if((ATAID.CFAPowerMode & 0x2000) == 0x2000) sb.AppendLine().Append("CompactFlash power mode 1 required for one or more commands"); - if ((ATAID.CFAPowerMode & 0x1000) == 0x1000) + if((ATAID.CFAPowerMode & 0x1000) == 0x1000) sb.AppendLine().Append("CompactFlash power mode 1 is disabled"); sb.AppendLine().AppendFormat("CompactFlash device uses a maximum of {0} mA", (ATAID.CFAPowerMode & 0x0FFF)); @@ -3010,325 +3010,325 @@ namespace DiscImageChef.Decoders.ATA sb.AppendLine(); sb.AppendLine().Append("Command set and features:"); - if (ATAID.CommandSet.HasFlag(CommandSetBit.Nop)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.Nop)) { sb.AppendLine().Append("NOP is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Nop)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Nop)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.ReadBuffer)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.ReadBuffer)) { sb.AppendLine().Append("READ BUFFER is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.ReadBuffer)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.ReadBuffer)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.WriteBuffer)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.WriteBuffer)) { sb.AppendLine().Append("WRITE BUFFER is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.WriteBuffer)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.WriteBuffer)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.HPA)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.HPA)) { sb.AppendLine().Append("Host Protected Area is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.HPA)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.HPA)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.DeviceReset)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.DeviceReset)) { sb.AppendLine().Append("DEVICE RESET is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.DeviceReset)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.DeviceReset)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.Service)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.Service)) { sb.AppendLine().Append("SERVICE interrupt is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Service)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Service)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.Release)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.Release)) { sb.AppendLine().Append("Release is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Release)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Release)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.LookAhead)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.LookAhead)) { sb.AppendLine().Append("Look-ahead read is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.LookAhead)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.LookAhead)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.WriteCache)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.WriteCache)) { sb.AppendLine().Append("Write cache is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.WriteCache)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.WriteCache)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.Packet)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.Packet)) { sb.AppendLine().Append("PACKET is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Packet)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.Packet)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.PowerManagement)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.PowerManagement)) { sb.AppendLine().Append("Power management is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.PowerManagement)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.PowerManagement)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.RemovableMedia)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.RemovableMedia)) { sb.AppendLine().Append("Removable media feature set is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.RemovableMedia)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.RemovableMedia)) sb.Append(" and enabled"); } - if (ATAID.CommandSet.HasFlag(CommandSetBit.SecurityMode)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.SecurityMode)) { sb.AppendLine().Append("Security mode is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.SecurityMode)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.SecurityMode)) sb.Append(" and enabled"); } - if (ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport)) + if(ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport)) sb.AppendLine().Append("28-bit LBA is supported"); - + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.MustBeSet) && !ATAID.CommandSet2.HasFlag(CommandSetBit2.MustBeClear)) { - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48)) { sb.AppendLine().Append("48-bit LBA is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.LBA48)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.LBA48)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.FlushCache)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.FlushCache)) { sb.AppendLine().Append("FLUSH CACHE is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.FlushCache)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.FlushCache)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.FlushCacheExt)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.FlushCacheExt)) { sb.AppendLine().Append("FLUSH CACHE EXT is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.FlushCacheExt)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.FlushCacheExt)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.DCO)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.DCO)) { sb.AppendLine().Append("Device Configuration Overlay feature set is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.DCO)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.DCO)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.AAM)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.AAM)) { sb.AppendLine().Append("Automatic Acoustic Management is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.AAM)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.AAM)) { sb.AppendFormat(" and enabled with value {0} (vendor recommends {1}", ATAID.CurrentAAM, ATAID.RecommendedAAM); } } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.SetMax)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.SetMax)) { sb.AppendLine().Append("SET MAX security extension is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.SetMax)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.SetMax)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot)) { sb.AppendLine().Append("Address Offset Reserved Area Boot is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired)) { sb.AppendLine().Append("SET FEATURES is required before spin-up"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby)) { sb.AppendLine().Append("Power-up in standby is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.RemovableNotification)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.RemovableNotification)) { sb.AppendLine().Append("Removable Media Status Notification is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.RemovableNotification)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.RemovableNotification)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.APM)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.APM)) { sb.AppendLine().Append("Advanced Power Management is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.APM)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.APM)) { sb.AppendFormat(" and enabled with value {0}", ATAID.CurrentAPM); } } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.CompactFlash)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.CompactFlash)) { sb.AppendLine().Append("CompactFlash feature set is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.CompactFlash)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.CompactFlash)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.RWQueuedDMA)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.RWQueuedDMA)) { sb.AppendLine().Append("READ DMA QUEUED and WRITE DMA QUEUED are supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.RWQueuedDMA)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.RWQueuedDMA)) sb.Append(" and enabled"); } - if (ATAID.CommandSet2.HasFlag(CommandSetBit2.DownloadMicrocode)) + if(ATAID.CommandSet2.HasFlag(CommandSetBit2.DownloadMicrocode)) { sb.AppendLine().Append("DOWNLOAD MICROCODE is supported"); - if (ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.DownloadMicrocode)) + if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.DownloadMicrocode)) sb.Append(" and enabled"); } } - if (ATAID.CommandSet.HasFlag(CommandSetBit.SMART)) + if(ATAID.CommandSet.HasFlag(CommandSetBit.SMART)) { sb.AppendLine().Append("S.M.A.R.T. is supported"); - if (ATAID.EnabledCommandSet.HasFlag(CommandSetBit.SMART)) + if(ATAID.EnabledCommandSet.HasFlag(CommandSetBit.SMART)) sb.Append(" and enabled"); } if(ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.Supported)) sb.AppendLine().Append("S.M.A.R.T. Command Transport is supported"); - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) && + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) && !ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeClear)) { - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.SMARTSelfTest)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.SMARTSelfTest)) { sb.AppendLine().Append("S.M.A.R.T. self-testing is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.SMARTSelfTest)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.SMARTSelfTest)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.SMARTLog)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.SMARTLog)) { sb.AppendLine().Append("S.M.A.R.T. error logging is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.SMARTLog)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.SMARTLog)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.IdleImmediate)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.IdleImmediate)) { sb.AppendLine().Append("IDLE IMMEDIATE with UNLOAD FEATURE is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.IdleImmediate)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.IdleImmediate)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.WriteURG)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.WriteURG)) { sb.AppendLine().Append("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.ReadURG)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.ReadURG)) { sb.AppendLine().Append("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.WWN)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.WWN)) { sb.AppendLine().Append("Device has a World Wide Name"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.FUAWriteQ)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.FUAWriteQ)) { sb.AppendLine().Append("WRITE DMA QUEUED FUA EXT is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWriteQ)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWriteQ)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.FUAWrite)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.FUAWrite)) { sb.AppendLine().Append("WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWrite)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWrite)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.GPL)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.GPL)) { sb.AppendLine().Append("General Purpose Logging is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.GPL)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.GPL)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.Streaming)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.Streaming)) { sb.AppendLine().Append("Streaming feature set is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.Streaming)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.Streaming)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.MCPT)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.MCPT)) { sb.AppendLine().Append("Media Card Pass Through command set is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.MCPT)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.MCPT)) sb.Append(" and enabled"); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.MediaSerial)) + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.MediaSerial)) { sb.AppendLine().Append("Media Serial is supported"); - if (ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.MediaSerial)) + if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.MediaSerial)) sb.Append(" and valid"); } } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.MustBeSet) && + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.MustBeSet) && !ATAID.CommandSet4.HasFlag(CommandSetBit4.MustBeClear)) { - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.DSN)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.DSN)) { sb.AppendLine().Append("DSN feature set is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.DSN)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.DSN)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.AMAC)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.AMAC)) { sb.AppendLine().Append("Accessible Max Address Configuration is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.AMAC)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.AMAC)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.ExtPowerCond)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.ExtPowerCond)) { sb.AppendLine().Append("Extended Power Conditions are supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.ExtPowerCond)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.ExtPowerCond)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.ExtStatusReport)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.ExtStatusReport)) { sb.AppendLine().Append("Extended Status Reporting is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.ExtStatusReport)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.ExtStatusReport)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.FreeFallControl)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.FreeFallControl)) { sb.AppendLine().Append("Free-fall control feature set is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.FreeFallControl)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.FreeFallControl)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.SegmentedDownloadMicrocode)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.SegmentedDownloadMicrocode)) { sb.AppendLine().Append("Segmented feature in DOWNLOAD MICROCODE is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.SegmentedDownloadMicrocode)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.SegmentedDownloadMicrocode)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.RWDMAExtGpl)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.RWDMAExtGpl)) { sb.AppendLine().Append("READ/WRITE DMA EXT GPL are supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.RWDMAExtGpl)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.RWDMAExtGpl)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.WriteUnc)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.WriteUnc)) { sb.AppendLine().Append("WRITE UNCORRECTABLE is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.WriteUnc)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.WriteUnc)) sb.Append(" and enabled"); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.WRV)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.WRV)) { sb.AppendLine().Append("Write/Read/Verify is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.WRV)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.WRV)) sb.Append(" and enabled"); sb.AppendLine().AppendFormat("{0} sectors for Write/Read/Verify mode 2", ATAID.WRVSectorCountMode2); sb.AppendLine().AppendFormat("{0} sectors for Write/Read/Verify mode 3", ATAID.WRVSectorCountMode3); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.WRV)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.WRV)) sb.AppendLine().AppendFormat("Current Write/Read/Verify mode: {0}", ATAID.WRVMode); } - if (ATAID.CommandSet4.HasFlag(CommandSetBit4.DT1825)) + if(ATAID.CommandSet4.HasFlag(CommandSetBit4.DT1825)) { sb.AppendLine().Append("DT1825 is supported"); - if (ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.DT1825)) + if(ATAID.EnabledCommandSet4.HasFlag(CommandSetBit4.DT1825)) sb.Append(" and enabled"); } } @@ -3338,80 +3338,80 @@ namespace DiscImageChef.Decoders.ATA sb.AppendLine().Append("OVERWRITE EXT is supported"); if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.CyrptoScramble)) sb.AppendLine().Append("CRYPTO SCRAMBLE EXT is supported"); - - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA)) + + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA)) { sb.AppendLine().Append("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA)) { sb.AppendLine().Append("READ BUFFER DMA is supported"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA)) { sb.AppendLine().Append("WRITE BUFFER DMA is supported"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA)) { sb.AppendLine().Append("DOWNLOAD MICROCODE DMA is supported"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA)) { sb.AppendLine().Append("SET PASSWORD DMA and SET UNLOCK DMA are supported"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.Ata28)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.Ata28)) { sb.AppendLine().Append("Not all 28-bit commands are supported"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.CFast)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.CFast)) { sb.AppendLine().Append("Device follows CFast specification"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.IEEE1667)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.IEEE1667)) { sb.AppendLine().Append("Device follows IEEE-1667"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.DeterministicTrim)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.DeterministicTrim)) { sb.AppendLine().Append("Read after TRIM is deterministic"); - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim)) { sb.AppendLine().Append("Read after TRIM returns empty data"); } } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError)) { sb.AppendLine().Append("Device supports Long Physical Sector Alignment Error Reporting Control"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.Encrypted)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.Encrypted)) { sb.AppendLine().Append("Device encrypts all user data"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.AllCacheNV)) + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.AllCacheNV)) { sb.AppendLine().Append("Device's write cache is non-volatile"); } - if (ATAID.CommandSet5.HasFlag(CommandSetBit5.ZonedBit0) || + if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ZonedBit0) || ATAID.CommandSet5.HasFlag(CommandSetBit5.ZonedBit1)) { sb.AppendLine().Append("Device is zoned"); } - if (ATAID.Capabilities3.HasFlag(CapabilitiesBit3.Sanitize)) + if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.Sanitize)) { sb.AppendLine().Append("Sanitize feature set is supported"); - if (ATAID.Capabilities3.HasFlag(CapabilitiesBit3.SanitizeCommands)) + if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.SanitizeCommands)) sb.AppendLine().Append("Sanitize commands are specified by ACS-3 or higher"); else sb.AppendLine().Append("Sanitize commands are specified by ACS-2"); - if (ATAID.Capabilities3.HasFlag(CapabilitiesBit3.SanitizeAntifreeze)) + if(ATAID.Capabilities3.HasFlag(CapabilitiesBit3.SanitizeAntifreeze)) sb.AppendLine().Append("SANITIZE ANTIFREEZE LOCK EXT is supported"); } - if (!ata1 && maxatalevel >= 8) + if(!ata1 && maxatalevel >= 8) { if(ATAID.TrustedComputing.HasFlag(TrustedComputingBit.Set) && !ATAID.TrustedComputing.HasFlag(TrustedComputingBit.Clear) && @@ -3419,83 +3419,83 @@ namespace DiscImageChef.Decoders.ATA sb.AppendLine().Append("Trusted Computing feature set is supported"); } - if (((ATAID.TransportMajorVersion & 0xF000) >> 12) == 0x1 || + if(((ATAID.TransportMajorVersion & 0xF000) >> 12) == 0x1 || ((ATAID.TransportMajorVersion & 0xF000) >> 12) == 0xE) { - if (!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear)) + if(!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear)) { - if (ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.ReadLogDMAExt)) + if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.ReadLogDMAExt)) sb.AppendLine().Append("READ LOG DMA EXT is supported"); } - if (!ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.Clear)) + if(!ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.Clear)) { - if (ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.FPDMAQ)) + if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.FPDMAQ)) sb.AppendLine().Append("RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED are supported"); } - if (!ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.Clear)) + if(!ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.Clear)) { - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.NonZeroBufferOffset)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.NonZeroBufferOffset)) { sb.AppendLine().Append("Non-zero buffer offsets are supported"); - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.NonZeroBufferOffset)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.NonZeroBufferOffset)) sb.Append(" and enabled"); } - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.DMASetup)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.DMASetup)) { sb.AppendLine().Append("DMA Setup auto-activation is supported"); - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.DMASetup)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.DMASetup)) sb.Append(" and enabled"); } - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.InitPowerMgmt)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.InitPowerMgmt)) { sb.AppendLine().Append("Device-initiated power management is supported"); - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.InitPowerMgmt)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.InitPowerMgmt)) sb.Append(" and enabled"); } - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.InOrderData)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.InOrderData)) { sb.AppendLine().Append("In-order data delivery is supported"); - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.InOrderData)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.InOrderData)) sb.Append(" and enabled"); } - if (!atapi) + if(!atapi) { - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.HardwareFeatureControl)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.HardwareFeatureControl)) { sb.AppendLine().Append("Hardware Feature Control is supported"); - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.HardwareFeatureControl)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.HardwareFeatureControl)) sb.Append(" and enabled"); } } - if (atapi) + if(atapi) { - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.AsyncNotification)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.AsyncNotification)) { sb.AppendLine().Append("Asynchronous notification is supported"); - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.AsyncNotification)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.AsyncNotification)) sb.Append(" and enabled"); } } - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve)) { sb.AppendLine().Append("Software Settings Preservation is supported"); - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve)) sb.Append(" and enabled"); } - if (ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense)) + if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense)) { sb.AppendLine().Append("NCQ Autosense is supported"); } - if (ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber)) + if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber)) { sb.AppendLine().Append("Automatic Partial to Slumber transitions are enabled"); } } } - if ((ATAID.RemovableStatusSet & 0x03) > 0) + if((ATAID.RemovableStatusSet & 0x03) > 0) { sb.AppendLine().Append("Removable Media Status Notification feature set is supported"); } @@ -3507,34 +3507,34 @@ namespace DiscImageChef.Decoders.ATA if(ATAID.DataSetMgmt.HasFlag(DataSetMgmtBit.Trim)) sb.AppendLine().Append("TRIM is supported"); - if (ATAID.DataSetMgmtSize > 0) + if(ATAID.DataSetMgmtSize > 0) { sb.AppendLine().AppendFormat("DATA SET MANAGEMENT can receive a maximum of {0} blocks of 512 bytes", ATAID.DataSetMgmtSize); } sb.AppendLine().AppendLine(); - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Supported)) + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Supported)) { sb.AppendLine("Security:"); - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Enabled)) + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Enabled)) { sb.AppendLine("Security is enabled"); - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Locked)) + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Locked)) sb.AppendLine("Security is locked"); else sb.AppendLine("Security is not locked"); - - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Frozen)) + + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Frozen)) sb.AppendLine("Security is frozen"); else sb.AppendLine("Security is not frozen"); - - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Expired)) + + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Expired)) sb.AppendLine("Security count has expired"); else sb.AppendLine("Security count has notexpired"); - - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Maximum)) + + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Maximum)) sb.AppendLine("Security level is maximum"); else sb.AppendLine("Security level is high"); @@ -3542,17 +3542,17 @@ namespace DiscImageChef.Decoders.ATA else sb.AppendLine("Security is not enabled"); - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Enhanced)) + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Enhanced)) sb.AppendLine("Supports enhanced security erase"); sb.AppendFormat("{0} minutes to complete secure erase", ATAID.SecurityEraseTime * 2).AppendLine(); - if (ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Enhanced)) + if(ATAID.SecurityStatus.HasFlag(SecurityStatusBit.Enhanced)) sb.AppendFormat("{0} minutes to complete enhanced secure erase", ATAID.EnhancedSecurityEraseTime * 2).AppendLine(); sb.AppendFormat("Master password revision code: {0}", ATAID.MasterPasswordRevisionCode).AppendLine(); } - if (ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) && + if(ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeSet) && !ATAID.CommandSet3.HasFlag(CommandSetBit3.MustBeClear) && ATAID.CommandSet3.HasFlag(CommandSetBit3.Streaming)) { @@ -3567,26 +3567,26 @@ namespace DiscImageChef.Decoders.ATA if(ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.Supported)) { sb.AppendLine().AppendLine("S.M.A.R.T. Command Transport (SCT):"); - if (ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.LongSectorAccess)) + if(ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.LongSectorAccess)) sb.AppendLine("SCT Long Sector Address is supported"); - if (ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.WriteSame)) + if(ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.WriteSame)) sb.AppendLine("SCT Write Same is supported"); - if (ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.ErrorRecoveryControl)) + if(ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.ErrorRecoveryControl)) sb.AppendLine("SCT Error Recovery Control is supported"); - if (ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.FeaturesControl)) + if(ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.FeaturesControl)) sb.AppendLine("SCT Features Control is supported"); - if (ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.DataTables)) + if(ATAID.SCTCommandTransport.HasFlag(SCTCommandTransportBit.DataTables)) sb.AppendLine("SCT Data Tables are supported"); } - if ((ATAID.NVCacheCaps & 0x0010) == 0x0010) + if((ATAID.NVCacheCaps & 0x0010) == 0x0010) { sb.AppendLine().AppendLine("Non-Volatile Cache:"); sb.AppendLine().AppendFormat("Version {0}", (ATAID.NVCacheCaps & 0xF000) >> 12).AppendLine(); - if ((ATAID.NVCacheCaps & 0x0001) == 0x0001) + if((ATAID.NVCacheCaps & 0x0001) == 0x0001) { sb.Append("Power mode feature set is supported"); - if ((ATAID.NVCacheCaps & 0x0002) == 0x0002) + if((ATAID.NVCacheCaps & 0x0002) == 0x0002) sb.Append(" and enabled"); sb.AppendLine(); @@ -3595,8 +3595,8 @@ namespace DiscImageChef.Decoders.ATA sb.AppendLine().AppendFormat("Non-Volatile Cache is {0} bytes", ATAID.NVCacheSize * logicalsectorsize).AppendLine(); } - #if DEBUG - sb.AppendLine(); +#if DEBUG + sb.AppendLine(); if(ATAID.VendorWord9 != 0x0000 && ATAID.VendorWord9 != 0xFFFF) sb.AppendFormat("Word 9: 0x{0:X4}", ATAID.VendorWord9).AppendLine(); if((ATAID.VendorWord47 & 0x7F) != 0x7F && (ATAID.VendorWord47 & 0x7F) != 0x00) @@ -3618,17 +3618,17 @@ namespace DiscImageChef.Decoders.ATA for(int i = 0; i < ATAID.ReservedWords121.Length; i++) { if(ATAID.ReservedWords121[i] != 0x0000 && ATAID.ReservedWords121[i] != 0xFFFF) - sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords121[i], 121+i).AppendLine(); + sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords121[i], 121 + i).AppendLine(); } for(int i = 0; i < ATAID.ReservedWords129.Length; i++) { if(ATAID.ReservedWords129[i] != 0x0000 && ATAID.ReservedWords129[i] != 0xFFFF) - sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords129[i], 129+i).AppendLine(); + sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords129[i], 129 + i).AppendLine(); } for(int i = 0; i < ATAID.ReservedCFA.Length; i++) { if(ATAID.ReservedCFA[i] != 0x0000 && ATAID.ReservedCFA[i] != 0xFFFF) - sb.AppendFormat("Word {1} (CFA): 0x{0:X4}", ATAID.ReservedCFA[i], 161+i).AppendLine(); + sb.AppendFormat("Word {1} (CFA): 0x{0:X4}", ATAID.ReservedCFA[i], 161 + i).AppendLine(); } if(ATAID.ReservedWord174 != 0x0000 && ATAID.ReservedWord174 != 0xFFFF) sb.AppendFormat("Word 174: 0x{0:X4}", ATAID.ReservedWord174).AppendLine(); @@ -3647,14 +3647,14 @@ namespace DiscImageChef.Decoders.ATA for(int i = 0; i < ATAID.ReservedCEATA224.Length; i++) { if(ATAID.ReservedCEATA224[i] != 0x0000 && ATAID.ReservedCEATA224[i] != 0xFFFF) - sb.AppendFormat("Word {1} (CE-ATA): 0x{0:X4}", ATAID.ReservedCEATA224[i], 224+i).AppendLine(); + sb.AppendFormat("Word {1} (CE-ATA): 0x{0:X4}", ATAID.ReservedCEATA224[i], 224 + i).AppendLine(); } for(int i = 0; i < ATAID.ReservedWords.Length; i++) { if(ATAID.ReservedWords[i] != 0x0000 && ATAID.ReservedWords[i] != 0xFFFF) - sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords[i], 236+i).AppendLine(); + sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords[i], 236 + i).AppendLine(); } - #endif +#endif return sb.ToString(); } @@ -3680,7 +3680,7 @@ namespace DiscImageChef.Decoders.ATA byte[] outbuf; outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length]; - for(int i = 0; i < length; i+=2) + for(int i = 0; i < length; i += 2) { outbuf[i] = buffer[offset + i + 1]; outbuf[i + 1] = buffer[offset + i]; diff --git a/Blu-ray/BCA.cs b/Blu-ray/BCA.cs index 90a332f..bb7f84f 100644 --- a/Blu-ray/BCA.cs +++ b/Blu-ray/BCA.cs @@ -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)); diff --git a/Blu-ray/Cartridge.cs b/Blu-ray/Cartridge.cs index d3843e6..afa6838 100644 --- a/Blu-ray/Cartridge.cs +++ b/Blu-ray/Cartridge.cs @@ -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(); } diff --git a/Blu-ray/DDS.cs b/Blu-ray/DDS.cs index b320b96..91496e7 100644 --- a/Blu-ray/DDS.cs +++ b/Blu-ray/DDS.cs @@ -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(); } diff --git a/Blu-ray/DI.cs b/Blu-ray/DI.cs index 680901f..571b560 100644 --- a/Blu-ray/DI.cs +++ b/Blu-ray/DI.cs @@ -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 units = new List(); - 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(); diff --git a/Blu-ray/Spare.cs b/Blu-ray/Spare.cs index e1e1092..0984ea6 100644 --- a/Blu-ray/Spare.cs +++ b/Blu-ray/Spare.cs @@ -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(); diff --git a/CD/ATIP.cs b/CD/ATIP.cs index 9066a6c..8f8a36c 100644 --- a/CD/ATIP.cs +++ b/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(); } diff --git a/CD/CDTextOnLeadIn.cs b/CD/CDTextOnLeadIn.cs index ab0f695..ca976fc 100644 --- a/CD/CDTextOnLeadIn.cs +++ b/CD/CDTextOnLeadIn.cs @@ -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(); diff --git a/CD/FullTOC.cs b/CD/FullTOC.cs index 286f52b..f320358 100644 --- a/CD/FullTOC.cs +++ b/CD/FullTOC.cs @@ -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(); diff --git a/CD/PMA.cs b/CD/PMA.cs index cb6dd03..af11766 100644 --- a/CD/PMA.cs +++ b/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); diff --git a/CD/Session.cs b/CD/Session.cs index cf6f9c4..24c247d 100644 --- a/CD/Session.cs +++ b/CD/Session.cs @@ -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(); } diff --git a/CD/TOC.cs b/CD/TOC.cs index 150283d..29cd8f7 100644 --- a/CD/TOC.cs +++ b/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,10 +158,10 @@ 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) - sb.AppendLine("Track number: Lead-Out"); + if(descriptor.TrackNumber == 0xAA) + sb.AppendLine("Track number: Lead-Out"); else sb.AppendFormat("Track number: {0}", descriptor.TrackNumber).AppendLine(); sb.AppendFormat("Track starts at LBA {0}, or MSF {1:X2}:{2:X2}:{3:X2}", descriptor.TrackStartAddress, @@ -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(); } diff --git a/DVD/CSS&CPRM.cs b/DVD/CSS&CPRM.cs index e409296..9d94afa 100644 --- a/DVD/CSS&CPRM.cs +++ b/DVD/CSS&CPRM.cs @@ -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"); } diff --git a/DVD/Cartridge.cs b/DVD/Cartridge.cs index 479d4ef..a8c5f6a 100644 --- a/DVD/Cartridge.cs +++ b/DVD/Cartridge.cs @@ -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; diff --git a/DVD/DDS.cs b/DVD/DDS.cs index 35b59fa..cae612b 100644 --- a/DVD/DDS.cs +++ b/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(); } diff --git a/DVD/PFI.cs b/DVD/PFI.cs index d9c1021..4e05105 100644 --- a/DVD/PFI.cs +++ b/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,8 +1187,8 @@ namespace DiscImageChef.Decoders.DVD } // DVD-R and DVD-RW - if ((pfi.DiskCategory == DiskCategory.DVDR && - pfi.PartVersion < 6) || + 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,8 +1310,8 @@ namespace DiscImageChef.Decoders.DVD } // DVD-R DL and DVD-RW DL - if ((pfi.DiskCategory == DiskCategory.DVDR && - pfi.PartVersion == 6) || + 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,15 +1617,15 @@ 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 && - decoded.PartVersion < 6) || + 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 && - decoded.PartVersion >= 6) || + 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"); } diff --git a/DVD/Spare.cs b/DVD/Spare.cs index a0fe3b8..101fe09 100644 --- a/DVD/Spare.cs +++ b/DVD/Spare.cs @@ -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; diff --git a/SCSI/DiscStructureCapabilities.cs b/SCSI/DiscStructureCapabilities.cs index e7824b4..013c214 100644 --- a/SCSI/DiscStructureCapabilities.cs +++ b/SCSI/DiscStructureCapabilities.cs @@ -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 caps = new List(); uint offset = 4; - while (offset < response.Length) + while(offset < response.Length) { Capability cap = new Capability(); cap.FormatCode = response[offset]; diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs index aec85cb..28bd012 100644 --- a/SCSI/EVPD.cs +++ b/SCSI/EVPD.cs @@ -49,13 +49,13 @@ namespace DiscImageChef.Decoders.SCSI /// Page 0x00. public static byte[] DecodePage00(byte[] page) { - if (page == null) - return null; - - if (page[1] != 0) + if(page == null) return null; - if (page.Length != page[3] + 4) + if(page[1] != 0) + return null; + + if(page.Length != page[3] + 4) return null; byte[] decoded = new byte[page.Length - 4]; @@ -72,13 +72,13 @@ namespace DiscImageChef.Decoders.SCSI /// Page 0x01-0x7F. 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 /// Page 0x80. 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]; diff --git a/SCSI/Inquiry.cs b/SCSI/Inquiry.cs index 096c777..d4af6b0 100644 --- a/SCSI/Inquiry.cs +++ b/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(); } diff --git a/SCSI/MMC/AACS.cs b/SCSI/MMC/AACS.cs index cfe8d38..a6d5aa4 100644 --- a/SCSI/MMC/AACS.cs +++ b/SCSI/MMC/AACS.cs @@ -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(); diff --git a/SCSI/MMC/CPRM.cs b/SCSI/MMC/CPRM.cs index 03c5612..95d6be6 100644 --- a/SCSI/MMC/CPRM.cs +++ b/SCSI/MMC/CPRM.cs @@ -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)); diff --git a/SCSI/MMC/DiscInformation.cs b/SCSI/MMC/DiscInformation.cs index 345ef3c..e0b57ba 100644 --- a/SCSI/MMC/DiscInformation.cs +++ b/SCSI/MMC/DiscInformation.cs @@ -280,16 +280,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static StandardDiscInformation? Decode000b(byte[] response) { - if (response.Length < 34) + if(response.Length < 34) return null; - if ((response[2] & 0xE0) != 0) + if((response[2] & 0xE0) != 0) return null; StandardDiscInformation decoded = new StandardDiscInformation(); decoded.DataLength = (ushort)((response[0] << 8) + response[1]); - if ((decoded.DataLength + 2) != response.Length) + if((decoded.DataLength + 2) != response.Length) return null; decoded.DataType = (byte)((response[2] & 0xE0) >> 5); @@ -324,33 +324,33 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.DiscApplicationCode = response[32]; decoded.OPCTablesNumber = response[33]; - if (decoded.OPCTablesNumber > 0 && response.Length == (decoded.OPCTablesNumber * 8) + 34) + if(decoded.OPCTablesNumber > 0 && response.Length == (decoded.OPCTablesNumber * 8) + 34) { decoded.OPCTables = new OPCTable[decoded.OPCTablesNumber]; - for (int i = 0; i < decoded.OPCTablesNumber; i++) + for(int i = 0; i < decoded.OPCTablesNumber; i++) { decoded.OPCTables[i].Speed = (ushort)((response[34 + i * 8 + 0] << 16) + response[34 + i * 8 + 1]); decoded.OPCTables[i].OPCValues = new byte[6]; Array.Copy(response, 34 + i * 8 + 2, decoded.OPCTables[i].OPCValues, 0, 6); } } - + return decoded; } public static string Prettify000b(StandardDiscInformation? information) { - if (!information.HasValue) + if(!information.HasValue) return null; StandardDiscInformation decoded = information.Value; - if (decoded.DataType != 0) + if(decoded.DataType != 0) return null; StringBuilder sb = new StringBuilder(); - switch (decoded.DiscType) + switch(decoded.DiscType) { case 0x00: sb.AppendLine("Disc type declared as CD-DA or CD-ROM"); @@ -369,7 +369,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC break; } - switch (decoded.DiscStatus) + switch(decoded.DiscStatus) { case 0: sb.AppendLine("Disc is empty"); @@ -382,10 +382,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC break; } - if (decoded.Erasable) + if(decoded.Erasable) sb.AppendLine("Disc is erasable"); - switch (decoded.LastSessionStatus) + switch(decoded.LastSessionStatus) { case 0: sb.AppendLine("Last session is empty"); @@ -401,7 +401,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC break; } - switch (decoded.BGFormatStatus) + switch(decoded.BGFormatStatus) { case 1: sb.AppendLine("Media was being formatted in the background but it is stopped and incomplete"); @@ -414,37 +414,37 @@ namespace DiscImageChef.Decoders.SCSI.MMC break; } - if (decoded.Dbit) + if(decoded.Dbit) sb.AppendLine("MRW is dirty"); sb.AppendFormat("First track on disc is track {0}", decoded.FirstTrackNumber).AppendLine(); sb.AppendFormat("Disc has {0} sessions", decoded.Sessions).AppendLine(); sb.AppendFormat("First track in last session is track {0}", decoded.FirstTrackLastSession).AppendLine(); sb.AppendFormat("Last track in last session is track {0}", decoded.LastTrackLastSession).AppendLine(); - sb.AppendFormat("Last session Lead-In address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastSessionLeadInStartLBA, + sb.AppendFormat("Last session Lead-In address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastSessionLeadInStartLBA, (decoded.LastSessionLeadInStartLBA & 0xFF0000) >> 16, (decoded.LastSessionLeadInStartLBA & 0xFF00) >> 8, (decoded.LastSessionLeadInStartLBA & 0xFF)).AppendLine(); - sb.AppendFormat("Last possible Lead-Out address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastPossibleLeadOutStartLBA, + sb.AppendFormat("Last possible Lead-Out address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", decoded.LastPossibleLeadOutStartLBA, (decoded.LastPossibleLeadOutStartLBA & 0xFF0000) >> 16, (decoded.LastPossibleLeadOutStartLBA & 0xFF00) >> 8, (decoded.LastPossibleLeadOutStartLBA & 0xFF)).AppendLine(); - if (decoded.URU) + if(decoded.URU) sb.AppendLine("Disc is defined for unrestricted use"); else sb.AppendLine("Disc is defined for restricted use"); - if (decoded.DID_V) + if(decoded.DID_V) sb.AppendFormat("Disc ID: {0:X6}", decoded.DiscIdentification & 0x00FFFFFF).AppendLine(); - if (decoded.DBC_V) + if(decoded.DBC_V) sb.AppendFormat("Disc barcode: {0:X16}", decoded.DiscBarcode).AppendLine(); - if (decoded.DAC_V) + if(decoded.DAC_V) sb.AppendFormat("Disc application code: {0}", decoded.DiscApplicationCode).AppendLine(); - if (decoded.OPCTables != null) + if(decoded.OPCTables != null) { - foreach (OPCTable table in decoded.OPCTables) + foreach(OPCTable table in decoded.OPCTables) { sb.AppendFormat("OPC values for {0}Kbit/sec.: {1}, {2}, {3}, {4}, {5}, {6}", table.Speed, table.OPCValues[0], table.OPCValues[1], table.OPCValues[2], @@ -457,16 +457,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static TrackResourcesInformation? Decode001b(byte[] response) { - if (response.Length != 12) + if(response.Length != 12) return null; - if ((response[2] & 0xE0) != 0x20) + if((response[2] & 0xE0) != 0x20) return null; TrackResourcesInformation decoded = new TrackResourcesInformation(); decoded.DataLength = (ushort)((response[0] << 8) + response[1]); - if ((decoded.DataLength + 2) != response.Length) + if((decoded.DataLength + 2) != response.Length) return null; decoded.DataType = (byte)((response[2] & 0xE0) >> 5); @@ -480,12 +480,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify001b(TrackResourcesInformation? information) { - if (!information.HasValue) + if(!information.HasValue) return null; TrackResourcesInformation decoded = information.Value; - if (decoded.DataType != 1) + if(decoded.DataType != 1) return null; StringBuilder sb = new StringBuilder(); @@ -500,16 +500,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static POWResourcesInformation? Decode010b(byte[] response) { - if (response.Length != 16) + if(response.Length != 16) return null; - if ((response[2] & 0xE0) != 0x40) + if((response[2] & 0xE0) != 0x40) return null; POWResourcesInformation decoded = new POWResourcesInformation(); decoded.DataLength = (ushort)((response[0] << 8) + response[1]); - if ((decoded.DataLength + 2) != response.Length) + if((decoded.DataLength + 2) != response.Length) return null; decoded.DataType = (byte)((response[2] & 0xE0) >> 5); @@ -522,12 +522,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify010b(POWResourcesInformation? information) { - if (!information.HasValue) + if(!information.HasValue) return null; POWResourcesInformation decoded = information.Value; - if (decoded.DataType != 1) + if(decoded.DataType != 1) return null; StringBuilder sb = new StringBuilder(); @@ -541,13 +541,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify(byte[] response) { - if (response == null) + if(response == null) return null; - if (response.Length < 12) + if(response.Length < 12) return null; - switch (response[2] & 0xE0) + switch(response[2] & 0xE0) { case 0x00: return Prettify000b(Decode000b(response)); diff --git a/SCSI/MMC/Features.cs b/SCSI/MMC/Features.cs index 27a4fc2..281acbe 100644 --- a/SCSI/MMC/Features.cs +++ b/SCSI/MMC/Features.cs @@ -2158,18 +2158,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC { public static Feature_0000? Decode_0000(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0000) + if(number != 0x0000) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0000 decoded = new Feature_0000(); @@ -2180,7 +2180,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC int offset = 4; List listProfiles = new List(); - while (offset < feature.Length) + while(offset < feature.Length) { Profile prof = new Profile(); prof.Number = (ProfileNumber)((feature[offset] << 8) + feature[offset + 1]); @@ -2195,18 +2195,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0001? Decode_0001(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0001) + if(number != 0x0001) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0001 decoded = new Feature_0001(); @@ -2215,13 +2215,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.PhysicalInterfaceStandard = (PhysicalInterfaces)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]); - if (decoded.Version >= 1 && feature.Length >= 12) + if(decoded.Version >= 1 && feature.Length >= 12) decoded.DBE |= (feature[8] & 0x01) == 0x01; - if (decoded.Version >= 2 && feature.Length >= 12) + if(decoded.Version >= 2 && feature.Length >= 12) decoded.INQ2 |= (feature[8] & 0x02) == 0x02; return decoded; @@ -2229,18 +2229,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0002? Decode_0002(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0002) + if(number != 0x0002) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0002 decoded = new Feature_0002(); @@ -2249,10 +2249,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.Async |= (feature[4] & 0x01) == 0x01; - if (decoded.Version >= 1) + if(decoded.Version >= 1) decoded.OCEvent |= (feature[4] & 0x02) == 0x02; return decoded; @@ -2260,18 +2260,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0003? Decode_0003(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0003) + if(number != 0x0003) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0003 decoded = new Feature_0003(); @@ -2280,7 +2280,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.LoadingMechanismType = (byte)((feature[4] & 0xE0) >> 5); decoded.Eject |= (feature[4] & 0x08) == 0x08; @@ -2288,7 +2288,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Lock |= (feature[4] & 0x01) == 0x01; } - if (decoded.Version >= 2) + if(decoded.Version >= 2) { decoded.Load |= (feature[4] & 0x10) == 0x10; decoded.DBML |= (feature[4] & 0x02) == 0x02; @@ -2299,18 +2299,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0004? Decode_0004(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0004) + if(number != 0x0004) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0004 decoded = new Feature_0004(); @@ -2319,16 +2319,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.SPWP |= (feature[4] & 0x02) == 0x02; decoded.SSWPP |= (feature[4] & 0x01) == 0x01; } - if (decoded.Version >= 1) + if(decoded.Version >= 1) decoded.WDCB |= (feature[4] & 0x04) == 0x04; - if (decoded.Version >= 2) + if(decoded.Version >= 2) decoded.DWP |= (feature[4] & 0x08) == 0x08; return decoded; @@ -2336,18 +2336,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0010? Decode_0010(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 12) + if(feature.Length < 12) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0010) + if(number != 0x0010) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0010 decoded = new Feature_0010(); @@ -2356,7 +2356,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.LogicalBlockSize = (uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]); decoded.Blocking = (ushort)((feature[8] << 8) + feature[9]); @@ -2368,18 +2368,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_001D? Decode_001D(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x001D) + if(number != 0x001D) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_001D decoded = new Feature_001D(); @@ -2393,18 +2393,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_001E? Decode_001E(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x001E) + if(number != 0x001E) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_001E decoded = new Feature_001E(); @@ -2413,13 +2413,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 1) + if(decoded.Version >= 1) { decoded.C2 |= (feature[4] & 0x02) == 0x02; decoded.CDText |= (feature[4] & 0x01) == 0x01; } - if (decoded.Version >= 2) + if(decoded.Version >= 2) decoded.DAP |= (feature[4] & 0x80) == 0x80; return decoded; @@ -2427,18 +2427,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_001F? Decode_001F(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x001F) + if(number != 0x001F) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_001F decoded = new Feature_001F(); @@ -2447,13 +2447,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 2 && feature.Length >= 8) + if(decoded.Version >= 2 && feature.Length >= 8) { decoded.MULTI110 |= (feature[4] & 0x01) == 0x01; decoded.DualR |= (feature[6] & 0x01) == 0x01; } - if (decoded.Version >= 2 && feature.Length >= 8) + if(decoded.Version >= 2 && feature.Length >= 8) decoded.DualRW |= (feature[6] & 0x02) == 0x02; return decoded; @@ -2461,18 +2461,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0020? Decode_0020(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 16) + if(feature.Length < 16) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0020) + if(number != 0x0020) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0020 decoded = new Feature_0020(); @@ -2481,7 +2481,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 1) + if(decoded.Version >= 1) { decoded.LastLBA = (uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]); decoded.LogicalBlockSize = (uint)((feature[8] << 24) + (feature[9] << 16) + (feature[10] << 8) + feature[11]); @@ -2494,18 +2494,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0021? Decode_0021(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0021) + if(number != 0x0021) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0021 decoded = new Feature_0021(); @@ -2514,16 +2514,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 1) + if(decoded.Version >= 1) { decoded.DataTypeSupported = (ushort)((feature[4] << 8) + feature[5]); decoded.BUF |= (feature[6] & 0x01) == 0x01; decoded.LinkSizes = new byte[feature[7]]; - if (feature.Length > (feature[7] + 8)) + if(feature.Length > (feature[7] + 8)) Array.Copy(feature, 8, decoded.LinkSizes, 0, feature[7]); } - if (decoded.Version >= 3) + if(decoded.Version >= 3) { decoded.TRIO |= (feature[6] & 0x04) == 0x04; decoded.ARSV |= (feature[6] & 0x02) == 0x02; @@ -2534,18 +2534,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0022? Decode_0022(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0022) + if(number != 0x0022) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0022 decoded = new Feature_0022(); @@ -2559,18 +2559,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0023? Decode_0023(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0023) + if(number != 0x0023) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0023 decoded = new Feature_0023(); @@ -2579,7 +2579,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 1 && feature.Length >= 12) + if(decoded.Version >= 1 && feature.Length >= 12) { decoded.RENoSA |= (feature[4] & 0x08) == 0x08; decoded.Expand |= (feature[4] & 0x04) == 0x04; @@ -2588,7 +2588,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.RRM |= (feature[8] & 0x01) == 0x01; } - if (decoded.Version >= 2 && feature.Length >= 12) + if(decoded.Version >= 2 && feature.Length >= 12) decoded.FRF |= (feature[4] & 0x80) == 0x80; return decoded; @@ -2596,18 +2596,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0024? Decode_0024(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0024) + if(number != 0x0024) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0024 decoded = new Feature_0024(); @@ -2616,7 +2616,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 1 && feature.Length >= 8) + if(decoded.Version >= 1 && feature.Length >= 8) decoded.SSA |= (feature[4] & 0x80) == 0x80; return decoded; @@ -2624,18 +2624,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0025? Decode_0025(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 12) + if(feature.Length < 12) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0025) + if(number != 0x0025) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0025 decoded = new Feature_0025(); @@ -2644,7 +2644,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.LogicalBlockSize = (uint)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]); decoded.Blocking = (ushort)((feature[8] << 8) + feature[9]); @@ -2656,18 +2656,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0026? Decode_0026(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0026) + if(number != 0x0026) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0026 decoded = new Feature_0026(); @@ -2681,18 +2681,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0027? Decode_0027(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0027) + if(number != 0x0027) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0027 decoded = new Feature_0027(); @@ -2706,18 +2706,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0028? Decode_0028(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0028) + if(number != 0x0028) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0028 decoded = new Feature_0028(); @@ -2726,10 +2726,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.Write |= (feature[4] & 0x01) == 0x01; - if (decoded.Version >= 1) + if(decoded.Version >= 1) { decoded.DVDPWrite |= (feature[4] & 0x04) == 0x04; decoded.DVDPRead |= (feature[4] & 0x02) == 0x02; @@ -2740,18 +2740,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0029? Decode_0029(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0029) + if(number != 0x0029) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0029 decoded = new Feature_0029(); @@ -2760,7 +2760,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.DRTDM |= (feature[4] & 0x01) == 0x01; decoded.DBICacheZones = feature[5]; @@ -2772,18 +2772,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_002A? Decode_002A(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x002A) + if(number != 0x002A) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_002A decoded = new Feature_002A(); @@ -2792,13 +2792,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.Write |= (feature[4] & 0x01) == 0x01; decoded.CloseOnly |= (feature[5] & 0x01) == 0x01; } - if (decoded.Version >= 1) + if(decoded.Version >= 1) decoded.QuickStart |= (feature[5] & 0x02) == 0x02; return decoded; @@ -2806,18 +2806,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_002B? Decode_002B(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x002B) + if(number != 0x002B) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_002B decoded = new Feature_002B(); @@ -2826,7 +2826,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.Write |= (feature[4] & 0x01) == 0x01; return decoded; @@ -2834,18 +2834,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_002C? Decode_002C(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x002C) + if(number != 0x002C) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_002C decoded = new Feature_002C(); @@ -2854,7 +2854,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.DSDG |= (feature[4] & 0x08) == 0x08; decoded.DSDR |= (feature[4] & 0x04) == 0x04; @@ -2867,18 +2867,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_002D? Decode_002D(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x002D) + if(number != 0x002D) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_002D decoded = new Feature_002D(); @@ -2887,7 +2887,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.TestWrite |= (feature[4] & 0x04) == 0x04; decoded.CDRW |= (feature[4] & 0x02) == 0x02; @@ -2895,7 +2895,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.DataTypeSupported = (ushort)((feature[6] << 8) + feature[7]); } - if (decoded.Version >= 2) + if(decoded.Version >= 2) { decoded.BUF |= (feature[4] & 0x40) == 0x40; decoded.RWRaw |= (feature[4] & 0x10) == 0x10; @@ -2907,18 +2907,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_002E? Decode_002E(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x002E) + if(number != 0x002E) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_002E decoded = new Feature_002E(); @@ -2927,7 +2927,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.SAO |= (feature[4] & 0x20) == 0x20; decoded.RAWMS |= (feature[4] & 0x10) == 0x10; @@ -2938,7 +2938,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.MaxCueSheet = (uint)((feature[5] << 16) + (feature[6] << 8) + feature[7]); } - if (decoded.Version >= 1) + if(decoded.Version >= 1) decoded.BUF |= (feature[4] & 0x40) == 0x40; return decoded; @@ -2946,18 +2946,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_002F? Decode_002F(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x002F) + if(number != 0x002F) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_002F decoded = new Feature_002F(); @@ -2966,16 +2966,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.BUF |= (feature[4] & 0x40) == 0x40; decoded.TestWrite |= (feature[4] & 0x04) == 0x04; } - if (decoded.Version >= 1) + if(decoded.Version >= 1) decoded.DVDRW |= (feature[4] & 0x02) == 0x02; - if (decoded.Version >= 2) + if(decoded.Version >= 2) decoded.RDL |= (feature[4] & 0x08) == 0x08; return decoded; @@ -2983,18 +2983,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0030? Decode_0030(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0030) + if(number != 0x0030) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0030 decoded = new Feature_0030(); @@ -3008,18 +3008,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0031? Decode_0031(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0031) + if(number != 0x0031) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0031 decoded = new Feature_0031(); @@ -3028,7 +3028,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.TestWrite |= (feature[4] & 0x04) == 0x04; return decoded; @@ -3036,18 +3036,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0032? Decode_0032(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0032) + if(number != 0x0032) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0032 decoded = new Feature_0032(); @@ -3056,7 +3056,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.Intermediate |= (feature[4] & 0x02) == 0x02; decoded.Blank |= (feature[4] & 0x01) == 0x01; @@ -3067,18 +3067,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0033? Decode_0033(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0033) + if(number != 0x0033) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0033 decoded = new Feature_0033(); @@ -3087,7 +3087,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (feature[7] > 0 && feature.Length > (feature[7] + 8)) + if(feature[7] > 0 && feature.Length > (feature[7] + 8)) { decoded.LinkSizes = new byte[feature[7]]; Array.Copy(feature, 8, decoded.LinkSizes, 0, feature[7]); @@ -3098,18 +3098,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0035? Decode_0035(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0035) + if(number != 0x0035) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0035 decoded = new Feature_0035(); @@ -3123,18 +3123,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0037? Decode_0037(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0037) + if(number != 0x0037) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0037 decoded = new Feature_0037(); @@ -3143,7 +3143,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.SubtypeSupport = feature[5]; return decoded; @@ -3151,18 +3151,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0038? Decode_0038(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0038) + if(number != 0x0038) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0038 decoded = new Feature_0038(); @@ -3176,18 +3176,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_003A? Decode_003A(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x003A) + if(number != 0x003A) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_003A decoded = new Feature_003A(); @@ -3196,7 +3196,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.Write |= (feature[4] & 0x01) == 0x01; decoded.QuickStart |= (feature[5] & 0x02) == 0x02; @@ -3208,18 +3208,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_003B? Decode_003B(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x003B) + if(number != 0x003B) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_003B decoded = new Feature_003B(); @@ -3228,7 +3228,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.Write |= (feature[4] & 0x01) == 0x01; return decoded; @@ -3236,18 +3236,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0040? Decode_0040(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 32) + if(feature.Length < 32) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0040) + if(number != 0x0040) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0040 decoded = new Feature_0040(); @@ -3256,14 +3256,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.OldRE |= (feature[9] & 0x01) == 0x01; decoded.OldR |= (feature[17] & 0x01) == 0x01; decoded.OldROM |= (feature[25] & 0x01) == 0x01; } - if (decoded.Version >= 1) + if(decoded.Version >= 1) { decoded.BCA |= (feature[4] & 0x01) == 0x01; decoded.RE2 |= (feature[9] & 0x04) == 0x04; @@ -3277,18 +3277,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0041? Decode_0041(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 24) + if(feature.Length < 24) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0041) + if(number != 0x0041) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0041 decoded = new Feature_0041(); @@ -3297,14 +3297,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.SVNR |= (feature[4] & 0x01) == 0x01; decoded.OldRE |= (feature[9] & 0x01) == 0x01; decoded.OldR |= (feature[17] & 0x01) == 0x01; } - if (decoded.Version >= 1) + if(decoded.Version >= 1) { decoded.RE2 |= (feature[9] & 0x04) == 0x04; decoded.RE1 |= (feature[9] & 0x02) == 0x02; @@ -3316,18 +3316,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0042? Decode_0042(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0042) + if(number != 0x0042) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0042 decoded = new Feature_0042(); @@ -3341,18 +3341,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0050? Decode_0050(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0050) + if(number != 0x0050) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0050 decoded = new Feature_0050(); @@ -3361,7 +3361,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.HDDVDR |= (feature[4] & 0x01) == 0x01; decoded.HDDVDRAM |= (feature[6] & 0x01) == 0x01; @@ -3372,18 +3372,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0051? Decode_0051(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0051) + if(number != 0x0051) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0051 decoded = new Feature_0051(); @@ -3392,7 +3392,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.HDDVDR |= (feature[4] & 0x01) == 0x01; decoded.HDDVDRAM |= (feature[6] & 0x01) == 0x01; @@ -3403,18 +3403,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0080? Decode_0080(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0080) + if(number != 0x0080) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0080 decoded = new Feature_0080(); @@ -3423,7 +3423,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.RI |= (feature[4] & 0x01) == 0x01; return decoded; @@ -3431,18 +3431,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0100? Decode_0100(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0100) + if(number != 0x0100) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0100 decoded = new Feature_0100(); @@ -3456,18 +3456,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0101? Decode_0101(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0101) + if(number != 0x0101) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0101 decoded = new Feature_0101(); @@ -3476,7 +3476,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.PP |= (feature[4] & 0x01) == 0x01; return decoded; @@ -3484,18 +3484,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0102? Decode_0102(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0102) + if(number != 0x0102) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0102 decoded = new Feature_0102(); @@ -3504,7 +3504,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.SCC |= (feature[4] & 0x10) == 0x10; decoded.SDP |= (feature[4] & 0x04) == 0x04; @@ -3516,18 +3516,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0103? Decode_0103(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0103) + if(number != 0x0103) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0103 decoded = new Feature_0103(); @@ -3536,7 +3536,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.Scan |= (feature[4] & 0x04) == 0x04; decoded.SCM |= (feature[4] & 0x02) == 0x02; @@ -3549,18 +3549,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0104? Decode_0104(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0104) + if(number != 0x0104) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0104 decoded = new Feature_0104(); @@ -3569,7 +3569,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 1 && feature.Length >= 8) + if(decoded.Version >= 1 && feature.Length >= 8) decoded.M5 |= (feature[4] & 0x01) == 0x01; return decoded; @@ -3577,18 +3577,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0105? Decode_0105(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0105) + if(number != 0x0105) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0105 decoded = new Feature_0105(); @@ -3597,7 +3597,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 1 && feature.Length >= 8) + if(decoded.Version >= 1 && feature.Length >= 8) { decoded.Group3 |= (feature[4] & 0x01) == 0x01; decoded.UnitLength = (ushort)((feature[6] << 8) + feature[7]); @@ -3608,18 +3608,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0106? Decode_0106(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0106) + if(number != 0x0106) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0106 decoded = new Feature_0106(); @@ -3628,7 +3628,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.CSSVersion = feature[7]; return decoded; @@ -3636,18 +3636,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0107? Decode_0107(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0107) + if(number != 0x0107) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0107 decoded = new Feature_0107(); @@ -3656,7 +3656,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 3 && feature.Length >= 8) + if(decoded.Version >= 3 && feature.Length >= 8) { decoded.RBCB |= (feature[4] & 0x10) == 0x10; decoded.SCS |= (feature[4] & 0x08) == 0x08; @@ -3665,7 +3665,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.SW |= (feature[4] & 0x01) == 0x01; } - if (decoded.Version >= 5 && feature.Length >= 8) + if(decoded.Version >= 5 && feature.Length >= 8) { decoded.SMP |= (feature[4] & 0x20) == 0x20; decoded.RBCB |= (feature[4] & 0x10) == 0x10; @@ -3676,18 +3676,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0108? Decode_0108(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0108) + if(number != 0x0108) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0108 decoded = new Feature_0108(); @@ -3696,7 +3696,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { byte[] serial = new byte[feature.Length]; Array.Copy(feature, 4, serial, 0, feature.Length - 4); @@ -3708,18 +3708,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0109? Decode_0109(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0109) + if(number != 0x0109) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0109 decoded = new Feature_0109(); @@ -3733,18 +3733,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_010A? Decode_010A(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x010A) + if(number != 0x010A) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_010A decoded = new Feature_010A(); @@ -3753,10 +3753,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.DCBs = new uint[feature[3] / 4]; - for (int i = 0; i < decoded.DCBs.Length; i++) + for(int i = 0; i < decoded.DCBs.Length; i++) decoded.DCBs[i] = (uint)((feature[0 + 4 + i * 4] << 24) + (feature[1 + 4 + i * 4] << 16) + (feature[2 + 4 + i * 4] << 8) + feature[3 + 4 + i * 4]); } @@ -3765,18 +3765,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_010B? Decode_010B(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x010B) + if(number != 0x010B) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_010B decoded = new Feature_010B(); @@ -3785,7 +3785,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.CPRMVersion = feature[7]; return decoded; @@ -3793,18 +3793,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_010C? Decode_010C(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 20) + if(feature.Length < 20) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x010C) + if(number != 0x010C) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_010C decoded = new Feature_010C(); @@ -3813,7 +3813,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.Century = (ushort)((feature[4] << 8) + feature[5]); decoded.Year = (ushort)((feature[6] << 8) + feature[7]); @@ -3829,18 +3829,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_010D? Decode_010D(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x010D) + if(number != 0x010D) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_010D decoded = new Feature_010D(); @@ -3849,7 +3849,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.BNG |= (feature[4] & 0x01) == 0x01; decoded.BindNonceBlocks = feature[5]; @@ -3857,7 +3857,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.AACSVersion = feature[7]; } - if (decoded.Version >= 2) + if(decoded.Version >= 2) { decoded.RDC |= (feature[4] & 0x10) == 0x10; decoded.RMC |= (feature[4] & 0x08) == 0x08; @@ -3870,18 +3870,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_010E? Decode_010E(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x010E) + if(number != 0x010E) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_010E decoded = new Feature_010E(); @@ -3890,7 +3890,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) decoded.MaxScrambleExtent = feature[4]; return decoded; @@ -3898,18 +3898,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0110? Decode_0110(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 8) + if(feature.Length < 8) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0110) + if(number != 0x0110) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0110 decoded = new Feature_0110(); @@ -3923,18 +3923,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0113? Decode_0113(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 4) + if(feature.Length < 4) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0113) + if(number != 0x0113) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0113 decoded = new Feature_0113(); @@ -3948,18 +3948,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static Feature_0142? Decode_0142(byte[] feature) { - if (feature == null) + if(feature == null) return null; - if (feature.Length < 6) + if(feature.Length < 6) return null; ushort number = (ushort)((feature[0] << 8) + feature[1]); - if (number != 0x0142) + if(number != 0x0142) return null; - if ((feature[3] + 4) != feature.Length) + if((feature[3] + 4) != feature.Length) return null; Feature_0142 decoded = new Feature_0142(); @@ -3968,15 +3968,15 @@ namespace DiscImageChef.Decoders.SCSI.MMC decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if (decoded.Version >= 0) + if(decoded.Version >= 0) { decoded.PSAU |= (feature[4] & 0x80) == 0x80; decoded.LOSPB |= (feature[4] & 0x40) == 0x40; decoded.ME |= (feature[4] & 0x01) == 0x01; decoded.Profiles = new ushort[feature[5]]; - if (feature[5] * 2 + 6 == feature.Length) + if(feature[5] * 2 + 6 == feature.Length) { - for (int i = 0; i < feature[5]; i++) + for(int i = 0; i < feature[5]; i++) decoded.Profiles[i] = (ushort)((feature[0 + 6 + 2 * i] << 8) + feature[1 + 6 + 2 * i]); } } @@ -3986,18 +3986,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0000(Feature_0000? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0000 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.AppendLine("MMC Supported Profiles:"); - if (ftr.Profiles != null) + if(ftr.Profiles != null) { - foreach (Profile prof in ftr.Profiles) + foreach(Profile prof in ftr.Profiles) { - switch (prof.Number) + switch(prof.Number) { case ProfileNumber.Reserved: sb.Append("\tDrive reported a reserved profile number"); @@ -4112,7 +4112,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC break; } - if (prof.Current) + if(prof.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -4124,7 +4124,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0001(Feature_0001? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0001 ftr = feature.Value; @@ -4132,7 +4132,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Core Feature:"); sb.Append("\tDrive uses "); - switch (ftr.PhysicalInterfaceStandard) + switch(ftr.PhysicalInterfaceStandard) { case PhysicalInterfaces.Unspecified: sb.AppendLine("an unspecified physical interface"); @@ -4179,7 +4179,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0002(Feature_0002? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0002 ftr = feature.Value; @@ -4187,12 +4187,12 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Morphing:"); - if (ftr.Async) + if(ftr.Async) sb.AppendLine("\tDrive supports polling and asynchronous GET EVENT STATUS NOTIFICATION"); else sb.AppendLine("\tDrive supports only polling GET EVENT STATUS NOTIFICATION"); - if (ftr.OCEvent) + if(ftr.OCEvent) sb.AppendLine("\tDrive supports operational change request / notification class events"); return sb.ToString(); @@ -4200,7 +4200,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0003(Feature_0003? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0003 ftr = feature.Value; @@ -4208,7 +4208,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Removable Medium:"); - switch (ftr.LoadingMechanismType) + switch(ftr.LoadingMechanismType) { case 0: sb.AppendLine("\tDrive uses media caddy"); @@ -4230,15 +4230,15 @@ namespace DiscImageChef.Decoders.SCSI.MMC break; } - if (ftr.Lock) + if(ftr.Lock) sb.AppendLine("\tDrive can lock media"); - if (ftr.PreventJumper) + if(ftr.PreventJumper) sb.AppendLine("\tDrive power ups locked"); - if (ftr.Eject) + if(ftr.Eject) sb.AppendLine("\tDrive can eject media"); - if (ftr.Load) + if(ftr.Load) sb.AppendLine("\tDrive can load media"); - if (ftr.DBML) + if(ftr.DBML) sb.AppendLine("\tDrive reports Device Busy Class events during medium loading/unloading"); return sb.ToString(); @@ -4246,7 +4246,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0004(Feature_0004? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0004 ftr = feature.Value; @@ -4254,13 +4254,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Write Protect:"); - if (ftr.DWP) + if(ftr.DWP) sb.AppendLine("\tDrive supports reading/writing the Disc Write Protect PAC on BD-R/-RE media"); - if (ftr.WDCB) + if(ftr.WDCB) sb.AppendLine("\tDrive supports writing the Write Inhibit DCB on DVD+RW media"); - if (ftr.SPWP) + if(ftr.SPWP) sb.AppendLine("\tDrive supports set/release of PWP status"); - if (ftr.SSWPP) + if(ftr.SSWPP) sb.AppendLine("\tDrive supports the SWPP bit of the Timeout and Protect mode page"); return sb.ToString(); @@ -4268,22 +4268,22 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0010(Feature_0010? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0010 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC Random Readable"); - if (ftr.Current) + if(ftr.Current) sb.Append(" (current)"); sb.AppendLine(":"); - if (ftr.PP) + if(ftr.PP) sb.AppendLine("\tDrive shall report Read/Write Error Recovery mode page"); - if (ftr.LogicalBlockSize > 0) + if(ftr.LogicalBlockSize > 0) sb.AppendFormat("\t{0} bytes per logical block", ftr.LogicalBlockSize).AppendLine(); - if (ftr.Blocking > 1) + if(ftr.Blocking > 1) sb.AppendFormat("\t{0} logical blocks per media readable unit", ftr.Blocking).AppendLine(); return sb.ToString(); @@ -4296,22 +4296,22 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_001E(Feature_001E? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_001E ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC CD Read"); - if (ftr.Current) + if(ftr.Current) sb.Append(" (current)"); sb.AppendLine(":"); - if (ftr.DAP) + if(ftr.DAP) sb.AppendLine("\tDrive supports the DAP bit in the READ CD and READ CD MSF commands"); - if (ftr.C2) + if(ftr.C2) sb.AppendLine("\tDrive supports C2 Error Pointers"); - if (ftr.CDText) + if(ftr.CDText) sb.AppendLine("\tDrive can return CD-Text from Lead-In"); return sb.ToString(); @@ -4319,23 +4319,23 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_001F(Feature_001F? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_001F ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC DVD Read"); - if (ftr.Current) + if(ftr.Current) sb.Append(" (current)"); sb.AppendLine(":"); sb.AppendLine("\tDrive can read DVD media"); - if (ftr.DualR) + if(ftr.DualR) sb.AppendLine("\tDrive can read DVD-R DL from all recording modes"); - if (ftr.DualRW) + if(ftr.DualRW) sb.AppendLine("\tDrive can read DVD-RW DL from all recording modes"); - if (ftr.MULTI110) + if(ftr.MULTI110) sb.AppendLine("\tDrive conforms to DVD Multi Drive Read-only Specifications"); return sb.ToString(); @@ -4343,24 +4343,24 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0020(Feature_0020? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0020 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC Random Writable:"); - if (ftr.Current) + if(ftr.Current) sb.Append(" (current)"); sb.AppendLine(":"); - if (ftr.PP) + if(ftr.PP) sb.AppendLine("\tDrive shall report Read/Write Error Recovery mode page"); - if (ftr.LogicalBlockSize > 0) + if(ftr.LogicalBlockSize > 0) sb.AppendFormat("\t{0} bytes per logical block", ftr.LogicalBlockSize).AppendLine(); - if (ftr.Blocking > 1) + if(ftr.Blocking > 1) sb.AppendFormat("\t{0} logical blocks per media writable unit", ftr.Blocking).AppendLine(); - if (ftr.LastLBA > 0) + if(ftr.LastLBA > 0) sb.AppendFormat("\tLast adressable logical block is {0}", ftr.LastLBA).AppendLine(); return sb.ToString(); @@ -4368,7 +4368,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0021(Feature_0021? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0021 ftr = feature.Value; @@ -4376,7 +4376,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Incremental Streaming Writable:"); - if (ftr.DataTypeSupported > 0) + if(ftr.DataTypeSupported > 0) { sb.Append("\tDrive supports data block types:"); if((ftr.DataTypeSupported & 0x0001) == 0x0001) @@ -4431,7 +4431,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0023(Feature_0023? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0023 ftr = feature.Value; @@ -4440,17 +4440,17 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Formattable:"); sb.AppendLine("\tDrive can format media into logical blocks"); - if (ftr.RENoSA) + if(ftr.RENoSA) sb.AppendLine("\tDrive can format BD-RE with no spares allocated"); - if (ftr.Expand) + if(ftr.Expand) sb.AppendLine("\tDrive can expand the spare area on a formatted BD-RE disc"); - if (ftr.QCert) + if(ftr.QCert) sb.AppendLine("\tDrive can format BD-RE discs with quick certification"); - if (ftr.Cert) + if(ftr.Cert) sb.AppendLine("\tDrive can format BD-RE discs with full certification"); - if (ftr.FRF) + if(ftr.FRF) sb.AppendLine("\tDrive can fast re-format BD-RE discs"); - if (ftr.RRM) + if(ftr.RRM) sb.AppendLine("\tDrive can format BD-R discs with RRM format"); return sb.ToString(); @@ -4458,7 +4458,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0024(Feature_0024? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0024 ftr = feature.Value; @@ -4466,7 +4466,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Hardware Defect Management:"); sb.AppendLine("\tDrive shall be able to provide a defect-free contiguous address space"); - if (ftr.SSA) + if(ftr.SSA) sb.AppendLine("\tDrive can return Spare Area Information"); return sb.ToString(); @@ -4474,22 +4474,22 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0025(Feature_0025? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0025 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC Write Once"); - if (ftr.Current) + if(ftr.Current) sb.Append(" (current)"); sb.AppendLine(":"); - if (ftr.PP) + if(ftr.PP) sb.AppendLine("\tDrive shall report Read/Write Error Recovery mode page"); - if (ftr.LogicalBlockSize > 0) + if(ftr.LogicalBlockSize > 0) sb.AppendFormat("\t{0} bytes per logical block", ftr.LogicalBlockSize).AppendLine(); - if (ftr.Blocking > 1) + if(ftr.Blocking > 1) sb.AppendFormat("\t{0} logical blocks per media writable unit", ftr.Blocking).AppendLine(); return sb.ToString(); @@ -4502,7 +4502,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0027(Feature_0027? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0027 ftr = feature.Value; @@ -4519,21 +4519,21 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0028(Feature_0028? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0028 ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.Write && ftr.DVDPRead && ftr.DVDPWrite) + if(ftr.Write && ftr.DVDPRead && ftr.DVDPWrite) sb.Append("Drive can read and write CD-MRW and DVD+MRW"); - else if (ftr.DVDPRead && ftr.DVDPWrite) + else if(ftr.DVDPRead && ftr.DVDPWrite) sb.Append("Drive can read and write DVD+MRW"); - else if (ftr.Write && ftr.DVDPRead) + else if(ftr.Write && ftr.DVDPRead) sb.Append("Drive and read DVD+MRW and read and write CD-MRW"); - else if (ftr.Write) + else if(ftr.Write) sb.Append("Drive can read and write CD-MRW"); - else if (ftr.DVDPRead) + else if(ftr.DVDPRead) sb.Append("Drive can read CD-MRW and DVD+MRW"); else sb.Append("Drive can read CD-MRW"); @@ -4548,7 +4548,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0029(Feature_0029? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0029 ftr = feature.Value; @@ -4556,14 +4556,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Enhanced Defect Reporting Feature:"); - if (ftr.DRTDM) + if(ftr.DRTDM) sb.AppendLine("\tDrive supports DRT-DM mode"); else sb.AppendLine("\tDrive supports Persistent-DM mode"); - if (ftr.DBICacheZones > 0) + if(ftr.DBICacheZones > 0) sb.AppendFormat("\tDrive has {0} DBI cache zones", ftr.DBICacheZones).AppendLine(); - if (ftr.Entries > 0) + if(ftr.Entries > 0) sb.AppendFormat("\tDrive has {0} DBI entries", ftr.Entries).AppendLine(); return sb.ToString(); @@ -4571,30 +4571,30 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_002A(Feature_002A? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_002A ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.Write) + if(ftr.Write) { sb.Append("Drive can read and write DVD+RW"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); - if (ftr.CloseOnly) + if(ftr.CloseOnly) sb.AppendLine("\tDrive supports only the read compatibility stop"); else sb.AppendLine("\tDrive supports both forms of background format stopping"); - if (ftr.QuickStart) + if(ftr.QuickStart) sb.AppendLine("\tDrive can do a quick start formatting"); } else { sb.Append("Drive can read DVD+RW"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -4605,16 +4605,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_002B(Feature_002B? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_002B ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.Write) + if(ftr.Write) { sb.Append("Drive can read and write DVD+R"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -4622,7 +4622,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC else { sb.Append("Drive can read DVD+R"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -4633,25 +4633,25 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_002C(Feature_002C? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_002C ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC Rigid Restricted Overwrite"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current):"); else sb.AppendLine(":"); - if (ftr.Blank) + if(ftr.Blank) sb.AppendLine("\tDrive supports the BLANK command"); - if (ftr.Intermediate) + if(ftr.Intermediate) sb.AppendLine("\tDrive supports writing on an intermediate state session and quick formatting"); - if (ftr.DSDR) + if(ftr.DSDR) sb.AppendLine("\tDrive can read Defect Status data recorded on the medium"); - if (ftr.DSDG) + if(ftr.DSDG) sb.AppendLine("\tDrive can generate Defect Status data during formatting"); return sb.ToString(); @@ -4659,7 +4659,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_002D(Feature_002D? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_002D ftr = feature.Value; @@ -4667,7 +4667,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("Drive can write CDs in Track at Once Mode:"); - if (ftr.RWSubchannel) + if(ftr.RWSubchannel) { sb.AppendLine("\tDrive can write user provided data in the R-W subchannels"); if(ftr.RWRaw) @@ -4677,14 +4677,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC } - if (ftr.CDRW) + if(ftr.CDRW) sb.AppendLine("\tDrive can overwrite a TAO track with another in CD-RWs"); - if (ftr.TestWrite) + if(ftr.TestWrite) sb.AppendLine("\tDrive can do a test writing"); - if (ftr.BUF) + if(ftr.BUF) sb.AppendLine("\tDrive supports zero loss linking"); - if (ftr.DataTypeSupported > 0) + if(ftr.DataTypeSupported > 0) { sb.Append("\tDrive supports data block types:"); if((ftr.DataTypeSupported & 0x0001) == 0x0001) @@ -4727,33 +4727,33 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_002E(Feature_002E? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_002E ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.SAO && !ftr.RAW) + if(ftr.SAO && !ftr.RAW) sb.AppendLine("Drive can write CDs in Session at Once Mode:"); - else if (!ftr.SAO && ftr.RAW) + else if(!ftr.SAO && ftr.RAW) sb.AppendLine("Drive can write CDs in raw Mode:"); else sb.AppendLine("Drive can write CDs in Session at Once and in Raw Modes:"); - if (ftr.RAW && ftr.RAWMS) + if(ftr.RAW && ftr.RAWMS) sb.AppendLine("\tDrive can write multi-session CDs in raw mode"); - if (ftr.RW) + if(ftr.RW) sb.AppendLine("\tDrive can write user provided data in the R-W subchannels"); - if (ftr.CDRW) + if(ftr.CDRW) sb.AppendLine("\tDrive can write CD-RWs"); - if (ftr.TestWrite) + if(ftr.TestWrite) sb.AppendLine("\tDrive can do a test writing"); - if (ftr.BUF) + if(ftr.BUF) sb.AppendLine("\tDrive supports zero loss linking"); - if (ftr.MaxCueSheet > 0) + if(ftr.MaxCueSheet > 0) sb.AppendFormat("\tDrive supports a maximum of {0} bytes in a single cue sheet", ftr.MaxCueSheet).AppendLine(); return sb.ToString(); @@ -4761,24 +4761,24 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_002F(Feature_002F? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_002F ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.DVDRW && ftr.RDL) + if(ftr.DVDRW && ftr.RDL) sb.AppendLine("Drive supports writing DVD-R, DVD-RW and DVD-R DL"); - else if (ftr.RDL) + else if(ftr.RDL) sb.AppendLine("Drive supports writing DVD-R and DVD-R DL"); - else if (ftr.DVDRW) + else if(ftr.DVDRW) sb.AppendLine("Drive supports writing DVD-R and DVD-RW"); else sb.AppendLine("Drive supports writing DVD-R"); - if (ftr.TestWrite) + if(ftr.TestWrite) sb.AppendLine("\tDrive can do a test writing"); - if (ftr.BUF) + if(ftr.BUF) sb.AppendLine("\tDrive supports zero loss linking"); return sb.ToString(); @@ -4791,7 +4791,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0031(Feature_0031? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0031 ftr = feature.Value; @@ -4799,7 +4799,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("Drive supports writing DDCD-R"); - if (ftr.TestWrite) + if(ftr.TestWrite) sb.AppendLine("\tDrive can do a test writing"); return sb.ToString(); @@ -4807,7 +4807,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0032(Feature_0032? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0032 ftr = feature.Value; @@ -4815,9 +4815,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("Drive supports writing DDCD-RW"); - if (ftr.Blank) + if(ftr.Blank) sb.AppendLine("\tDrive supports the BLANK command"); - if (ftr.Intermediate) + if(ftr.Intermediate) sb.AppendLine("\tDrive supports quick formatting"); return sb.ToString(); @@ -4825,7 +4825,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0033(Feature_0033? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0033 ftr = feature.Value; @@ -4833,9 +4833,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Layer Jump Recording:"); - if (ftr.LinkSizes != null) + if(ftr.LinkSizes != null) { - foreach (byte link in ftr.LinkSizes) + foreach(byte link in ftr.LinkSizes) sb.AppendFormat("\tCurrent media has a {0} bytes link available", link).AppendLine(); } @@ -4849,31 +4849,31 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0037(Feature_0037? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0037 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.AppendLine("Drive can write CD-RW"); - if (ftr.SubtypeSupport > 0) + if(ftr.SubtypeSupport > 0) { sb.Append("\tDrive supports CD-RW subtypes"); - if ((ftr.SubtypeSupport & 0x01) == 0x01) + if((ftr.SubtypeSupport & 0x01) == 0x01) sb.Append(" 0"); - if ((ftr.SubtypeSupport & 0x02) == 0x02) + if((ftr.SubtypeSupport & 0x02) == 0x02) sb.Append(" 1"); - if ((ftr.SubtypeSupport & 0x04) == 0x04) + if((ftr.SubtypeSupport & 0x04) == 0x04) sb.Append(" 2"); - if ((ftr.SubtypeSupport & 0x08) == 0x08) + if((ftr.SubtypeSupport & 0x08) == 0x08) sb.Append(" 3"); - if ((ftr.SubtypeSupport & 0x10) == 0x10) + if((ftr.SubtypeSupport & 0x10) == 0x10) sb.Append(" 4"); - if ((ftr.SubtypeSupport & 0x20) == 0x20) + if((ftr.SubtypeSupport & 0x20) == 0x20) sb.Append(" 5"); - if ((ftr.SubtypeSupport & 0x40) == 0x40) + if((ftr.SubtypeSupport & 0x40) == 0x40) sb.Append(" 6"); - if ((ftr.SubtypeSupport & 0x80) == 0x80) + if((ftr.SubtypeSupport & 0x80) == 0x80) sb.Append(" 7"); sb.AppendLine(); } @@ -4888,30 +4888,30 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_003A(Feature_003A? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_003A ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.Write) + if(ftr.Write) { sb.Append("Drive can read and write DVD+RW DL"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); - if (ftr.CloseOnly) + if(ftr.CloseOnly) sb.AppendLine("\tDrive supports only the read compatibility stop"); else sb.AppendLine("\tDrive supports both forms of background format stopping"); - if (ftr.QuickStart) + if(ftr.QuickStart) sb.AppendLine("\tDrive can do a quick start formatting"); } else { sb.Append("Drive can read DVD+RW DL"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -4922,16 +4922,16 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_003B(Feature_003B? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_003B ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.Write) + if(ftr.Write) { sb.Append("Drive can read and write DVD+R DL"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -4939,7 +4939,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC else { sb.Append("Drive can read DVD+R DL"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -4950,34 +4950,34 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0040(Feature_0040? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0040 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC BD Read"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current):"); else sb.AppendLine(":"); - if (ftr.OldROM) + if(ftr.OldROM) sb.AppendLine("\tDrive can read BD-ROM pre-1.0"); - if (ftr.ROM) + if(ftr.ROM) sb.AppendLine("\tDrive can read BD-ROM Ver.1"); - if (ftr.OldR) + if(ftr.OldR) sb.AppendLine("\tDrive can read BD-R pre-1.0"); - if (ftr.R) + if(ftr.R) sb.AppendLine("\tDrive can read BD-R Ver.1"); - if (ftr.OldRE) + if(ftr.OldRE) sb.AppendLine("\tDrive can read BD-RE pre-1.0"); - if (ftr.RE1) + if(ftr.RE1) sb.AppendLine("\tDrive can read BD-RE Ver.1"); - if (ftr.RE2) + if(ftr.RE2) sb.AppendLine("\tDrive can read BD-RE Ver.2"); - if (ftr.BCA) + if(ftr.BCA) sb.AppendLine("\tDrive can read BD's Burst Cutting Area"); return sb.ToString(); @@ -4985,30 +4985,30 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0041(Feature_0041? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0041 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("MMC BD Write"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current):"); else sb.AppendLine(":"); - if (ftr.OldR) + if(ftr.OldR) sb.AppendLine("\tDrive can write BD-R pre-1.0"); - if (ftr.R) + if(ftr.R) sb.AppendLine("\tDrive can write BD-R Ver.1"); - if (ftr.OldRE) + if(ftr.OldRE) sb.AppendLine("\tDrive can write BD-RE pre-1.0"); - if (ftr.RE1) + if(ftr.RE1) sb.AppendLine("\tDrive can write BD-RE Ver.1"); - if (ftr.RE2) + if(ftr.RE2) sb.AppendLine("\tDrive can write BD-RE Ver.2"); - if (ftr.SVNR) + if(ftr.SVNR) sb.AppendLine("\tDrive supports write without verify requirement"); return sb.ToString(); @@ -5021,22 +5021,22 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0050(Feature_0050? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0050 ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.HDDVDR && ftr.HDDVDRAM) + if(ftr.HDDVDR && ftr.HDDVDRAM) sb.Append("Drive can read HD DVD-ROM, HD DVD-RW, HD DVD-R and HD DVD-RAM"); - else if (ftr.HDDVDR) + else if(ftr.HDDVDR) sb.Append("Drive can read HD DVD-ROM, HD DVD-RW and HD DVD-R"); - else if (ftr.HDDVDRAM) + else if(ftr.HDDVDRAM) sb.Append("Drive can read HD DVD-ROM, HD DVD-RW and HD DVD-RAM"); else sb.Append("Drive can read HD DVD-ROM and HD DVD-RW"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -5046,22 +5046,22 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0051(Feature_0051? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0051 ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.HDDVDR && ftr.HDDVDRAM) + if(ftr.HDDVDR && ftr.HDDVDRAM) sb.Append("Drive can write HD DVD-RW, HD DVD-R and HD DVD-RAM"); - else if (ftr.HDDVDR) + else if(ftr.HDDVDR) sb.Append("Drive can write HD DVD-RW and HD DVD-R"); - else if (ftr.HDDVDRAM) + else if(ftr.HDDVDRAM) sb.Append("Drive can write HD DVD-RW and HD DVD-RAM"); else sb.Append("Drive can write HD DVD-RW"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); @@ -5071,19 +5071,19 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0080(Feature_0080? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0080 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("Drive is able to access Hybrid discs"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); - if (ftr.RI) + if(ftr.RI) sb.AppendLine("\tDrive is able to maintain the online format layer through reset and power cycling"); return sb.ToString(); @@ -5096,14 +5096,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0101(Feature_0101? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0101 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.AppendLine("Drive supports S.M.A.R.T."); - if (ftr.PP) + if(ftr.PP) sb.AppendLine("\tDrive supports the Informational Exceptions Control mode page 1Ch"); return sb.ToString(); @@ -5111,7 +5111,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0102(Feature_0102? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0102 ftr = feature.Value; @@ -5119,9 +5119,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Embedded Changer:"); - if (ftr.SCC) + if(ftr.SCC) sb.AppendLine("\tDrive can change disc side"); - if (ftr.SDP) + if(ftr.SDP) sb.AppendLine("\tDrive is able to report slots contents after a reset or change"); sb.AppendFormat("\tDrive has {0} slots", ftr.HighestSlotNumber + 1).AppendLine(); @@ -5131,7 +5131,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0103(Feature_0103? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0103 ftr = feature.Value; @@ -5139,11 +5139,11 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("Drive has an analogue audio output"); - if (ftr.Scan) + if(ftr.Scan) sb.AppendLine("\tDrive supports the SCAN command"); - if (ftr.SCM) + if(ftr.SCM) sb.AppendLine("\tDrive is able to mute channels separately"); - if (ftr.SV) + if(ftr.SV) sb.AppendLine("\tDrive supports separate volume per channel"); sb.AppendFormat("\tDrive has {0} volume levels", ftr.VolumeLevels + 1).AppendLine(); @@ -5153,14 +5153,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0104(Feature_0104? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0104 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.AppendLine("Drive supports Microcode Upgrade"); - if (ftr.M5) + if(ftr.M5) sb.AppendLine("Drive supports validating the 5-bit Mode of the READ BUFFER and WRITE BUFFER commands"); return sb.ToString(); @@ -5168,7 +5168,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0105(Feature_0105? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0105 ftr = feature.Value; @@ -5176,10 +5176,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("Drive supports Timeout & Protect mode page 1Dh"); - if (ftr.Group3) + if(ftr.Group3) { sb.AppendLine("\tDrive supports the Group3 in Timeout & Protect mode page 1Dh"); - if (ftr.UnitLength > 0) + if(ftr.UnitLength > 0) sb.AppendFormat("\tDrive has {0} increase of Group 3 time unit", ftr.UnitLength).AppendLine(); } @@ -5188,14 +5188,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0106(Feature_0106? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0106 ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.AppendFormat("Drive supports DVD CSS/CPPM version {0}", ftr.CSSVersion); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" and current disc is encrypted"); else sb.AppendLine(); @@ -5205,7 +5205,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0107(Feature_0107? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0107 ftr = feature.Value; @@ -5213,17 +5213,17 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("MMC Real Time Streaming:"); - if (ftr.SMP) + if(ftr.SMP) sb.AppendLine("\tDrive supports Set Minimum Performance with the SET STREAMING command"); - if (ftr.RBCB) + if(ftr.RBCB) sb.AppendLine("\tDrive supports the block bit in the READ BUFFER CAPACITY command"); - if (ftr.SCS) + if(ftr.SCS) sb.AppendLine("\tDrive supports the SET CD SPEED command"); - if (ftr.MP2A) + if(ftr.MP2A) sb.AppendLine("\tDrive supports the Write Speed Performance Descriptor Blocks in the MMC mode page 2Ah"); - if (ftr.WSPD) + if(ftr.WSPD) sb.AppendLine("\tDrive supports the Write Speed data of GET PERFORMANCE and the WRC field of SET STREAMING"); - if (ftr.SW) + if(ftr.SW) sb.AppendLine("\tDrive supports stream recording"); return sb.ToString(); @@ -5231,7 +5231,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0108(Feature_0108? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0108 ftr = feature.Value; @@ -5249,15 +5249,15 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_010A(Feature_010A? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_010A ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.DCBs != null) + if(ftr.DCBs != null) { - foreach (uint DCB in ftr.DCBs) + foreach(uint DCB in ftr.DCBs) sb.AppendFormat("Drive supports DCB {0:X8}h", DCB).AppendLine(); } @@ -5266,14 +5266,14 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_010B(Feature_010B? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_010B ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.AppendFormat("Drive supports DVD CPRM version {0}", ftr.CPRMVersion); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" and current disc is or can be encrypted"); else sb.AppendLine(); @@ -5283,7 +5283,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_010C(Feature_010C? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_010C ftr = feature.Value; @@ -5336,33 +5336,33 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_010D(Feature_010D? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_010D ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.AppendFormat("Drive supports AACS version {0}", ftr.AACSVersion); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" and current disc is encrypted"); else sb.AppendLine(); - if (ftr.RDC) + if(ftr.RDC) sb.AppendLine("\tDrive supports reading the Drive Certificate"); - if (ftr.RMC) + if(ftr.RMC) sb.AppendLine("\tDrive supports reading Media Key Block of CPRM"); - if (ftr.WBE) + if(ftr.WBE) sb.AppendLine("\tDrive supports writing with bus encryption"); - if (ftr.BEC) + if(ftr.BEC) sb.AppendLine("\tDrive supports bus encryption"); - if (ftr.BNG) + if(ftr.BNG) { sb.AppendLine("\tDrive supports generating the binding nonce"); - if (ftr.BindNonceBlocks > 0) + if(ftr.BindNonceBlocks > 0) sb.AppendFormat("\t{0} media blocks are required for the binding nonce", ftr.BindNonceBlocks).AppendLine(); } - if (ftr.AGIDs > 0) + if(ftr.AGIDs > 0) sb.AppendFormat("\tDrive supports {0} AGIDs concurrently", ftr.AGIDs).AppendLine(); return sb.ToString(); @@ -5370,19 +5370,19 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_010E(Feature_010E? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_010E ftr = feature.Value; StringBuilder sb = new StringBuilder(); sb.Append("Drive supports DVD-Download"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine(" (current)"); else sb.AppendLine(); - if (ftr.MaxScrambleExtent > 0) + if(ftr.MaxScrambleExtent > 0) sb.AppendFormat("\tMaximum {0} scranble extent information entries", ftr.MaxScrambleExtent).AppendLine(); return sb.ToString(); @@ -5390,13 +5390,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0110(Feature_0110? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0110 ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.Current) + if(ftr.Current) sb.AppendLine("Drive and currently inserted media support VCPS"); else sb.AppendLine("Drive supports VCPS"); @@ -5406,13 +5406,13 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0113(Feature_0113? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0113 ftr = feature.Value; StringBuilder sb = new StringBuilder(); - if (ftr.Current) + if(ftr.Current) sb.AppendLine("Drive and currently inserted media support SecurDisc"); else sb.AppendLine("Drive supports SecurDisc"); @@ -5422,7 +5422,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC public static string Prettify_0142(Feature_0142? feature) { - if (!feature.HasValue) + if(!feature.HasValue) return null; Feature_0142 ftr = feature.Value; @@ -5430,18 +5430,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC sb.AppendLine("Drive supports the Trusted Computing Group Optical Security Subsystem Class"); - if (ftr.Current) + if(ftr.Current) sb.AppendLine("\tCurrent media is initialized with TCG OSSC"); - if (ftr.PSAU) + if(ftr.PSAU) sb.AppendLine("\tDrive supports PSA updates on write-once media"); - if (ftr.LOSPB) + if(ftr.LOSPB) sb.AppendLine("\tDrive supports linked OSPBs"); - if (ftr.ME) + if(ftr.ME) sb.AppendLine("\tDrive will only record on the OSSC Disc Format"); - if (ftr.Profiles != null) + if(ftr.Profiles != null) { - for (int i = 0; i < ftr.Profiles.Length; i++) + for(int i = 0; i < ftr.Profiles.Length; i++) sb.AppendFormat("\tProfile {0}: {1}", i, ftr.Profiles[i]).AppendLine(); } @@ -5759,7 +5759,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC uint offset = 8; List descLst = new List(); - while (offset < response.Length) + while(offset < response.Length) { FeatureDescriptor desc = new FeatureDescriptor(); desc.Code = (ushort)((response[offset + 0] << 8) + response[offset + 1]); diff --git a/SCSI/MMC/Hybrid.cs b/SCSI/MMC/Hybrid.cs index 47ddd09..e3df480 100644 --- a/SCSI/MMC/Hybrid.cs +++ b/SCSI/MMC/Hybrid.cs @@ -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; } diff --git a/SCSI/MMC/WriteProtect.cs b/SCSI/MMC/WriteProtect.cs index 0878cc5..859f26f 100644 --- a/SCSI/MMC/WriteProtect.cs +++ b/SCSI/MMC/WriteProtect.cs @@ -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(); } diff --git a/SCSI/Modes.cs b/SCSI/Modes.cs index 09bf1d7..0ed07d9 100644 --- a/SCSI/Modes.cs +++ b/SCSI/Modes.cs @@ -63,16 +63,16 @@ namespace DiscImageChef.Decoders.SCSI public static ModeHeader? DecodeModeHeader6(byte[] modeResponse, PeripheralDeviceTypes deviceType) { - if (modeResponse == null || modeResponse.Length < 4 || modeResponse.Length < modeResponse[0] + 1) + if(modeResponse == null || modeResponse.Length < 4 || modeResponse.Length < modeResponse[0] + 1) return null; ModeHeader header = new ModeHeader(); header.MediumType = (MediumTypes)modeResponse[1]; - if (modeResponse[3] > 0) + if(modeResponse[3] > 0) { header.BlockDescriptors = new BlockDescriptor[modeResponse[3] / 8]; - for (int i = 0; i < header.BlockDescriptors.Length; i++) + for(int i = 0; i < header.BlockDescriptors.Length; i++) { header.BlockDescriptors[i].Density = (DensityType)modeResponse[0 + i * 8 + 4]; header.BlockDescriptors[i].Blocks += (ulong)(modeResponse[1 + i * 8 + 4] << 16); @@ -84,23 +84,23 @@ namespace DiscImageChef.Decoders.SCSI } } - if (deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice) + if(deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice) { header.WriteProtected = ((modeResponse[2] & 0x80) == 0x80); header.DPOFUA = ((modeResponse[2] & 0x10) == 0x10); } - if (deviceType == PeripheralDeviceTypes.SequentialAccess) + if(deviceType == PeripheralDeviceTypes.SequentialAccess) { header.WriteProtected = ((modeResponse[2] & 0x80) == 0x80); header.Speed = (byte)(modeResponse[2] & 0x0F); header.BufferedMode = (byte)((modeResponse[2] & 0x70) >> 4); } - if (deviceType == PeripheralDeviceTypes.PrinterDevice) + if(deviceType == PeripheralDeviceTypes.PrinterDevice) header.BufferedMode = (byte)((modeResponse[2] & 0x70) >> 4); - if (deviceType == PeripheralDeviceTypes.OpticalDevice) + if(deviceType == PeripheralDeviceTypes.OpticalDevice) { header.WriteProtected = ((modeResponse[2] & 0x80) == 0x80); header.EBC = ((modeResponse[2] & 0x01) == 0x01); @@ -117,23 +117,23 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModeHeader(ModeHeader? header, PeripheralDeviceTypes deviceType) { - if (!header.HasValue) + if(!header.HasValue) return null; StringBuilder sb = new StringBuilder(); sb.AppendLine("SCSI Mode Sense Header:"); - switch (deviceType) + switch(deviceType) { #region Direct access device mode header case PeripheralDeviceTypes.DirectAccess: { - if (header.Value.MediumType != MediumTypes.Default) + if(header.Value.MediumType != MediumTypes.Default) { sb.Append("\tMedium is "); - switch (header.Value.MediumType) + switch(header.Value.MediumType) { case MediumTypes.ECMA54: sb.AppendLine("ECMA-54: 200 mm Flexible Disk Cartridge using Two-Frequency Recording at 13262 ftprad on One Side"); @@ -213,18 +213,18 @@ namespace DiscImageChef.Decoders.SCSI } } - if (header.Value.WriteProtected) + if(header.Value.WriteProtected) sb.AppendLine("\tMedium is write protected"); - if (header.Value.DPOFUA) + if(header.Value.DPOFUA) sb.AppendLine("\tDrive supports DPO and FUA bits"); - if (header.Value.BlockDescriptors != null) + if(header.Value.BlockDescriptors != null) { - foreach (BlockDescriptor descriptor in header.Value.BlockDescriptors) + foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors) { string density = ""; - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: break; @@ -242,16 +242,16 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (density != "") + if(density != "") { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) sb.AppendFormat("\tAll remaining blocks have {0} and are {1} bytes each", density, descriptor.BlockLength).AppendLine(); else sb.AppendFormat("\t{0} blocks have {1} and are {2} bytes each", descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); } else { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength).AppendLine(); else sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks, descriptor.BlockLength).AppendLine(); @@ -261,11 +261,11 @@ namespace DiscImageChef.Decoders.SCSI break; } - #endregion Direct access device mode header - #region Sequential access device mode header + #endregion Direct access device mode header + #region Sequential access device mode header case PeripheralDeviceTypes.SequentialAccess: { - switch (header.Value.BufferedMode) + switch(header.Value.BufferedMode) { case 0: sb.AppendLine("\tDevice writes directly to media"); @@ -281,17 +281,17 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (header.Value.Speed == 0) + if(header.Value.Speed == 0) sb.AppendLine("\tDevice uses default speed"); else sb.AppendFormat("\tDevice uses speed {0}", header.Value.Speed).AppendLine(); - if (header.Value.WriteProtected) + if(header.Value.WriteProtected) sb.AppendLine("\tMedium is write protected"); string medium = ""; - switch (header.Value.MediumType) + switch(header.Value.MediumType) { case MediumTypes.Default: medium = "undefined"; @@ -474,16 +474,16 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendFormat("\tMedium is {0}", medium).AppendLine(); - if (header.Value.BlockDescriptors != null) + if(header.Value.BlockDescriptors != null) { - foreach (BlockDescriptor descriptor in header.Value.BlockDescriptors) + foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors) { string density = ""; - switch (header.Value.MediumType) + switch(header.Value.MediumType) { case MediumTypes.Default: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: break; @@ -560,28 +560,28 @@ namespace DiscImageChef.Decoders.SCSI density = "IBM 3490E"; break; case DensityType.LTO1: - //case DensityType.SAIT1: + //case DensityType.SAIT1: density = "LTO Ultrium or Super AIT-1"; break; case DensityType.LTO2Old: density = "LTO Ultrium-2"; break; case DensityType.LTO2: - //case DensityType.T9840: + //case DensityType.T9840: density = "LTO Ultrium-2 or T9840"; break; case DensityType.T9940: density = "T9940"; break; case DensityType.LTO3: - //case DensityType.T9940: + //case DensityType.T9940: density = "LTO Ultrium-3 or T9940"; break; case DensityType.T9840C: density = "T9840C"; break; case DensityType.LTO4: - //case DensityType.T9840D: + //case DensityType.T9840D: density = "LTO Ultrium-4 or T9840D"; break; case DensityType.T10000A: @@ -613,7 +613,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.LTOWORM: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "LTO Ultrium cleaning cartridge"; @@ -631,11 +631,11 @@ namespace DiscImageChef.Decoders.SCSI density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); break; } - } - break; + } + break; case MediumTypes.LTO: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO1: density = "LTO Ultrium"; @@ -648,7 +648,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.LTO2: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO2: density = "LTO Ultrium-2"; @@ -661,7 +661,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.DDS3: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "MLR1-26GB"; @@ -677,7 +677,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.DDS4: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "DC-9200"; @@ -693,7 +693,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.DAT72: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.DAT72: density = "DAT-72"; @@ -707,7 +707,7 @@ namespace DiscImageChef.Decoders.SCSI case MediumTypes.LTO3: case MediumTypes.LTO3WORM: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO3: density = "LTO Ultrium-3"; @@ -720,7 +720,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.DDSCleaning: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "DDS cleaning cartridge"; @@ -734,7 +734,7 @@ namespace DiscImageChef.Decoders.SCSI case MediumTypes.LTO4: case MediumTypes.LTO4WORM: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO4: density = "LTO Ultrium-4"; @@ -748,7 +748,7 @@ namespace DiscImageChef.Decoders.SCSI case MediumTypes.LTO5: case MediumTypes.LTO5WORM: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO5: density = "LTO Ultrium-5"; @@ -762,7 +762,7 @@ namespace DiscImageChef.Decoders.SCSI case MediumTypes.LTO6: case MediumTypes.LTO6WORM: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO6: density = "LTO Ultrium-6"; @@ -776,7 +776,7 @@ namespace DiscImageChef.Decoders.SCSI case MediumTypes.LTO7: case MediumTypes.LTO7WORM: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO7: density = "LTO Ultrium-7"; @@ -789,7 +789,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.LTOCD: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.LTO2: density = "LTO Ultrium-2 in CD emulation mode"; @@ -811,7 +811,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape15m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -845,7 +845,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape28m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -888,7 +888,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape54m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -926,7 +926,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape80m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -958,7 +958,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape106m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -1012,7 +1012,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape106mXL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -1034,7 +1034,7 @@ namespace DiscImageChef.Decoders.SCSI density = "Super DLTtape I at 133000 bpi"; break; case DensityType.SDLT1: - //case DensityType.SDLT1Alt: + //case DensityType.SDLT1Alt: density = "Super DLTtape I"; break; case DensityType.SDLT1c: @@ -1051,7 +1051,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SDLT2: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.SDLT2: density = "Super DLTtape II"; @@ -1064,7 +1064,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.VStapeI: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.VStape1: case DensityType.VStape1Alt: @@ -1081,7 +1081,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.DLTtapeS4: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.DLTS4: density = "DLTtape S4"; @@ -1094,7 +1094,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape22m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -1116,7 +1116,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape40m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -1141,7 +1141,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape76m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -1166,7 +1166,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.Exatape112m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Ex8200: density = "EXB-8200"; @@ -1197,7 +1197,7 @@ namespace DiscImageChef.Decoders.SCSI case MediumTypes.Exatape150m: case MediumTypes.Exatape75m: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Mammoth: density = "Mammoth"; @@ -1213,7 +1213,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.DC2900SL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "DC-2900SL"; @@ -1226,7 +1226,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.DC9250: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "DC-9250"; @@ -1239,7 +1239,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLR32: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLR-32"; @@ -1252,7 +1252,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.MLR1SL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "MRL1-26GBSL"; @@ -1265,7 +1265,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape50: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-50"; @@ -1278,7 +1278,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape50SL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-50 SL"; @@ -1291,7 +1291,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLR32SL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLR-32 SL"; @@ -1304,7 +1304,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLR5: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLR-5"; @@ -1317,7 +1317,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLR5SL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLR-5 SL"; @@ -1330,7 +1330,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape7: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-7"; @@ -1343,7 +1343,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape7SL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-7 SL"; @@ -1356,7 +1356,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape24: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-24"; @@ -1369,7 +1369,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape24SL: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-24 SL"; @@ -1382,7 +1382,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape140: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-140"; @@ -1395,7 +1395,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape40: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-40"; @@ -1408,7 +1408,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape60: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-60 or SLRtape-75"; @@ -1421,7 +1421,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLRtape100: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLRtape-100"; @@ -1434,7 +1434,7 @@ namespace DiscImageChef.Decoders.SCSI break; case MediumTypes.SLR40_60_100: { - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: density = "SLR40, SLR60 or SLR100"; @@ -1445,23 +1445,23 @@ namespace DiscImageChef.Decoders.SCSI } } break; - default: - density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); - break; + default: + density = String.Format("unknown density code 0x{0:X2}", descriptor.Density); + break; } - if (density != "") + if(density != "") { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\tAll remaining blocks conform to {0} and have a variable length", density).AppendLine(); else sb.AppendFormat("\tAll remaining blocks conform to {0} and are {1} bytes each", density, descriptor.BlockLength).AppendLine(); } else { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\t{0} blocks conform to {1} and have a variable length", descriptor.Blocks, density).AppendLine(); else sb.AppendFormat("\t{0} blocks conform to {1} and are {2} bytes each", descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); @@ -1469,16 +1469,16 @@ namespace DiscImageChef.Decoders.SCSI } else { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\tAll remaining blocks have a variable length").AppendLine(); else sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength).AppendLine(); } else { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks).AppendLine(); else sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks, descriptor.BlockLength).AppendLine(); @@ -1493,7 +1493,7 @@ namespace DiscImageChef.Decoders.SCSI #region Printer device mode header case PeripheralDeviceTypes.PrinterDevice: { - switch (header.Value.BufferedMode) + switch(header.Value.BufferedMode) { case 0: sb.AppendLine("\tDevice prints directly"); @@ -1511,11 +1511,11 @@ namespace DiscImageChef.Decoders.SCSI #region Optical device mode header case PeripheralDeviceTypes.OpticalDevice: { - if (header.Value.MediumType != MediumTypes.Default) + if(header.Value.MediumType != MediumTypes.Default) { sb.Append("\tMedium is "); - switch (header.Value.MediumType) + switch(header.Value.MediumType) { case MediumTypes.ReadOnly: sb.AppendLine("a Read-only optical"); @@ -1544,19 +1544,19 @@ namespace DiscImageChef.Decoders.SCSI } } - if (header.Value.WriteProtected) + if(header.Value.WriteProtected) sb.AppendLine("\tMedium is write protected"); - if (header.Value.EBC) + if(header.Value.EBC) sb.AppendLine("\tBlank checking during write is enabled"); - if (header.Value.DPOFUA) + if(header.Value.DPOFUA) sb.AppendLine("\tDrive supports DPO and FUA bits"); - if (header.Value.BlockDescriptors != null) + if(header.Value.BlockDescriptors != null) { - foreach (BlockDescriptor descriptor in header.Value.BlockDescriptors) + foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors) { string density = ""; - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: break; @@ -1592,18 +1592,18 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (density != "") + if(density != "") { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\tAll remaining blocks are {0} and have a variable length", density).AppendLine(); else sb.AppendFormat("\tAll remaining blocks are {0} and are {1} bytes each", density, descriptor.BlockLength).AppendLine(); } else { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\t{0} blocks are {1} and have a variable length", descriptor.Blocks, density).AppendLine(); else sb.AppendFormat("\t{0} blocks are {1} and are {2} bytes each", descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); @@ -1611,16 +1611,16 @@ namespace DiscImageChef.Decoders.SCSI } else { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\tAll remaining blocks have a variable length").AppendLine(); else sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength).AppendLine(); } else { - if (descriptor.BlockLength == 0) + if(descriptor.BlockLength == 0) sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks).AppendLine(); else sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks, descriptor.BlockLength).AppendLine(); @@ -1631,13 +1631,13 @@ namespace DiscImageChef.Decoders.SCSI break; } - #endregion Optical device mode header - #region Multimedia device mode header + #endregion Optical device mode header + #region Multimedia device mode header case PeripheralDeviceTypes.MultiMediaDevice: { sb.Append("\tMedium is "); - switch (header.Value.MediumType) + switch(header.Value.MediumType) { case MediumTypes.CDROM: sb.AppendLine("120 mm CD-ROM"); @@ -1752,18 +1752,18 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (header.Value.WriteProtected) + if(header.Value.WriteProtected) sb.AppendLine("\tMedium is write protected"); - if (header.Value.DPOFUA) + if(header.Value.DPOFUA) sb.AppendLine("\tDrive supports DPO and FUA bits"); - if (header.Value.BlockDescriptors != null) + if(header.Value.BlockDescriptors != null) { - foreach (BlockDescriptor descriptor in header.Value.BlockDescriptors) + foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors) { string density = ""; - switch (descriptor.Density) + switch(descriptor.Density) { case DensityType.Default: break; @@ -1796,16 +1796,16 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (density != "") + if(density != "") { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) sb.AppendFormat("\tAll remaining blocks have {0} and are {1} bytes each", density, descriptor.BlockLength).AppendLine(); else sb.AppendFormat("\t{0} blocks have {1} and are {2} bytes each", descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); } else { - if (descriptor.Blocks == 0) + if(descriptor.Blocks == 0) sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength).AppendLine(); else sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks, descriptor.BlockLength).AppendLine(); @@ -1815,7 +1815,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - #endregion Multimedia device mode header + #endregion Multimedia device mode header default: break; } @@ -1825,7 +1825,7 @@ namespace DiscImageChef.Decoders.SCSI public static ModeHeader? DecodeModeHeader10(byte[] modeResponse, PeripheralDeviceTypes deviceType) { - if (modeResponse == null || modeResponse.Length < 8) + if(modeResponse == null || modeResponse.Length < 8) return null; ushort modeLength; @@ -1834,7 +1834,7 @@ namespace DiscImageChef.Decoders.SCSI modeLength = (ushort)((modeResponse[0] << 8) + modeResponse[1]); blockDescLength = (ushort)((modeResponse[6] << 8) + modeResponse[7]); - if (modeResponse.Length < modeLength) + if(modeResponse.Length < modeLength) return null; ModeHeader header = new ModeHeader(); @@ -1842,12 +1842,12 @@ namespace DiscImageChef.Decoders.SCSI bool longLBA = (modeResponse[4] & 0x01) == 0x01; - if (blockDescLength > 0) + if(blockDescLength > 0) { - if (longLBA) + if(longLBA) { header.BlockDescriptors = new BlockDescriptor[blockDescLength / 16]; - for (int i = 0; i < header.BlockDescriptors.Length; i++) + for(int i = 0; i < header.BlockDescriptors.Length; i++) { header.BlockDescriptors[i] = new BlockDescriptor(); header.BlockDescriptors[i].Density = DensityType.Default; @@ -1870,10 +1870,10 @@ namespace DiscImageChef.Decoders.SCSI else { header.BlockDescriptors = new BlockDescriptor[blockDescLength / 8]; - for (int i = 0; i < header.BlockDescriptors.Length; i++) + for(int i = 0; i < header.BlockDescriptors.Length; i++) { header.BlockDescriptors[i] = new BlockDescriptor(); - if (deviceType != PeripheralDeviceTypes.DirectAccess) + if(deviceType != PeripheralDeviceTypes.DirectAccess) { header.BlockDescriptors[i].Density = (DensityType)modeResponse[0 + i * 8 + 8]; } @@ -1892,23 +1892,23 @@ namespace DiscImageChef.Decoders.SCSI } } - if (deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice) + if(deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice) { header.WriteProtected = ((modeResponse[3] & 0x80) == 0x80); header.DPOFUA = ((modeResponse[3] & 0x10) == 0x10); } - if (deviceType == PeripheralDeviceTypes.SequentialAccess) + if(deviceType == PeripheralDeviceTypes.SequentialAccess) { header.WriteProtected = ((modeResponse[3] & 0x80) == 0x80); header.Speed = (byte)(modeResponse[3] & 0x0F); header.BufferedMode = (byte)((modeResponse[3] & 0x70) >> 4); } - if (deviceType == PeripheralDeviceTypes.PrinterDevice) + if(deviceType == PeripheralDeviceTypes.PrinterDevice) header.BufferedMode = (byte)((modeResponse[3] & 0x70) >> 4); - if (deviceType == PeripheralDeviceTypes.OpticalDevice) + if(deviceType == PeripheralDeviceTypes.OpticalDevice) { header.WriteProtected = ((modeResponse[3] & 0x80) == 0x80); header.EBC = ((modeResponse[3] & 0x01) == 0x01); @@ -2049,19 +2049,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_0A? DecodeModePage_0A(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x0A) + if((pageResponse[0] & 0x3F) != 0x0A) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 8) + if(pageResponse.Length < 8) return null; ModePage_0A decoded = new ModePage_0A(); @@ -2080,7 +2080,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.ReadyAENHoldOffPeriod = (ushort)((pageResponse[6] << 8) + pageResponse[7]); - if (pageResponse.Length < 10) + if(pageResponse.Length < 10) return decoded; // SPC-1 @@ -2120,7 +2120,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_0A(ModePage_0A? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_0A page = modePage.Value; @@ -2128,46 +2128,46 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Control mode page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.RLEC) + if(page.RLEC) sb.AppendLine("\tIf set, target shall report log exception conditions"); - if (page.DQue) + if(page.DQue) sb.AppendLine("\tTagged queuing is disabled"); - if (page.EECA) + if(page.EECA) sb.AppendLine("\tExtended Contingent Allegiance is enabled"); - if (page.RAENP) + if(page.RAENP) sb.AppendLine("\tTarget may issue an asynchronous event notification upon completing its initialization"); - if (page.UAAENP) + if(page.UAAENP) sb.AppendLine("\tTarget may issue an asynchronous event notification instead of a unit attention condition"); - if (page.EAENP) + if(page.EAENP) sb.AppendLine("\tTarget may issue an asynchronous event notification instead of a deferred error"); - if (page.GLTSD) + if(page.GLTSD) sb.AppendLine("\tGlobal logging target save disabled"); - if (page.RAC) + if(page.RAC) sb.AppendLine("\tCHECK CONDITION should be reported rather than a long busy condition"); - if (page.SWP) + if(page.SWP) sb.AppendLine("\tSoftware write protect is active"); - if (page.TAS) + if(page.TAS) sb.AppendLine("\tTasks aborted by other initiator's actions should be terminated with TASK ABORTED"); - if (page.TMF_ONLY) + if(page.TMF_ONLY) sb.AppendLine("\tAll tasks received in nexus with ACA ACTIVE is set and an ACA condition is established shall terminate"); - if (page.D_SENSE) + if(page.D_SENSE) sb.AppendLine("\tDevice shall return descriptor format sense data when returning sense data in the same transactions as a CHECK CONDITION"); - if (page.ATO) + if(page.ATO) sb.AppendLine("\tLOGICAL BLOCK APPLICATION TAG should not be modified"); - if (page.DPICZ) + if(page.DPICZ) sb.AppendLine("\tProtector information checking is disabled"); - if (page.NUAR) + if(page.NUAR) sb.AppendLine("\tNo unit attention on release"); - if (page.ATMPE) + if(page.ATMPE) sb.AppendLine("\tApplication Tag mode page is enabled"); - if (page.RWWP) + if(page.RWWP) sb.AppendLine("\tAbort any write command without protection information"); - if (page.SBLP) + if(page.SBLP) sb.AppendLine("\tSupportes block lengths and protection information"); - switch (page.TST) + switch(page.TST) { case 0: sb.AppendLine("\tThe logical unit maintains one task set for all nexuses"); @@ -2180,7 +2180,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - switch (page.QueueAlgorithm) + switch(page.QueueAlgorithm) { case 0: sb.AppendLine("\tCommands should be sent strictly ordered"); @@ -2193,7 +2193,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - switch (page.QErr) + switch(page.QErr) { case 0: sb.AppendLine("\tIf ACA is established, the task set commands shall resume after it is cleared, otherwise they shall terminate with CHECK CONDITION"); @@ -2209,7 +2209,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - switch (page.UA_INTLCK_CTRL) + switch(page.UA_INTLCK_CTRL) { case 0: sb.AppendLine("\tLUN shall clear unit attention condition reported in the same nexus"); @@ -2225,7 +2225,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - switch (page.AutoloadMode) + switch(page.AutoloadMode) { case 0: sb.AppendLine("\tOn medium insertion, it shall be loaded for full access"); @@ -2241,18 +2241,18 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.ReadyAENHoldOffPeriod > 0) + if(page.ReadyAENHoldOffPeriod > 0) sb.AppendFormat("\t{0} ms before attempting asynchronous event notifications after initialization", page.ReadyAENHoldOffPeriod).AppendLine(); - if (page.BusyTimeoutPeriod > 0) + if(page.BusyTimeoutPeriod > 0) { - if (page.BusyTimeoutPeriod == 0xFFFF) + if(page.BusyTimeoutPeriod == 0xFFFF) sb.AppendLine("\tThere is no limit on the maximum time that is allowed to remain busy"); else sb.AppendFormat("\tA maximum of {0} ms are allowed to remain busy", (int)page.BusyTimeoutPeriod * 100).AppendLine(); } - if (page.ExtendedSelfTestCompletionTime > 0) + if(page.ExtendedSelfTestCompletionTime > 0) sb.AppendFormat("\t{0} seconds to complete extended self-test", page.ExtendedSelfTestCompletionTime); return sb.ToString(); @@ -2322,19 +2322,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_02? DecodeModePage_02(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x02) + if((pageResponse[0] & 0x3F) != 0x02) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 16) + if(pageResponse.Length < 16) return null; ModePage_02 decoded = new ModePage_02(); @@ -2362,7 +2362,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_02(ModePage_02? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_02 page = modePage.Value; @@ -2370,29 +2370,29 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Disconnect-Reconnect mode page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.BufferFullRatio > 0) + if(page.BufferFullRatio > 0) sb.AppendFormat("\t{0} ratio of buffer that shall be full prior to attempting a reselection", page.BufferFullRatio).AppendLine(); - if (page.BufferEmptyRatio > 0) + if(page.BufferEmptyRatio > 0) sb.AppendFormat("\t{0} ratio of buffer that shall be empty prior to attempting a reselection", page.BufferEmptyRatio).AppendLine(); - if (page.BusInactivityLimit > 0) + if(page.BusInactivityLimit > 0) sb.AppendFormat("\t{0} µs maximum permitted to assert BSY without a REQ/ACK handshake", (int)page.BusInactivityLimit * 100).AppendLine(); - if (page.DisconnectTimeLimit > 0) + if(page.DisconnectTimeLimit > 0) sb.AppendFormat("\t{0} µs maximum permitted wait after releasing the bus before attempting reselection", (int)page.DisconnectTimeLimit * 100).AppendLine(); - if (page.ConnectTimeLimit > 0) + if(page.ConnectTimeLimit > 0) sb.AppendFormat("\t{0} µs allowed to use the bus before disconnecting, if granted the privilege and not restricted", (int)page.ConnectTimeLimit * 100).AppendLine(); - if (page.MaxBurstSize > 0) + if(page.MaxBurstSize > 0) sb.AppendFormat("\t{0} bytes maximum can be transferred before disconnecting", (int)page.MaxBurstSize * 512).AppendLine(); - if (page.FirstBurstSize > 0) + if(page.FirstBurstSize > 0) sb.AppendFormat("\t{0} bytes maximum can be transferred for a command along with the disconnect command", (int)page.FirstBurstSize * 512).AppendLine(); - if (page.DIMM) + if(page.DIMM) sb.AppendLine("\tTarget shall not transfer data for a command during the same interconnect tenancy"); - if (page.EMDP) + if(page.EMDP) sb.AppendLine("\tTarget is allowed to re-order the data transfer"); - switch (page.DTDC) + switch(page.DTDC) { case 0: sb.AppendLine("\tData transfer disconnect control is not used"); @@ -2514,19 +2514,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_08? DecodeModePage_08(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x08) + if((pageResponse[0] & 0x3F) != 0x08) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 12) + if(pageResponse.Length < 12) return null; ModePage_08 decoded = new ModePage_08(); @@ -2543,7 +2543,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.MaximumPreFetch = (ushort)((pageResponse[8] << 8) + pageResponse[9]); decoded.MaximumPreFetchCeiling = (ushort)((pageResponse[10] << 8) + pageResponse[11]); - if (pageResponse.Length < 20) + if(pageResponse.Length < 20) return decoded; decoded.IC |= (pageResponse[2] & 0x80) == 0x80; @@ -2572,7 +2572,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_08(ModePage_08? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_08 page = modePage.Value; @@ -2580,14 +2580,14 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Caching mode page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.RCD) + if(page.RCD) sb.AppendLine("\tRead-cache is enabled"); - if (page.WCE) + if(page.WCE) sb.AppendLine("\tWrite-cache is enabled"); - - switch (page.DemandReadRetentionPrio) + + switch(page.DemandReadRetentionPrio) { case 0: sb.AppendLine("\tDrive does not distinguish between cached read data"); @@ -2603,7 +2603,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - switch (page.WriteRetentionPriority) + switch(page.WriteRetentionPriority) { case 0: sb.AppendLine("\tDrive does not distinguish between cached write data"); @@ -2619,45 +2619,45 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.DRA) + if(page.DRA) sb.AppendLine("\tRead-ahead is disabled"); else { - if (page.MF) + if(page.MF) sb.AppendLine("\tPre-fetch values indicate a block multiplier"); - if (page.DisablePreFetch == 0) + if(page.DisablePreFetch == 0) sb.AppendLine("\tNo pre-fetch will be done"); else { sb.AppendFormat("\tPre-fetch will be done for READ commands of {0} blocks or less", page.DisablePreFetch).AppendLine(); - if (page.MinimumPreFetch > 0) + if(page.MinimumPreFetch > 0) sb.AppendFormat("At least {0} blocks will be always pre-fetched", page.MinimumPreFetch).AppendLine(); - if (page.MaximumPreFetch > 0) + if(page.MaximumPreFetch > 0) sb.AppendFormat("\tA maximum of {0} blocks will be pre-fetched", page.MaximumPreFetch).AppendLine(); - if (page.MaximumPreFetchCeiling > 0) + if(page.MaximumPreFetchCeiling > 0) sb.AppendFormat("\tA maximum of {0} blocks will be pre-fetched even if it is commanded to pre-fetch more", page.MaximumPreFetchCeiling).AppendLine(); - if (page.IC) + if(page.IC) sb.AppendLine("\tDevice should use number of cache segments or cache segment size for caching"); - if (page.ABPF) + if(page.ABPF) sb.AppendLine("\tPre-fetch should be aborted upong receiving a new command"); - if (page.CAP) + if(page.CAP) sb.AppendLine("\tCaching analysis is permitted"); - if (page.Disc) + if(page.Disc) sb.AppendLine("\tPre-fetch can continue across discontinuities (such as cylinders or tracks)"); } } - if (page.FSW) + if(page.FSW) sb.AppendLine("\tDrive should not reorder the sequence of write commands to be faster"); - if (page.Size) + if(page.Size) { - if (page.CacheSegmentSize > 0) + if(page.CacheSegmentSize > 0) { - if (page.LBCSS) + if(page.LBCSS) sb.AppendFormat("\tDrive cache segments should be {0} blocks long", page.CacheSegmentSize).AppendLine(); else sb.AppendFormat("\tDrive cache segments should be {0} bytes long", page.CacheSegmentSize).AppendLine(); @@ -2665,14 +2665,14 @@ namespace DiscImageChef.Decoders.SCSI } else { - if (page.CacheSegments > 0) + if(page.CacheSegments > 0) sb.AppendFormat("\tDrive should have {0} cache segments", page.CacheSegments).AppendLine(); } - if (page.NonCacheSegmentSize > 0) + if(page.NonCacheSegmentSize > 0) sb.AppendFormat("\tDrive shall allocate {0} bytes to buffer even when all cached data cannot be evicted", page.NonCacheSegmentSize).AppendLine(); - if (page.NV_DIS) + if(page.NV_DIS) sb.AppendLine("\tNon-Volatile cache is disabled"); return sb.ToString(); @@ -2798,19 +2798,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_05? DecodeModePage_05(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x05) + if((pageResponse[0] & 0x3F) != 0x05) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 32) + if(pageResponse.Length < 32) return null; ModePage_05 decoded = new ModePage_05(); @@ -2851,7 +2851,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_05(ModePage_05? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_05 page = modePage.Value; @@ -2859,7 +2859,7 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Flexible disk page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); sb.AppendFormat("\tTransfer rate: {0} kbit/s", page.TransferRate).AppendLine(); @@ -2867,141 +2867,141 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendFormat("\t{0} cylinders", page.Cylinders).AppendLine(); sb.AppendFormat("\t{0} sectors per track", page.SectorsPerTrack).AppendLine(); sb.AppendFormat("\t{0} bytes per sector", page.BytesPerSector).AppendLine(); - if (page.WritePrecompCylinder < page.Cylinders) + if(page.WritePrecompCylinder < page.Cylinders) sb.AppendFormat("\tWrite pre-compensation starts at cylinder {0}", page.WritePrecompCylinder).AppendLine(); - if (page.WriteReduceCylinder < page.Cylinders) + if(page.WriteReduceCylinder < page.Cylinders) sb.AppendFormat("\tWrite current reduction starts at cylinder {0}", page.WriteReduceCylinder).AppendLine(); - if (page.DriveStepRate > 0) + if(page.DriveStepRate > 0) sb.AppendFormat("\tDrive steps in {0} μs", (uint)page.DriveStepRate * 100).AppendLine(); - if (page.DriveStepPulse > 0) + if(page.DriveStepPulse > 0) sb.AppendFormat("\tEach step pulse is {0} ms", page.DriveStepPulse).AppendLine(); - if (page.HeadSettleDelay > 0) + if(page.HeadSettleDelay > 0) sb.AppendFormat("\tHeads settles in {0} μs", (uint)page.HeadSettleDelay * 100).AppendLine(); - if (!page.TRDY) + if(!page.TRDY) sb.AppendFormat("\tTarget shall wait {0} seconds before attempting to access the medium after motor on is asserted", (double)page.MotorOnDelay * 10).AppendLine(); else sb.AppendFormat("\tTarget shall wait {0} seconds after drive is ready before aborting medium access attemps", (double)page.MotorOnDelay * 10).AppendLine(); - if (page.MotorOffDelay != 0xFF) + if(page.MotorOffDelay != 0xFF) sb.AppendFormat("\tTarget shall wait {0} seconds before releasing the motor on signal after becoming idle", (double)page.MotorOffDelay * 10).AppendLine(); else sb.AppendLine("\tTarget shall never release the motor on signal"); - if (page.TRDY) + if(page.TRDY) sb.AppendLine("\tThere is a drive ready signal"); - if (page.SSN) + if(page.SSN) sb.AppendLine("\tSectors start at 1"); - if (page.MO) + if(page.MO) sb.AppendLine("\tThe motor on signal shall remain released"); sb.AppendFormat("\tDrive needs to do {0} step pulses per cylinder", page.SPC + 1).AppendLine(); - if (page.WriteCompensation > 0) + if(page.WriteCompensation > 0) sb.AppendFormat("\tWrite pre-compensation is {0}", page.WriteCompensation).AppendLine(); - if (page.HeadLoadDelay > 0) + if(page.HeadLoadDelay > 0) sb.AppendFormat("\tHead takes {0} ms to load", page.HeadLoadDelay).AppendLine(); - if (page.HeadUnloadDelay > 0) + if(page.HeadUnloadDelay > 0) sb.AppendFormat("\tHead takes {0} ms to unload", page.HeadUnloadDelay).AppendLine(); - if (page.MediumRotationRate > 0) + if(page.MediumRotationRate > 0) sb.AppendFormat("\tMedium rotates at {0} rpm", page.MediumRotationRate).AppendLine(); - switch (page.Pin34 & 0x07) + switch(page.Pin34 & 0x07) { case 0: sb.AppendLine("\tPin 34 is unconnected"); break; case 1: sb.Append("\tPin 34 indicates drive is ready when active "); - if ((page.Pin34 & 0x08) == 0x08) + if((page.Pin34 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; case 2: sb.Append("\tPin 34 indicates disk has changed when active "); - if ((page.Pin34 & 0x08) == 0x08) + if((page.Pin34 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; default: sb.AppendFormat("\tPin 34 indicates unknown function {0} when active ", page.Pin34 & 0x07); - if ((page.Pin34 & 0x08) == 0x08) + if((page.Pin34 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; } - switch (page.Pin4 & 0x07) + switch(page.Pin4 & 0x07) { case 0: sb.AppendLine("\tPin 4 is unconnected"); break; case 1: sb.Append("\tPin 4 indicates drive is in use when active "); - if ((page.Pin4 & 0x08) == 0x08) + if((page.Pin4 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; case 2: sb.Append("\tPin 4 indicates eject when active "); - if ((page.Pin4 & 0x08) == 0x08) + if((page.Pin4 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; case 3: sb.Append("\tPin 4 indicates head load when active "); - if ((page.Pin4 & 0x08) == 0x08) + if((page.Pin4 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; default: sb.AppendFormat("\tPin 4 indicates unknown function {0} when active ", page.Pin4 & 0x07); - if ((page.Pin4 & 0x08) == 0x08) + if((page.Pin4 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; } - switch (page.Pin2 & 0x07) + switch(page.Pin2 & 0x07) { case 0: sb.AppendLine("\tPin 2 is unconnected"); break; default: sb.AppendFormat("\tPin 2 indicates unknown function {0} when active ", page.Pin2 & 0x07); - if ((page.Pin2 & 0x08) == 0x08) + if((page.Pin2 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; } - switch (page.Pin1 & 0x07) + switch(page.Pin1 & 0x07) { case 0: sb.AppendLine("\tPin 1 is unconnected"); break; case 1: sb.Append("\tPin 1 indicates disk change reset when active "); - if ((page.Pin1 & 0x08) == 0x08) + if((page.Pin1 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); break; default: sb.AppendFormat("\tPin 1 indicates unknown function {0} when active ", page.Pin1 & 0x07); - if ((page.Pin1 & 0x08) == 0x08) + if((page.Pin1 & 0x08) == 0x08) sb.Append("high"); else sb.Append("low"); @@ -3083,19 +3083,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_03? DecodeModePage_03(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x03) + if((pageResponse[0] & 0x3F) != 0x03) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 24) + if(pageResponse.Length < 24) return null; ModePage_03 decoded = new ModePage_03(); @@ -3125,7 +3125,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_03(ModePage_03? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_03 page = modePage.Value; @@ -3133,7 +3133,7 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Format device page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); sb.AppendFormat("\t{0} tracks per zone to use in dividing the capacity for the purpose of allocating alternate sectors", page.TracksPerZone).AppendLine(); @@ -3145,13 +3145,13 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendFormat("\tTarget-dependent interleave value is {0}", page.Interleave).AppendLine(); sb.AppendFormat("\t{0} sectors between last block of one track and first block of the next", page.TrackSkew).AppendLine(); sb.AppendFormat("\t{0} sectors between last block of a cylinder and first block of the next one", page.CylinderSkew).AppendLine(); - if (page.SSEC) + if(page.SSEC) sb.AppendLine("\tDrive supports soft-sectoring format"); - if (page.HSEC) + if(page.HSEC) sb.AppendLine("\tDrive supports hard-sectoring format"); - if (page.RMB) + if(page.RMB) sb.AppendLine("\tDrive media is removable"); - if (page.SURF) + if(page.SURF) sb.AppendLine("\tSector addressing is progressively incremented in one surface before going to the next"); else sb.AppendLine("\tSector addressing is progressively incremented in one cylinder before going to the next"); @@ -3182,19 +3182,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_0B? DecodeModePage_0B(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x0B) + if((pageResponse[0] & 0x3F) != 0x0B) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 8) + if(pageResponse.Length < 8) return null; ModePage_0B decoded = new ModePage_0B(); @@ -3215,7 +3215,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_0B(ModePage_0B? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_0B page = modePage.Value; @@ -3223,7 +3223,7 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Medium types supported page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); // TODO: Implement it when all known medium types are supported @@ -3318,19 +3318,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_01? DecodeModePage_01(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x01) + if((pageResponse[0] & 0x3F) != 0x01) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 8) + if(pageResponse.Length < 8) return null; ModePage_01 decoded = new ModePage_01(); @@ -3350,7 +3350,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.HeadOffsetCount = (sbyte)pageResponse[5]; decoded.DataStrobeOffsetCount = (sbyte)pageResponse[6]; - if (pageResponse.Length < 12) + if(pageResponse.Length < 12) return decoded; decoded.WriteRetryCount = pageResponse[8]; @@ -3367,7 +3367,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_01(ModePage_01? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_01 page = modePage.Value; @@ -3375,32 +3375,32 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Read-write error recovery page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.AWRE) + if(page.AWRE) sb.AppendLine("\tAutomatic write reallocation is enabled"); - if (page.ARRE) + if(page.ARRE) sb.AppendLine("\tAutomatic read reallocation is enabled"); - if (page.TB) + if(page.TB) sb.AppendLine("\tData not recovered within limits shall be transferred back before a CHECK CONDITION"); - if (page.RC) + if(page.RC) sb.AppendLine("\tDrive will transfer the entire requested length without delaying to perform error recovery"); - if (page.EER) + if(page.EER) sb.AppendLine("\tDrive will use the most expedient form of error recovery first"); - if (page.PER) + if(page.PER) sb.AppendLine("\tDrive shall report recovered errors"); - if (page.DTE) + if(page.DTE) sb.AppendLine("\tTransfer will be terminated upon error detection"); - if (page.DCR) + if(page.DCR) sb.AppendLine("\tError correction is disabled"); - if (page.ReadRetryCount > 0) + if(page.ReadRetryCount > 0) sb.AppendFormat("\tDrive will repeat read operations {0} times", page.ReadRetryCount).AppendLine(); - if (page.WriteRetryCount > 0) + if(page.WriteRetryCount > 0) sb.AppendFormat("\tDrive will repeat write operations {0} times", page.WriteRetryCount).AppendLine(); - if (page.RecoveryTimeLimit > 0) + if(page.RecoveryTimeLimit > 0) sb.AppendFormat("\tDrive will employ a maximum of {0} ms to recover data", page.RecoveryTimeLimit).AppendLine(); - if (page.LBPERE) + if(page.LBPERE) sb.AppendLine("Logical block provisioning error reporting is enabled"); return sb.ToString(); @@ -3461,19 +3461,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_04? DecodeModePage_04(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x04) + if((pageResponse[0] & 0x3F) != 0x04) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 24) + if(pageResponse.Length < 24) return null; ModePage_04 decoded = new ModePage_04(); @@ -3499,7 +3499,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_04(ModePage_04? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_04 page = modePage.Value; @@ -3507,24 +3507,24 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Rigid disk drive geometry page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); sb.AppendFormat("\t{0} heads", page.Heads).AppendLine(); sb.AppendFormat("\t{0} cylinders", page.Cylinders).AppendLine(); - if (page.WritePrecompCylinder < page.Cylinders) + if(page.WritePrecompCylinder < page.Cylinders) sb.AppendFormat("\tWrite pre-compensation starts at cylinder {0}", page.WritePrecompCylinder).AppendLine(); - if (page.WriteReduceCylinder < page.Cylinders) + if(page.WriteReduceCylinder < page.Cylinders) sb.AppendFormat("\tWrite current reduction starts at cylinder {0}", page.WriteReduceCylinder).AppendLine(); - if (page.DriveStepRate > 0) + if(page.DriveStepRate > 0) sb.AppendFormat("\tDrive steps in {0} ns", (uint)page.DriveStepRate * 100).AppendLine(); sb.AppendFormat("\tHeads park in cylinder {0}", page.LandingCylinder).AppendLine(); - if (page.MediumRotationRate > 0) + if(page.MediumRotationRate > 0) sb.AppendFormat("\tMedium rotates at {0} rpm", page.MediumRotationRate).AppendLine(); - switch (page.RPL) + switch(page.RPL) { case 0: sb.AppendLine("\tSpindle synchronization is disable or unsupported"); @@ -3590,19 +3590,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_07? DecodeModePage_07(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x07) + if((pageResponse[0] & 0x3F) != 0x07) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 12) + if(pageResponse.Length < 12) return null; ModePage_07 decoded = new ModePage_07(); @@ -3627,7 +3627,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_07(ModePage_07? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_07 page = modePage.Value; @@ -3635,20 +3635,20 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Verify error recovery page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.EER) + if(page.EER) sb.AppendLine("\tDrive will use the most expedient form of error recovery first"); - if (page.PER) + if(page.PER) sb.AppendLine("\tDrive shall report recovered errors"); - if (page.DTE) + if(page.DTE) sb.AppendLine("\tTransfer will be terminated upon error detection"); - if (page.DCR) + if(page.DCR) sb.AppendLine("\tError correction is disabled"); - if (page.VerifyRetryCount > 0) + if(page.VerifyRetryCount > 0) sb.AppendFormat("\tDrive will repeat verify operations {0} times", page.VerifyRetryCount).AppendLine(); - if (page.RecoveryTimeLimit > 0) + if(page.RecoveryTimeLimit > 0) sb.AppendFormat("\tDrive will employ a maximum of {0} ms to recover data", page.RecoveryTimeLimit).AppendLine(); return sb.ToString(); @@ -3783,19 +3783,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_10_SSC? DecodeModePage_10_SSC(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x10) + if((pageResponse[0] & 0x3F) != 0x10) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 16) + if(pageResponse.Length < 16) return null; ModePage_10_SSC decoded = new ModePage_10_SSC(); @@ -3843,7 +3843,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_10_SSC(ModePage_10_SSC? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_10_SSC page = modePage.Value; @@ -3851,27 +3851,27 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Device configuration page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - + sb.AppendFormat("\tActive format: {0}", page.ActiveFormat).AppendLine(); sb.AppendFormat("\tActive partition: {0}", page.ActivePartition).AppendLine(); sb.AppendFormat("\tWrite buffer shall have a full ratio of {0} before being flushed to medium", page.WriteBufferFullRatio).AppendLine(); sb.AppendFormat("\tRead buffer shall have an empty ratio of {0} before more data is read from medium", page.ReadBufferEmptyRatio).AppendLine(); sb.AppendFormat("\tDrive will delay {0} ms before buffered data is forcefully written to the medium even before buffer is full", (int)page.WriteDelayTime * 100).AppendLine(); - if (page.DBR) + if(page.DBR) { sb.AppendLine("\tDrive supports recovering data from buffer"); - if (page.RBO) + if(page.RBO) sb.AppendLine("\tRecovered buffer data comes in LIFO order"); else sb.AppendLine("\tRecovered buffer data comes in FIFO order"); } - if (page.BIS) + if(page.BIS) sb.AppendLine("\tMedium supports block IDs"); - if (page.RSmk) + if(page.RSmk) sb.AppendLine("\tDrive reports setmarks"); - switch (page.SOCF) + switch(page.SOCF) { case 0: sb.AppendLine("\tDrive will pre-read until buffer is full"); @@ -3887,14 +3887,14 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.REW) + if(page.REW) { sb.AppendLine("\tDrive reports early warnings"); - if (page.SEW) + if(page.SEW) sb.AppendLine("\tDrive will synchronize buffer to medium on early warnings"); } - switch (page.GapSize) + switch(page.GapSize) { case 0: break; @@ -3922,10 +3922,10 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.EEG) + if(page.EEG) sb.AppendLine("\tDrive generates end-of-data"); - switch (page.SelectedCompression) + switch(page.SelectedCompression) { case 0: sb.AppendLine("\tDrive does not use compression"); @@ -3938,24 +3938,24 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.SWP) + if(page.SWP) sb.AppendLine("\tSoftware write protect is enabled"); - if (page.ASOCWP) + if(page.ASOCWP) sb.AppendLine("\tAssociated write protect is enabled"); - if (page.PERSWP) + if(page.PERSWP) sb.AppendLine("\tPersistent write protect is enabled"); - if (page.PRMWP) + if(page.PRMWP) sb.AppendLine("\tPermanent write protect is enabled"); - if (page.BAML) + if(page.BAML) { - if (page.BAM) + if(page.BAM) sb.AppendLine("\tDrive operates using explicit address mode"); else sb.AppendLine("\tDrive operates using implicit address mode"); } - switch (page.RewindOnReset) + switch(page.RewindOnReset) { case 1: sb.AppendLine("\tDrive shall position to beginning of default data partition on reset"); @@ -3965,7 +3965,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - switch (page.WTRE) + switch(page.WTRE) { case 1: sb.AppendLine("\tDrive will do nothing on WORM tampered medium"); @@ -3975,7 +3975,7 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.OIR) + if(page.OIR) sb.AppendLine("\tDrive will only respond to commands if it has received a reservation"); return sb.ToString(); @@ -4052,19 +4052,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_0E? DecodeModePage_0E(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x0E) + if((pageResponse[0] & 0x3F) != 0x0E) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 16) + if(pageResponse.Length < 16) return null; ModePage_0E decoded = new ModePage_0E(); @@ -4094,7 +4094,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_0E(ModePage_0E? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_0E page = modePage.Value; @@ -4102,19 +4102,19 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI CD-ROM audio control parameters page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.Immed) + if(page.Immed) sb.AppendLine("\tDrive will return from playback command immediately"); else sb.AppendLine("\tDrive will return from playback command when playback ends"); - if (page.SOTC) + if(page.SOTC) sb.AppendLine("\tDrive will stop playback on track end"); - if (page.APRVal) + if(page.APRVal) { double blocks; - if (page.LBAFormat == 8) + if(page.LBAFormat == 8) blocks = page.BlocksPerSecondOfAudio * (1 / 256); else blocks = page.BlocksPerSecondOfAudio; @@ -4122,19 +4122,19 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendFormat("\tThere are {0} blocks per each second of audio", blocks).AppendLine(); } - if (page.OutputPort0ChannelSelection > 0) + if(page.OutputPort0ChannelSelection > 0) { sb.Append("\tOutput port 0 has channels "); - if ((page.OutputPort0ChannelSelection & 0x01) == 0x01) + if((page.OutputPort0ChannelSelection & 0x01) == 0x01) sb.Append("0 "); - if ((page.OutputPort0ChannelSelection & 0x02) == 0x02) + if((page.OutputPort0ChannelSelection & 0x02) == 0x02) sb.Append("1 "); - if ((page.OutputPort0ChannelSelection & 0x04) == 0x04) + if((page.OutputPort0ChannelSelection & 0x04) == 0x04) sb.Append("2 "); - if ((page.OutputPort0ChannelSelection & 0x08) == 0x08) + if((page.OutputPort0ChannelSelection & 0x08) == 0x08) sb.Append("3 "); - switch (page.OutputPort0Volume) + switch(page.OutputPort0Volume) { case 0: sb.AppendLine("muted"); @@ -4148,19 +4148,19 @@ namespace DiscImageChef.Decoders.SCSI } } - if (page.OutputPort1ChannelSelection > 0) + if(page.OutputPort1ChannelSelection > 0) { sb.Append("\tOutput port 1 has channels "); - if ((page.OutputPort1ChannelSelection & 0x01) == 0x01) + if((page.OutputPort1ChannelSelection & 0x01) == 0x01) sb.Append("0 "); - if ((page.OutputPort1ChannelSelection & 0x02) == 0x02) + if((page.OutputPort1ChannelSelection & 0x02) == 0x02) sb.Append("1 "); - if ((page.OutputPort1ChannelSelection & 0x04) == 0x04) + if((page.OutputPort1ChannelSelection & 0x04) == 0x04) sb.Append("2 "); - if ((page.OutputPort1ChannelSelection & 0x08) == 0x08) + if((page.OutputPort1ChannelSelection & 0x08) == 0x08) sb.Append("3 "); - switch (page.OutputPort1Volume) + switch(page.OutputPort1Volume) { case 0: sb.AppendLine("muted"); @@ -4174,19 +4174,19 @@ namespace DiscImageChef.Decoders.SCSI } } - if (page.OutputPort2ChannelSelection > 0) + if(page.OutputPort2ChannelSelection > 0) { sb.Append("\tOutput port 2 has channels "); - if ((page.OutputPort2ChannelSelection & 0x01) == 0x01) + if((page.OutputPort2ChannelSelection & 0x01) == 0x01) sb.Append("0 "); - if ((page.OutputPort2ChannelSelection & 0x02) == 0x02) + if((page.OutputPort2ChannelSelection & 0x02) == 0x02) sb.Append("1 "); - if ((page.OutputPort2ChannelSelection & 0x04) == 0x04) + if((page.OutputPort2ChannelSelection & 0x04) == 0x04) sb.Append("2 "); - if ((page.OutputPort2ChannelSelection & 0x08) == 0x08) + if((page.OutputPort2ChannelSelection & 0x08) == 0x08) sb.Append("3 "); - switch (page.OutputPort2Volume) + switch(page.OutputPort2Volume) { case 0: sb.AppendLine("muted"); @@ -4200,19 +4200,19 @@ namespace DiscImageChef.Decoders.SCSI } } - if (page.OutputPort3ChannelSelection > 0) + if(page.OutputPort3ChannelSelection > 0) { sb.Append("\tOutput port 3 has channels "); - if ((page.OutputPort3ChannelSelection & 0x01) == 0x01) + if((page.OutputPort3ChannelSelection & 0x01) == 0x01) sb.Append("0 "); - if ((page.OutputPort3ChannelSelection & 0x02) == 0x02) + if((page.OutputPort3ChannelSelection & 0x02) == 0x02) sb.Append("1 "); - if ((page.OutputPort3ChannelSelection & 0x04) == 0x04) + if((page.OutputPort3ChannelSelection & 0x04) == 0x04) sb.Append("2 "); - if ((page.OutputPort3ChannelSelection & 0x08) == 0x08) + if((page.OutputPort3ChannelSelection & 0x08) == 0x08) sb.Append("3 "); - switch (page.OutputPort3Volume) + switch(page.OutputPort3Volume) { case 0: sb.AppendLine("muted"); @@ -4260,19 +4260,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_0D? DecodeModePage_0D(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x0D) + if((pageResponse[0] & 0x3F) != 0x0D) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 8) + if(pageResponse.Length < 8) return null; ModePage_0D decoded = new ModePage_0D(); @@ -4292,7 +4292,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_0D(ModePage_0D? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_0D page = modePage.Value; @@ -4300,9 +4300,9 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI CD-ROM parameters page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - switch (page.InactivityTimerMultiplier) + switch(page.InactivityTimerMultiplier) { case 0: sb.AppendLine("\tDrive will remain in track hold state a vendor-specified time after a seek or read"); @@ -4354,9 +4354,9 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.SecondsPerMinute > 0) + if(page.SecondsPerMinute > 0) sb.AppendFormat("\tEach minute has {0} seconds", page.SecondsPerMinute).AppendLine(); - if (page.FramesPerSecond > 0) + if(page.FramesPerSecond > 0) sb.AppendFormat("\tEach second has {0} frames", page.FramesPerSecond).AppendLine(); return sb.ToString(); @@ -4398,19 +4398,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_01_MMC? DecodeModePage_01_MMC(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x01) + if((pageResponse[0] & 0x3F) != 0x01) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 8) + if(pageResponse.Length < 8) return null; ModePage_01_MMC decoded = new ModePage_01_MMC(); @@ -4419,7 +4419,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.Parameter = pageResponse[2]; decoded.ReadRetryCount = pageResponse[3]; - if (pageResponse.Length < 12) + if(pageResponse.Length < 12) return decoded; decoded.WriteRetryCount = pageResponse[8]; @@ -4435,7 +4435,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_01_MMC(ModePage_01_MMC? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_01_MMC page = modePage.Value; @@ -4443,11 +4443,11 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Read error recovery page for MultiMedia Devices:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.ReadRetryCount > 0) + if(page.ReadRetryCount > 0) sb.AppendFormat("\tDrive will repeat read operations {0} times", page.ReadRetryCount).AppendLine(); - + string AllUsed = "\tAll available recovery procedures will be used.\n"; string CIRCRetriesUsed = "\tOnly retries and CIRC are used.\n"; string RetriesUsed = "\tOnly retries are used.\n"; @@ -4461,7 +4461,7 @@ namespace DiscImageChef.Decoders.SCSI string UnrecECCAbortData = "\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data."; string UnrecCIRCAbortData = "\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data."; - switch (page.Parameter) + switch(page.Parameter) { case 0x00: sb.AppendLine(AllUsed + RecoveredNotReported + UnrecECCAbort); @@ -4524,11 +4524,11 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.WriteRetryCount > 0) + if(page.WriteRetryCount > 0) sb.AppendFormat("\tDrive will repeat write operations {0} times", page.WriteRetryCount).AppendLine(); - if (page.RecoveryTimeLimit > 0) + if(page.RecoveryTimeLimit > 0) sb.AppendFormat("\tDrive will employ a maximum of {0} ms to recover data", page.RecoveryTimeLimit).AppendLine(); - + return sb.ToString(); } @@ -4559,19 +4559,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_07_MMC? DecodeModePage_07_MMC(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x07) + if((pageResponse[0] & 0x3F) != 0x07) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 8) + if(pageResponse.Length < 8) return null; ModePage_07_MMC decoded = new ModePage_07_MMC(); @@ -4590,7 +4590,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_07_MMC(ModePage_07_MMC? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_07_MMC page = modePage.Value; @@ -4598,9 +4598,9 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Verify error recovery page for MultiMedia Devices:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.VerifyRetryCount > 0) + if(page.VerifyRetryCount > 0) sb.AppendFormat("\tDrive will repeat verify operations {0} times", page.VerifyRetryCount).AppendLine(); string AllUsed = "\tAll available recovery procedures will be used.\n"; @@ -4616,7 +4616,7 @@ namespace DiscImageChef.Decoders.SCSI string UnrecECCAbortData = "\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data."; string UnrecCIRCAbortData = "\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data."; - switch (page.Parameter) + switch(page.Parameter) { case 0x00: sb.AppendLine(AllUsed + RecoveredNotReported + UnrecECCAbort); @@ -4705,19 +4705,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_06? DecodeModePage_06(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x06) + if((pageResponse[0] & 0x3F) != 0x06) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 4) + if(pageResponse.Length < 4) return null; ModePage_06 decoded = new ModePage_06(); @@ -4735,7 +4735,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_06(ModePage_06? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_06 page = modePage.Value; @@ -4743,9 +4743,9 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI optical memory:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.RUBR) + if(page.RUBR) sb.AppendLine("\tOn reading an updated block drive will return RECOVERED ERROR"); return sb.ToString(); @@ -4903,19 +4903,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_2A? DecodeModePage_2A(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x2A) + if((pageResponse[0] & 0x3F) != 0x2A) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 16) + if(pageResponse.Length < 16) return null; ModePage_2A decoded = new ModePage_2A(); @@ -4949,7 +4949,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.BufferSize = (ushort)((pageResponse[12] << 8) + pageResponse[13]); decoded.CurrentSpeed = (ushort)((pageResponse[14] << 8) + pageResponse[15]); - if (pageResponse.Length < 20) + if(pageResponse.Length < 20) return decoded; decoded.Method2 |= (pageResponse[2] & 0x04) == 0x04; @@ -4971,7 +4971,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.RCK |= (pageResponse[17] & 0x04) == 0x04; decoded.BCK |= (pageResponse[17] & 0x02) == 0x02; - if (pageResponse.Length < 22) + if(pageResponse.Length < 22) return decoded; decoded.TestWrite |= (pageResponse[3] & 0x04) == 0x04; @@ -4980,7 +4980,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.ReadBarcode |= (pageResponse[5] & 0x80) == 0x80; - if (pageResponse.Length < 26) + if(pageResponse.Length < 26) return decoded; decoded.ReadDVDRAM |= (pageResponse[2] & 0x20) == 0x20; @@ -4995,7 +4995,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.CMRSupported = (ushort)((pageResponse[22] << 8) + pageResponse[23]); - if (pageResponse.Length < 32) + if(pageResponse.Length < 32) return decoded; decoded.BUF |= (pageResponse[4] & 0x80) == 0x80; @@ -5005,7 +5005,7 @@ namespace DiscImageChef.Decoders.SCSI ushort descriptors = (ushort)((pageResponse[30] << 8) + pageResponse[31]); decoded.WriteSpeedPerformanceDescriptors = new ModePage_2A_WriteDescriptor[descriptors]; - for (int i = 0; i < descriptors; i++) + for(int i = 0; i < descriptors; i++) { decoded.WriteSpeedPerformanceDescriptors[i] = new ModePage_2A_WriteDescriptor(); decoded.WriteSpeedPerformanceDescriptors[i].RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07); @@ -5022,7 +5022,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_2A(ModePage_2A? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_2A page = modePage.Value; @@ -5030,34 +5030,34 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI CD-ROM capabilities page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.AudioPlay) + if(page.AudioPlay) sb.AppendLine("\tDrive can play audio"); - if (page.Mode2Form1) + if(page.Mode2Form1) sb.AppendLine("\tDrive can read sectors in Mode 2 Form 1 format"); - if (page.Mode2Form2) + if(page.Mode2Form2) sb.AppendLine("\tDrive can read sectors in Mode 2 Form 2 format"); - if (page.MultiSession) + if(page.MultiSession) sb.AppendLine("\tDrive supports multi-session discs and/or Photo-CD"); - if (page.CDDACommand) + if(page.CDDACommand) sb.AppendLine("\tDrive can read digital audio"); - if (page.AccurateCDDA) + if(page.AccurateCDDA) sb.AppendLine("\tDrive can continue from streaming loss"); - if (page.Subchannel) + if(page.Subchannel) sb.AppendLine("\tDrive can read uncorrected and interleaved R-W subchannels"); - if (page.DeinterlaveSubchannel) + if(page.DeinterlaveSubchannel) sb.AppendLine("\tDrive can read, deinterleave and correct R-W subchannels"); - if (page.C2Pointer) + if(page.C2Pointer) sb.AppendLine("\tDrive supports C2 pointers"); - if (page.UPC) + if(page.UPC) sb.AppendLine("\tDrive can read Media Catalogue Number"); - if (page.ISRC) + if(page.ISRC) sb.AppendLine("\tDrive can read ISRC"); - switch (page.LoadingMechanism) + switch(page.LoadingMechanism) { case 0: sb.AppendLine("\tDrive uses media caddy"); @@ -5079,129 +5079,129 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.Lock) + if(page.Lock) sb.AppendLine("\tDrive can lock media"); - if (page.PreventJumper) + if(page.PreventJumper) { sb.AppendLine("\tDrive power ups locked"); - if (page.LockState) + if(page.LockState) sb.AppendLine("\tDrive is locked, media cannot be ejected or inserted"); else sb.AppendLine("\tDrive is not locked, media can be ejected and inserted"); } else { - if (page.LockState) + if(page.LockState) sb.AppendLine("\tDrive is locked, media cannot be ejected, but if empty, can be inserted"); else sb.AppendLine("\tDrive is not locked, media can be ejected and inserted"); } - if (page.Eject) + if(page.Eject) sb.AppendLine("\tDrive can eject media"); - if (page.SeparateChannelMute) + if(page.SeparateChannelMute) sb.AppendLine("\tEach channel can be muted independently"); - if (page.SeparateChannelVolume) + if(page.SeparateChannelVolume) sb.AppendLine("\tEach channel's volume can be controlled independently"); - if (page.SupportedVolumeLevels > 0) + if(page.SupportedVolumeLevels > 0) sb.AppendFormat("\tDrive supports {0} volume levels", page.SupportedVolumeLevels).AppendLine(); - if (page.BufferSize > 0) + if(page.BufferSize > 0) sb.AppendFormat("\tDrive has {0} Kbyte of buffer", page.BufferSize).AppendLine(); - if (page.MaximumSpeed > 0) + if(page.MaximumSpeed > 0) sb.AppendFormat("\tDrive's maximum reading speed is {0} Kbyte/sec.", page.MaximumSpeed).AppendLine(); - if (page.CurrentSpeed > 0) + if(page.CurrentSpeed > 0) sb.AppendFormat("\tDrive's current reading speed is {0} Kbyte/sec.", page.CurrentSpeed).AppendLine(); - if (page.ReadCDR) + if(page.ReadCDR) { - if (page.WriteCDR) + if(page.WriteCDR) sb.AppendLine("\tDrive can read and write CD-R"); else sb.AppendLine("\tDrive can read CD-R"); - if (page.Method2) + if(page.Method2) sb.AppendLine("\tDrive supports reading CD-R packet media"); } - if (page.ReadCDRW) + if(page.ReadCDRW) { - if (page.WriteCDRW) + if(page.WriteCDRW) sb.AppendLine("\tDrive can read and write CD-RW"); else sb.AppendLine("\tDrive can read CD-RW"); } - if (page.ReadDVDROM) + if(page.ReadDVDROM) sb.AppendLine("\tDrive can read DVD-ROM"); - if (page.ReadDVDR) + if(page.ReadDVDR) { - if (page.WriteDVDR) + if(page.WriteDVDR) sb.AppendLine("\tDrive can read and write DVD-R"); else sb.AppendLine("\tDrive can read DVD-R"); } - if (page.ReadDVDRAM) + if(page.ReadDVDRAM) { - if (page.WriteDVDRAM) + if(page.WriteDVDRAM) sb.AppendLine("\tDrive can read and write DVD-RAM"); else sb.AppendLine("\tDrive can read DVD-RAM"); } - if (page.Composite) + if(page.Composite) sb.AppendLine("\tDrive can deliver a compositve audio and video data stream"); - if (page.DigitalPort1) + if(page.DigitalPort1) sb.AppendLine("\tDrive supports IEC-958 digital output on port 1"); - if (page.DigitalPort2) + if(page.DigitalPort2) sb.AppendLine("\tDrive supports IEC-958 digital output on port 2"); - if (page.SDP) + if(page.SDP) sb.AppendLine("\tDrive contains a changer that can report the exact contents of the slots"); - if (page.CurrentWriteSpeedSelected > 0) + if(page.CurrentWriteSpeedSelected > 0) { - if (page.RotationControlSelected == 0) + if(page.RotationControlSelected == 0) sb.AppendFormat("\tDrive's current writing speed is {0} Kbyte/sec. in CLV mode", page.CurrentWriteSpeedSelected).AppendLine(); - else if (page.RotationControlSelected == 1) + else if(page.RotationControlSelected == 1) sb.AppendFormat("\tDrive's current writing speed is {0} Kbyte/sec. in pure CAV mode", page.CurrentWriteSpeedSelected).AppendLine(); } else { - if (page.MaxWriteSpeed > 0) + if(page.MaxWriteSpeed > 0) sb.AppendFormat("\tDrive's maximum writing speed is {0} Kbyte/sec.", page.MaxWriteSpeed).AppendLine(); - if (page.CurrentWriteSpeed > 0) + if(page.CurrentWriteSpeed > 0) sb.AppendFormat("\tDrive's current writing speed is {0} Kbyte/sec.", page.CurrentWriteSpeed).AppendLine(); } if(page.WriteSpeedPerformanceDescriptors != null) { - foreach (ModePage_2A_WriteDescriptor descriptor in page.WriteSpeedPerformanceDescriptors) + foreach(ModePage_2A_WriteDescriptor descriptor in page.WriteSpeedPerformanceDescriptors) { - if (descriptor.WriteSpeed > 0) + if(descriptor.WriteSpeed > 0) { - if (descriptor.RotationControl == 0) + if(descriptor.RotationControl == 0) sb.AppendFormat("\tDrive supports writing at {0} Kbyte/sec. in CLV mode", descriptor.WriteSpeed).AppendLine(); - else if (descriptor.RotationControl == 1) + else if(descriptor.RotationControl == 1) sb.AppendFormat("\tDrive supports writing at is {0} Kbyte/sec. in pure CAV mode", descriptor.WriteSpeed).AppendLine(); } } } - if (page.TestWrite) + if(page.TestWrite) sb.AppendLine("\tDrive supports test writing"); - if (page.ReadBarcode) + if(page.ReadBarcode) sb.AppendLine("\tDrive can read barcode"); - if (page.SCC) + if(page.SCC) sb.AppendLine("\tDrive can read both sides of a disc"); - if (page.LeadInPW) + if(page.LeadInPW) sb.AppendLine("\tDrive an read raw R-W subchannel from the Lead-In"); - if (page.CMRSupported == 1) + if(page.CMRSupported == 1) sb.AppendLine("\tDrive supports DVD CSS and/or DVD CPPM"); - if (page.BUF) + if(page.BUF) sb.AppendLine("\tDrive supports buffer under-run free recording"); return sb.ToString(); @@ -5268,19 +5268,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_1C? DecodeModePage_1C(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x1C) + if((pageResponse[0] & 0x3F) != 0x1C) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 12) + if(pageResponse.Length < 12) return null; ModePage_1C decoded = new ModePage_1C(); @@ -5312,7 +5312,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_1C(ModePage_1C? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_1C page = modePage.Value; @@ -5320,16 +5320,16 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Informational exceptions control page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.DExcpt) + if(page.DExcpt) sb.AppendLine("\tInformational exceptions are disabled"); else { sb.AppendLine("\tInformational exceptions are enabled"); - switch (page.MRIE) + switch(page.MRIE) { case 0: sb.AppendLine("\tNo reporting of informational exception condition"); @@ -5357,30 +5357,30 @@ namespace DiscImageChef.Decoders.SCSI break; } - if (page.Perf) + if(page.Perf) sb.AppendLine("\tInformational exceptions reporting should not affect drive performance"); - if (page.Test) + if(page.Test) sb.AppendLine("\tA test informational exception will raise on next timer"); - if (page.LogErr) + if(page.LogErr) sb.AppendLine("\tDrive shall log informational exception conditions"); - if (page.IntervalTimer > 0) + if(page.IntervalTimer > 0) { - if (page.IntervalTimer == 0xFFFFFFFF) + if(page.IntervalTimer == 0xFFFFFFFF) sb.AppendLine("\tTimer interval is vendor-specific"); else sb.AppendFormat("\tTimer interval is {0} ms", page.IntervalTimer * 100).AppendLine(); } - if (page.ReportCount > 0) + if(page.ReportCount > 0) sb.AppendFormat("\tInformational exception conditions will be reported a maximum of {0} times", page.ReportCount); } - if (page.EWasc) + if(page.EWasc) sb.AppendLine("\tWarning reporting is enabled"); - if (page.EBF) + if(page.EBF) sb.AppendLine("\tBackground functions are enabled"); - if (page.EBACKERR) + if(page.EBACKERR) sb.AppendLine("\tDrive will report background self-test errors"); return sb.ToString(); @@ -5454,19 +5454,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_1A? DecodeModePage_1A(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x1A) + if((pageResponse[0] & 0x3F) != 0x1A) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 12) + if(pageResponse.Length < 12) return null; ModePage_1A decoded = new ModePage_1A(); @@ -5479,7 +5479,7 @@ namespace DiscImageChef.Decoders.SCSI decoded.IdleTimer = (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + pageResponse[7]); decoded.StandbyTimer = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) + pageResponse[11]); - if (pageResponse.Length < 40) + if(pageResponse.Length < 40) return decoded; decoded.PM_BG_Precedence = (byte)((pageResponse[2] & 0xC0) >> 6); @@ -5505,7 +5505,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_1A(ModePage_1A? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_1A page = modePage.Value; @@ -5513,35 +5513,35 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Power condition page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if ((page.Standby && page.StandbyTimer > 0) || + if((page.Standby && page.StandbyTimer > 0) || (page.Standby_Y && page.StandbyTimer_Y > 0)) { - if (page.Standby && page.StandbyTimer > 0) + if(page.Standby && page.StandbyTimer > 0) sb.AppendFormat("\tStandby timer Z is set to {0} ms", page.StandbyTimer * 100).AppendLine(); - if (page.Standby_Y && page.StandbyTimer_Y > 0) + if(page.Standby_Y && page.StandbyTimer_Y > 0) sb.AppendFormat("\tStandby timer Y is set to {0} ms", page.StandbyTimer_Y * 100).AppendLine(); } else sb.AppendLine("\tDrive will not enter standy mode"); - if ((page.Idle && page.IdleTimer > 0) || + if((page.Idle && page.IdleTimer > 0) || (page.Idle_B && page.IdleTimer_B > 0) || (page.Idle_C && page.IdleTimer_C > 0)) { - if (page.Idle && page.IdleTimer > 0) + if(page.Idle && page.IdleTimer > 0) sb.AppendFormat("\tIdle timer A is set to {0} ms", page.IdleTimer * 100).AppendLine(); - if (page.Idle_B && page.IdleTimer_B > 0) + if(page.Idle_B && page.IdleTimer_B > 0) sb.AppendFormat("\tIdle timer B is set to {0} ms", page.IdleTimer_B * 100).AppendLine(); - if (page.Idle_C && page.IdleTimer_C > 0) + if(page.Idle_C && page.IdleTimer_C > 0) sb.AppendFormat("\tIdle timer C is set to {0} ms", page.IdleTimer_C * 100).AppendLine(); } else sb.AppendLine("\tDrive will not enter idle mode"); - switch (page.PM_BG_Precedence) + switch(page.PM_BG_Precedence) { case 0: break; @@ -5601,22 +5601,22 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_0A_S01? DecodeModePage_0A_S01(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) != 0x40) + if((pageResponse[0] & 0x40) != 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x0A) + if((pageResponse[0] & 0x3F) != 0x0A) return null; - if (pageResponse[1] != 0x01) + if(pageResponse[1] != 0x01) return null; - if (((pageResponse[2] << 8) + pageResponse[3] + 4) != pageResponse.Length) + if(((pageResponse[2] << 8) + pageResponse[3] + 4) != pageResponse.Length) return null; - if (pageResponse.Length < 32) + if(pageResponse.Length < 32) return null; ModePage_0A_S01 decoded = new ModePage_0A_S01(); @@ -5639,7 +5639,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_0A_S01(ModePage_0A_S01? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_0A_S01 page = modePage.Value; @@ -5647,28 +5647,28 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Control extension page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - - if (page.TCMOS) + + if(page.TCMOS) { sb.Append("\tTimestamp can be initialized by methods outside of the SCSI standards"); - if (page.SCSIP) + if(page.SCSIP) sb.Append(", but SCSI's SET TIMESTAMP shall take precedence over them"); sb.AppendLine(); } - if (page.IALUAE) + if(page.IALUAE) sb.AppendLine("\tImplicit Asymmetric Logical Unit Access is enabled"); sb.AppendFormat("\tInitial priority is {0}", page.InitialPriority).AppendLine(); - if (page.DLC) + if(page.DLC) sb.AppendLine("\tDevice will not degrade performance to extend its life"); - if (page.MaximumSenseLength > 0) + if(page.MaximumSenseLength > 0) sb.AppendFormat("\tMaximum sense data would be {0} bytes", page.MaximumSenseLength).AppendLine(); return sb.ToString(); @@ -5702,22 +5702,22 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_1A_S01? DecodeModePage_1A_S01(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) != 0x40) + if((pageResponse[0] & 0x40) != 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x1A) + if((pageResponse[0] & 0x3F) != 0x1A) return null; - if (pageResponse[1] != 0x01) + if(pageResponse[1] != 0x01) return null; - if (((pageResponse[2] << 8) + pageResponse[3] + 4) != pageResponse.Length) + if(((pageResponse[2] << 8) + pageResponse[3] + 4) != pageResponse.Length) return null; - if (pageResponse.Length < 16) + if(pageResponse.Length < 16) return null; ModePage_1A_S01 decoded = new ModePage_1A_S01(); @@ -5736,7 +5736,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_1A_S01(ModePage_1A_S01? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_1A_S01 page = modePage.Value; @@ -5744,10 +5744,10 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Power Consumption page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - switch (page.ActiveLevel) + switch(page.ActiveLevel) { case 0: sb.AppendFormat("\tDevice power consumption is dictated by identifier {0} of Power Consumption VPD", page.PowerConsumptionIdentifier).AppendLine(); @@ -5805,19 +5805,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_10? DecodeModePage_10(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x10) + if((pageResponse[0] & 0x3F) != 0x10) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 24) + if(pageResponse.Length < 24) return null; ModePage_10 decoded = new ModePage_10(); @@ -5840,7 +5840,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_10(ModePage_10? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_10 page = modePage.Value; @@ -5848,20 +5848,20 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI XOR control mode page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.XORDIS) + if(page.XORDIS) sb.AppendLine("\tXOR operations are disabled"); else { - if (page.MaxXorWrite > 0) + if(page.MaxXorWrite > 0) sb.AppendFormat("\tDrive accepts a maximum of {0} blocks in a single XOR WRITE command", page.MaxXorWrite).AppendLine(); - if (page.MaxRegenSize > 0) + if(page.MaxRegenSize > 0) sb.AppendFormat("\tDrive accepts a maximum of {0} blocks in a REGENERATE command", page.MaxRegenSize).AppendLine(); - if (page.MaxRebuildRead > 0) + if(page.MaxRebuildRead > 0) sb.AppendFormat("\tDrive accepts a maximum of {0} blocks in a READ command during rebuild", page.MaxRebuildRead).AppendLine(); - if (page.RebuildDelay > 0) + if(page.RebuildDelay > 0) sb.AppendFormat("\tDrive needs a minimum of {0} ms between READ commands during rebuild", page.RebuildDelay).AppendLine(); } @@ -5920,22 +5920,22 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_1C_S01? DecodeModePage_1C_S01(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) != 0x40) + if((pageResponse[0] & 0x40) != 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x1C) + if((pageResponse[0] & 0x3F) != 0x1C) return null; - if (pageResponse[1] != 0x01) + if(pageResponse[1] != 0x01) return null; - if (((pageResponse[2] << 8) + pageResponse[3] + 4) != pageResponse.Length) + if(((pageResponse[2] << 8) + pageResponse[3] + 4) != pageResponse.Length) return null; - if (pageResponse.Length < 16) + if(pageResponse.Length < 16) return null; ModePage_1C_S01 decoded = new ModePage_1C_S01(); @@ -5962,7 +5962,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_1C_S01(ModePage_1C_S01? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_1C_S01 page = modePage.Value; @@ -5970,28 +5970,28 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Background Control page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.S_L_Full) + if(page.S_L_Full) sb.AppendLine("\tBackground scans will be halted if log is full"); - if (page.LOWIR) + if(page.LOWIR) sb.AppendLine("\tBackground scans will only be logged if they require intervention"); - if (page.En_Bms) + if(page.En_Bms) sb.AppendLine("\tBackground medium scans are enabled"); - if (page.En_Ps) + if(page.En_Ps) sb.AppendLine("\tBackground pre-scans are enabled"); - if (page.BackgroundScanInterval > 0) + if(page.BackgroundScanInterval > 0) sb.AppendFormat("\t{0} hours shall be between the start of a background scan operation and the next", page.BackgroundScanInterval).AppendLine(); - if (page.BackgroundPrescanTimeLimit > 0) + if(page.BackgroundPrescanTimeLimit > 0) sb.AppendFormat("\tBackgroun pre-scan operations can take a maximum of {0} hours", page.BackgroundPrescanTimeLimit).AppendLine(); - if (page.MinIdleBeforeBgScan > 0) + if(page.MinIdleBeforeBgScan > 0) sb.AppendFormat("\tAt least {0} ms must be idle before resuming a suspended background scan operation", page.MinIdleBeforeBgScan).AppendLine(); - if (page.MaxTimeSuspendBgScan > 0) + if(page.MaxTimeSuspendBgScan > 0) sb.AppendFormat("\tAt most {0} ms must be before suspending a background scan operation and processing received commands", page.MaxTimeSuspendBgScan).AppendLine(); return sb.ToString(); @@ -6040,19 +6040,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_0F? DecodeModePage_0F(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x0F) + if((pageResponse[0] & 0x3F) != 0x0F) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 16) + if(pageResponse.Length < 16) return null; ModePage_0F decoded = new ModePage_0F(); @@ -6077,7 +6077,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_0F(ModePage_0F? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_0F page = modePage.Value; @@ -6085,16 +6085,16 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Data compression page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.DCC) + if(page.DCC) { sb.AppendLine("\tDrive supports data compression"); - if (page.DCE) + if(page.DCE) { sb.Append("\tData compression is enabled with "); - switch (page.CompressionAlgo) + switch(page.CompressionAlgo) { case 3: sb.AppendLine("IBM ALDC with 512 byte buffer"); @@ -6119,15 +6119,15 @@ namespace DiscImageChef.Decoders.SCSI break; } } - if (page.DDE) + if(page.DDE) { sb.AppendLine("\tData decompression is enabled"); - if (page.DecompressionAlgo == 0) + if(page.DecompressionAlgo == 0) sb.AppendLine("\tLast data read was uncompressed"); else { sb.Append("\tLast data read was compressed with "); - switch (page.CompressionAlgo) + switch(page.CompressionAlgo) { case 3: sb.AppendLine("IBM ALDC with 512 byte buffer"); @@ -6201,19 +6201,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_1B? DecodeModePage_1B(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x1B) + if((pageResponse[0] & 0x3F) != 0x1B) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 12) + if(pageResponse.Length < 12) return null; ModePage_1B decoded = new ModePage_1B(); @@ -6236,7 +6236,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_1B(ModePage_1B? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_1B page = modePage.Value; @@ -6244,18 +6244,18 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Removable Block Access Capabilities page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.SFLP) + if(page.SFLP) sb.AppendLine("\tDrive can be used as a system floppy device"); - if (page.SRFP) + if(page.SRFP) sb.AppendLine("\tDrive supports reporting progress of format"); - if (page.NCD) + if(page.NCD) sb.AppendLine("\tDrive is a Non-CD Optical Device"); - if (page.SML) + if(page.SML) sb.AppendLine("\tDevice is a dual device supporting CD and Non-CD Optical"); - if (page.TLUN > 0) + if(page.TLUN > 0) sb.AppendFormat("\tDrive supports {0} LUNs", page.TLUN).AppendLine(); return sb.ToString(); @@ -6292,19 +6292,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_1C_SFF? DecodeModePage_1C_SFF(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x1C) + if((pageResponse[0] & 0x3F) != 0x1C) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 8) + if(pageResponse.Length < 8) return null; ModePage_1C_SFF decoded = new ModePage_1C_SFF(); @@ -6325,7 +6325,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_1C_SFF(ModePage_1C_SFF? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_1C_SFF page = modePage.Value; @@ -6333,15 +6333,15 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Timer & Protect page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.DISP) + if(page.DISP) sb.AppendLine("\tDrive is disabled until power is cycled"); - if (page.SWPP) + if(page.SWPP) sb.AppendLine("\tDrive is software write-protected until powered down"); - switch (page.InactivityTimeMultiplier) + switch(page.InactivityTimeMultiplier) { case 0: sb.AppendLine("\tDrive will remain in same status a vendor-specified time after a seek, read or write operation"); @@ -6431,19 +6431,19 @@ namespace DiscImageChef.Decoders.SCSI public static ModePage_00_SFF? DecodeModePage_00_SFF(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x00) + if((pageResponse[0] & 0x3F) != 0x00) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length < 4) + if(pageResponse.Length < 4) return null; ModePage_00_SFF decoded = new ModePage_00_SFF(); @@ -6466,7 +6466,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyModePage_00_SFF(ModePage_00_SFF? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; ModePage_00_SFF page = modePage.Value; @@ -6474,18 +6474,18 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("SCSI Drive Operation Mode page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.DVW) + if(page.DVW) sb.AppendLine("\tVerifying after writing is disabled"); - if (page.DDE) + if(page.DDE) sb.AppendLine("\tDrive will abort when a writing error is detected"); - if (page.SLM) + if(page.SLM) { sb.Append("\tDrive has two LUNs with rewritable being "); - if (page.SLM) + if(page.SLM) sb.AppendLine("LUN 1"); else sb.AppendLine("LUN 0"); @@ -6512,31 +6512,31 @@ namespace DiscImageChef.Decoders.SCSI public static DecodedMode? DecodeMode6(byte[] modeResponse, PeripheralDeviceTypes deviceType) { ModeHeader? hdr = DecodeModeHeader6(modeResponse, deviceType); - if (!hdr.HasValue) + if(!hdr.HasValue) return null; DecodedMode decoded = new DecodedMode(); decoded.Header = hdr.Value; int blkDrLength = 0; - if (decoded.Header.BlockDescriptors != null) + if(decoded.Header.BlockDescriptors != null) blkDrLength = decoded.Header.BlockDescriptors.Length; int offset = 4 + blkDrLength * 8; int length = modeResponse[0] + 1; - if (length != modeResponse.Length) + if(length != modeResponse.Length) return decoded; List listpages = new List(); - while (offset < modeResponse.Length) + while(offset < modeResponse.Length) { bool isSubpage = (modeResponse[offset] & 0x40) == 0x40; ModePage pg = new ModePage(); byte pageNo = (byte)(modeResponse[offset] & 0x3F); - if (pageNo == 0) - { + if(pageNo == 0) + { pg.PageResponse = new byte[modeResponse.Length - offset]; Array.Copy(modeResponse, offset, pg.PageResponse, 0, pg.PageResponse.Length); pg.Page = 0; @@ -6545,10 +6545,10 @@ namespace DiscImageChef.Decoders.SCSI } else { - if (isSubpage) + if(isSubpage) { pg.PageResponse = new byte[(modeResponse[offset + 2] << 8) + modeResponse[offset + 3] + 4]; - if ((pg.PageResponse.Length + offset) > modeResponse.Length) + if((pg.PageResponse.Length + offset) > modeResponse.Length) return decoded; Array.Copy(modeResponse, offset, pg.PageResponse, 0, pg.PageResponse.Length); pg.Page = (byte)(modeResponse[offset] & 0x3F); @@ -6558,7 +6558,7 @@ namespace DiscImageChef.Decoders.SCSI else { pg.PageResponse = new byte[modeResponse[offset + 1] + 2]; - if ((pg.PageResponse.Length + offset) > modeResponse.Length) + if((pg.PageResponse.Length + offset) > modeResponse.Length) return decoded; Array.Copy(modeResponse, offset, pg.PageResponse, 0, pg.PageResponse.Length); pg.Page = (byte)(modeResponse[offset] & 0x3F); @@ -6578,7 +6578,7 @@ namespace DiscImageChef.Decoders.SCSI public static DecodedMode? DecodeMode10(byte[] modeResponse, PeripheralDeviceTypes deviceType) { ModeHeader? hdr = DecodeModeHeader10(modeResponse, deviceType); - if (!hdr.HasValue) + if(!hdr.HasValue) return null; DecodedMode decoded = new DecodedMode(); @@ -6586,10 +6586,10 @@ namespace DiscImageChef.Decoders.SCSI bool longlba = (modeResponse[4] & 0x01) == 0x01; int offset; int blkDrLength = 0; - if (decoded.Header.BlockDescriptors != null) + if(decoded.Header.BlockDescriptors != null) blkDrLength = decoded.Header.BlockDescriptors.Length; - if (longlba) + if(longlba) offset = 8 + blkDrLength * 16; else offset = 8 + blkDrLength * 8; @@ -6597,18 +6597,18 @@ namespace DiscImageChef.Decoders.SCSI length += modeResponse[1]; length += 2; - if (length != modeResponse.Length) + if(length != modeResponse.Length) return decoded; List listpages = new List(); - while (offset < modeResponse.Length) + while(offset < modeResponse.Length) { bool isSubpage = (modeResponse[offset] & 0x40) == 0x40; ModePage pg = new ModePage(); byte pageNo = (byte)(modeResponse[offset] & 0x3F); - if (pageNo == 0) + if(pageNo == 0) { pg.PageResponse = new byte[modeResponse.Length - offset]; Array.Copy(modeResponse, offset, pg.PageResponse, 0, pg.PageResponse.Length); @@ -6618,11 +6618,11 @@ namespace DiscImageChef.Decoders.SCSI } else { - if (isSubpage) + if(isSubpage) { pg.PageResponse = new byte[(modeResponse[offset + 2] << 8) + modeResponse[offset + 3] + 4]; - if ((pg.PageResponse.Length + offset) > modeResponse.Length) + if((pg.PageResponse.Length + offset) > modeResponse.Length) return decoded; Array.Copy(modeResponse, offset, pg.PageResponse, 0, pg.PageResponse.Length); @@ -6634,7 +6634,7 @@ namespace DiscImageChef.Decoders.SCSI { pg.PageResponse = new byte[modeResponse[offset + 1] + 2]; - if ((pg.PageResponse.Length + offset) > modeResponse.Length) + if((pg.PageResponse.Length + offset) > modeResponse.Length) return decoded; Array.Copy(modeResponse, offset, pg.PageResponse, 0, pg.PageResponse.Length); @@ -6699,19 +6699,19 @@ namespace DiscImageChef.Decoders.SCSI public static Fujitsu_ModePage_3E? DecodeFujitsuModePage_3E(byte[] pageResponse) { - if (pageResponse == null) + if(pageResponse == null) return null; - if ((pageResponse[0] & 0x40) == 0x40) + if((pageResponse[0] & 0x40) == 0x40) return null; - if ((pageResponse[0] & 0x3F) != 0x3E) + if((pageResponse[0] & 0x3F) != 0x3E) return null; - if (pageResponse[1] + 2 != pageResponse.Length) + if(pageResponse[1] + 2 != pageResponse.Length) return null; - if (pageResponse.Length != 8) + if(pageResponse.Length != 8) return null; Fujitsu_ModePage_3E decoded = new Fujitsu_ModePage_3E(); @@ -6739,7 +6739,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifyFujitsuModePage_3E(Fujitsu_ModePage_3E? modePage) { - if (!modePage.HasValue) + if(!modePage.HasValue) return null; Fujitsu_ModePage_3E page = modePage.Value; @@ -6747,15 +6747,15 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("Fujitsu Verify Control Page:"); - if (page.PS) + if(page.PS) sb.AppendLine("\tParameters can be saved"); - if (page.audioVisualMode) + if(page.audioVisualMode) sb.AppendLine("\tAudio/Visual data support mode is applied"); - if (page.streamingMode) + if(page.streamingMode) sb.AppendLine("\tTest write operation is restricted during read or write operations."); - switch (page.verifyMode) + switch(page.verifyMode) { case Fujitsu_VerifyModes.Always: sb.AppendLine("\tAlways apply the verify operation"); diff --git a/SCSI/ModesEncoders.cs b/SCSI/ModesEncoders.cs index be7f6c5..bfe786c 100644 --- a/SCSI/ModesEncoders.cs +++ b/SCSI/ModesEncoders.cs @@ -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; diff --git a/SCSI/SSC/BlockLimits.cs b/SCSI/SSC/BlockLimits.cs index d9c45a7..aca3fbf 100644 --- a/SCSI/SSC/BlockLimits.cs +++ b/SCSI/SSC/BlockLimits.cs @@ -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(); } diff --git a/SCSI/SSC/DensitySupport.cs b/SCSI/SSC/DensitySupport.cs index a8e821b..a7d69c9 100644 --- a/SCSI/SSC/DensitySupport.cs +++ b/SCSI/SSC/DensitySupport.cs @@ -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 descriptors = new List(); 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 descriptors = new List(); 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,24 +242,24 @@ 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(); } - + sb.AppendFormat("\tMedium has a nominal length of {0} m in a {1} mm width tape", descriptor.length, (double)((double)descriptor.width / (double)10)).AppendLine(); sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine(); diff --git a/SCSI/Sense.cs b/SCSI/Sense.cs index d824070..9e42aaf 100644 --- a/SCSI/Sense.cs +++ b/SCSI/Sense.cs @@ -238,16 +238,16 @@ namespace DiscImageChef.Decoders.SCSI /// Sense bytes. public static SenseType GetType(byte[] sense) { - if (sense == null) + if(sense == null) return SenseType.Invalid; - if (sense.Length < 4) + if(sense.Length < 4) return SenseType.Invalid; - if ((sense[0] & 0x70) != 0x70) + if((sense[0] & 0x70) != 0x70) return sense.Length != 4 ? SenseType.Invalid : SenseType.StandardSense; - switch (sense[0] & 0x0F) + switch(sense[0] & 0x0F) { case 0: return SenseType.ExtendedSenseFixedCurrent; @@ -264,7 +264,7 @@ namespace DiscImageChef.Decoders.SCSI public static StandardSense? DecodeStandard(byte[] sense) { - if (GetType(sense) != SenseType.StandardSense) + if(GetType(sense) != SenseType.StandardSense) return null; StandardSense decoded = new StandardSense(); @@ -286,11 +286,11 @@ namespace DiscImageChef.Decoders.SCSI public static FixedSense? DecodeFixed(byte[] sense, out string senseDescription) { senseDescription = null; - if((sense[0] & 0x7F) != 0x70 && + if((sense[0] & 0x7F) != 0x70 && (sense[0] & 0x7F) != 0x71) return null; - if (sense.Length < 8) + if(sense.Length < 8) return null; FixedSense decoded = new FixedSense(); @@ -307,20 +307,20 @@ namespace DiscImageChef.Decoders.SCSI if(sense.Length >= 12) decoded.CommandSpecific = (uint)((sense[8] << 24) + (sense[9] << 16) + (sense[10] << 8) + sense[11]); - if (sense.Length >= 14) + if(sense.Length >= 14) { decoded.ASC = sense[12]; decoded.ASCQ = sense[13]; senseDescription = GetSenseDescription(decoded.ASC, decoded.ASCQ); } - if (sense.Length >= 15) + if(sense.Length >= 15) decoded.FieldReplaceable = sense[14]; if(sense.Length >= 18) decoded.SenseKeySpecific = (uint)((sense[15] << 16) + (sense[16] << 8) + sense[17]); - if (sense.Length > 18) + if(sense.Length > 18) { decoded.AdditionalSense = new byte[sense.Length - 18]; Array.Copy(sense, 18, decoded.AdditionalSense, 0, decoded.AdditionalSense.Length); @@ -339,10 +339,10 @@ namespace DiscImageChef.Decoders.SCSI { senseDescription = null; - if (sense == null) + if(sense == null) return null; - if (sense.Length < 8) + if(sense.Length < 8) return null; DescriptorSense decoded = new DescriptorSense(); @@ -355,9 +355,9 @@ namespace DiscImageChef.Decoders.SCSI senseDescription = GetSenseDescription(decoded.ASC, decoded.ASCQ); int offset = 8; - while (offset < sense.Length) + while(offset < sense.Length) { - if (offset + 2 < sense.Length) + if(offset + 2 < sense.Length) { byte descType = sense[offset]; int descLen = sense[offset + 1] + 1; @@ -380,8 +380,8 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifySense(byte[] sense) { SenseType type = GetType(sense); - - switch (type) + + switch(type) { case SenseType.StandardSense: return PrettifySense(DecodeStandard(sense)); @@ -398,7 +398,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifySense(StandardSense? sense) { - if (!sense.HasValue) + if(!sense.HasValue) return null; return sense.Value.AddressValid ? String.Format("Error class {0} type {1} happened on block {2}\n", @@ -409,7 +409,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifySense(FixedSense? sense) { - if (!sense.HasValue) + if(!sense.HasValue) return null; FixedSense decoded = sense.Value; @@ -417,37 +417,37 @@ namespace DiscImageChef.Decoders.SCSI StringBuilder sb = new StringBuilder(); sb.AppendFormat("SCSI SENSE: {0}", GetSenseKey(decoded.SenseKey)).AppendLine(); - if (decoded.SegmentNumber > 0) + if(decoded.SegmentNumber > 0) sb.AppendFormat("On segment {0}", decoded.SegmentNumber).AppendLine(); - if (decoded.Filemark) + if(decoded.Filemark) sb.AppendLine("Filemark or setmark found"); - if (decoded.EOM) + if(decoded.EOM) sb.AppendLine("End-of-medium/partition found"); - if (decoded.ILI) + if(decoded.ILI) sb.AppendLine("Incorrect length indicator"); - if (decoded.InformationValid) + if(decoded.InformationValid) sb.AppendFormat("On logical block {0}", decoded.Information).AppendLine(); - if (decoded.AdditionalLength < 6) + if(decoded.AdditionalLength < 6) return sb.ToString(); sb.AppendLine(GetSenseDescription(decoded.ASC, decoded.ASCQ)); - if (decoded.AdditionalLength < 10) + if(decoded.AdditionalLength < 10) return sb.ToString(); - if (decoded.SKSV) + if(decoded.SKSV) { - switch (decoded.SenseKey) + switch(decoded.SenseKey) { case SenseKeys.IllegalRequest: { - if ((decoded.SenseKeySpecific & 0x400000) == 0x400000) + if((decoded.SenseKeySpecific & 0x400000) == 0x400000) sb.AppendLine("Illegal field in CDB"); else sb.AppendLine("Illegal field in data parameters"); - if ((decoded.SenseKeySpecific & 0x200000) == 0x200000) + if((decoded.SenseKeySpecific & 0x200000) == 0x200000) sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB", (decoded.SenseKeySpecific & 0x70000) >> 16, decoded.SenseKeySpecific & 0xFFFF).AppendLine(); @@ -473,7 +473,7 @@ namespace DiscImageChef.Decoders.SCSI public static string PrettifySense(DescriptorSense? sense) { - if (!sense.HasValue) + if(!sense.HasValue) return null; DescriptorSense decoded = sense.Value; @@ -486,9 +486,9 @@ namespace DiscImageChef.Decoders.SCSI if(decoded.Descriptors == null || decoded.Descriptors.Count == 0) return sb.ToString(); - foreach (KeyValuePair kvp in decoded.Descriptors) + foreach(KeyValuePair kvp in decoded.Descriptors) { - switch (kvp.Key) + switch(kvp.Key) { case 0x00: sb.AppendLine(PrettifyDescriptor00(kvp.Value)); @@ -506,7 +506,7 @@ namespace DiscImageChef.Decoders.SCSI /// Descriptor. public static UInt64 DecodeDescriptor00(byte[] descriptor) { - if (descriptor.Length != 12 || descriptor[0] != 0x00) + if(descriptor.Length != 12 || descriptor[0] != 0x00) return 0; byte[] temp = new byte[8]; @@ -530,7 +530,7 @@ namespace DiscImageChef.Decoders.SCSI /// Descriptor. public static UInt64 DecodeDescriptor01(byte[] descriptor) { - if (descriptor.Length != 12 || descriptor[0] != 0x01) + if(descriptor.Length != 12 || descriptor[0] != 0x01) return 0; byte[] temp = new byte[8]; @@ -554,7 +554,7 @@ namespace DiscImageChef.Decoders.SCSI /// Descriptor. public static byte[] DecodeDescriptor02(byte[] descriptor) { - if (descriptor.Length != 8 || descriptor[0] != 0x02) + if(descriptor.Length != 8 || descriptor[0] != 0x02) return null; byte[] temp = new byte[3]; @@ -569,7 +569,7 @@ namespace DiscImageChef.Decoders.SCSI /// Descriptor. public static byte DecodeDescriptor03(byte[] descriptor) { - if (descriptor.Length != 4 || descriptor[0] != 0x03) + if(descriptor.Length != 4 || descriptor[0] != 0x03) return 0; return descriptor[3]; @@ -582,7 +582,7 @@ namespace DiscImageChef.Decoders.SCSI /// Descriptor. public static AnotherProgressIndicationSenseDescriptor? DecodeDescriptor0A(byte[] descriptor) { - if (descriptor.Length != 8 || descriptor[0] != 0x0A) + if(descriptor.Length != 8 || descriptor[0] != 0x0A) return null; AnotherProgressIndicationSenseDescriptor decoded = new AnotherProgressIndicationSenseDescriptor(); @@ -657,7 +657,7 @@ namespace DiscImageChef.Decoders.SCSI public static string GetSenseKey(SenseKeys key) { - switch (key) + switch(key) { case SenseKeys.AbortedCommand: return "ABORTED COMMAND"; @@ -696,10 +696,10 @@ namespace DiscImageChef.Decoders.SCSI public static string GetSenseDescription(byte ASC, byte ASCQ) { - switch (ASC) + switch(ASC) { case 0x00: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "NO ADDITIONAL SENSE INFORMATION"; @@ -754,21 +754,21 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x01: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "NO INDEX/SECTOR SIGNAL"; } break; case 0x02: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "NO SEEK COMPLETE"; } break; case 0x03: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "PERIPHERAL DEVICE WRITE FAULT"; @@ -779,7 +779,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x04: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL UNIT NOT READY, CAUSE NOT REPORTABLE"; @@ -852,28 +852,28 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x05: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL UNIT DOES NOT RESPOND TO SELECTION"; } break; case 0x06: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "NO REFERENCE POSITION FOUND"; } break; case 0x07: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "MULTIPLE PERIPHERAL DEVICES SELECTED"; } break; case 0x08: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL UNIT COMMUNICATION FAILURE"; @@ -888,7 +888,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x09: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "TRACK FLOLLOWING ERROR"; @@ -905,14 +905,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x0A: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ERROR LOG OVERFLOW"; } break; case 0x0B: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "WARNING"; @@ -954,7 +954,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x0C: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "WRITE ERROR"; @@ -997,7 +997,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x0D: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ERROR DETECTED BY THIRD PARTY TEMPORARY INITIATOR"; @@ -1014,7 +1014,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x0E: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INVALID INFORMATION UNIT"; @@ -1027,7 +1027,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x10: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ID CRC OR ECC ERROR"; @@ -1044,7 +1044,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x11: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "UNRECOVERED READ ERROR"; @@ -1093,21 +1093,21 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x12: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ADDRESS MARK NOT FOUND FOR ID FIELD"; } break; case 0x13: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ADDRESS MARK NOT FOUND FOR DATA FIELD"; } break; case 0x14: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RECORDED ENTITY NOT FOUND"; @@ -1128,7 +1128,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x15: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RANDOM POSITIONING ERROR"; @@ -1139,7 +1139,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x16: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "DATA SYNCHRONIZATION MARK ERROR"; @@ -1154,7 +1154,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x17: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RECOVERED DATA WITH NO ERROR CORRECTION APPLIED"; @@ -1179,7 +1179,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x18: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RECOVERED DATA WITH ERROR CORRECTION APPLIED"; @@ -1202,7 +1202,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x19: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "DEFECT LIST ERROR"; @@ -1215,21 +1215,21 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x1A: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "PARAMETER LIST LENGTH ERROR"; } break; case 0x1B: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SYNCHRONOUS DATA TRANSFER ERROR"; } break; case 0x1C: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "DEFECT LIST NOT FOUND"; @@ -1240,7 +1240,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x1D: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "MISCOMPARE DURING VERIFY OPERATION"; @@ -1249,21 +1249,21 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x1E: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RECOVERED ID WITH ECC CORRECTION"; } break; case 0x1F: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "PARTIAL DEFECT LIST TRANSFER"; } break; case 0x20: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INVALID COMMAND OPERATION CODE"; @@ -1294,7 +1294,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x21: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL BLOCK ADDRESS OUT OF RANGE"; @@ -1315,14 +1315,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x22: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ILLEGAL FUNCTION"; } break; case 0x23: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INVALID TOKEN OPERATION, CAUSE NOT REPORTABLE"; @@ -1349,7 +1349,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x24: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ILLEGAL FIELD IN CDB"; @@ -1372,14 +1372,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x25: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL UNIT NOT SUPPORTED"; } break; case 0x26: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INVALID FIELD IN PARAMETER LIST"; @@ -1424,7 +1424,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x27: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "WRITE PROTECTED"; @@ -1447,7 +1447,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x28: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "NOT READY TO READY CHANGE (MEDIUM MAY HAVE CHANGED)"; @@ -1460,7 +1460,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x29: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "POWER ON, RESET, OR BUS DEVICE RESET OCCURRED"; @@ -1481,7 +1481,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x2A: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "PARAMETERS CHANGED"; @@ -1526,14 +1526,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x2B: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "COPY CANNOT EXECUTE SINCE HOST CANNOT DISCONNECT"; } break; case 0x2C: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "COMMAND SEQUENCE ERROR"; @@ -1572,14 +1572,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x2D: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "OVERWRITE ERROR ON UPDATE IN PLACE"; } break; case 0x2E: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INSUFFICIENT TIME FOR OPERATION"; @@ -1592,7 +1592,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x2F: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "COMMANDS CLEARED BY ANOTHER INITIATOR"; @@ -1605,7 +1605,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x30: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INCOMPATIBLE MEDIUM INSTALLED"; @@ -1644,7 +1644,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x31: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "MEDIUM FORMAT CORRUPTED"; @@ -1657,7 +1657,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x32: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "NO DEFECT SPARE LOCATION AVAILABLE"; @@ -1666,21 +1666,21 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x33: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "TAPE LENGTH ERROR"; } break; case 0x34: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ENCLOSURE FAILURE"; } break; case 0x35: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ENCLOSURE SERVICES FAILURE"; @@ -1697,21 +1697,21 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x36: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RIBBON, INK, OR TONER FAILURE"; } break; case 0x37: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ROUNDED PARAMETER"; } break; case 0x38: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "EVENT STATUS NOTIFICATION"; @@ -1726,14 +1726,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x39: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SAVING PARAMETERS NOT SUPPORTED"; } break; case 0x3A: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "MEDIUM NOT PRESENT"; @@ -1748,7 +1748,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x3B: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SEQUENTIAL POSITIONING ERROR"; @@ -1809,14 +1809,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x3D: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INVALID BITS IN IDENTIFY MESSAGE"; } break; case 0x3E: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL UNIT HAS NOT SELF-CONFIGURED YET"; @@ -1831,7 +1831,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x3F: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "TARGET OPERATING CONDITIONS HAVE CHANGED"; @@ -1884,7 +1884,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x40: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RAM FAILURE"; @@ -1892,28 +1892,28 @@ namespace DiscImageChef.Decoders.SCSI return String.Format("DIAGNOSTIC FAILURE ON COMPONENT {0:X2}h", ASCQ); } case 0x41: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "DATA PATH FAILURE"; } break; case 0x42: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "POWER-ON OR SELF-TEST FAILURE"; } break; case 0x43: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "MESSAGE ERROR"; } break; case 0x44: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INTERNAL TARGET FAILURE"; @@ -1924,21 +1924,21 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x45: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SELECT OR RESELECT FAILURE"; } break; case 0x46: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "UNSUCCESSFUL SOFT RESET"; } break; case 0x47: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SCSI PARITY ERROR"; @@ -1959,28 +1959,28 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x48: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INITIATOR DETECTED ERROR MESSAGE RECEIVED"; } break; case 0x49: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INVALID MESSAGE ERROR"; } break; case 0x4A: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "COMMAND PHASE ERROR"; } break; case 0x4B: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "DATA PHASE ERROR"; @@ -2029,7 +2029,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x4C: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL UNIT FAILED SELF-CONFIGURATION"; @@ -2038,7 +2038,7 @@ namespace DiscImageChef.Decoders.SCSI case 0x4E: return String.Format("OVERLAPPED COMMANDS ATTEMPTED FOR TASK TAG {0:X2}h", ASCQ); case 0x50: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "WRITE APPEND ERROR"; @@ -2049,7 +2049,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x51: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ERASE FAILURE"; @@ -2058,14 +2058,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x52: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "CARTRIDGE FAULT"; } break; case 0x53: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "MEDIA LOAD OR EJECT FAILED"; @@ -2098,14 +2098,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x54: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SCSI TO HOST SYSTEM INTERFACE FAILURE"; } break; case 0x55: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SYSTEM RESOURCE FAILURE"; @@ -2144,28 +2144,28 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x57: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "UNABLE TO RECOVER TABLE-OF-CONTENTS"; } break; case 0x58: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "GENERATION DOES NOT EXIST"; } break; case 0x59: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "UPDATED BLOCK READ"; } break; case 0x5A: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "OPERATOR REQUEST OR STATE CHANGE INPUT"; @@ -2178,7 +2178,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x5B: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOG EXCEPTION"; @@ -2191,7 +2191,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x5C: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RPL STATUS CHANGE"; @@ -2362,7 +2362,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x5E: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOW POWER CONDITION ON"; @@ -2399,14 +2399,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x60: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LAMP FAILURE"; } break; case 0x61: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "VIDEO ACQUISTION ERROR"; @@ -2417,14 +2417,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x62: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SCAN HEAD POSITIONING ERROR"; } break; case 0x63: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "END OF USER AREA ENCOUNTERED ON THIS TRACK"; @@ -2433,7 +2433,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x64: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "ILLEGAL MODE FOR THIS TRACK"; @@ -2442,14 +2442,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x65: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "VOLTAGE FAULT"; } break; case 0x66: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "AUTOMATIC DOCUMENT FEEDER COVER UP"; @@ -2462,7 +2462,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x67: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "CONFIGURATION FAILURE"; @@ -2491,7 +2491,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x68: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "LOGICAL UNIT NOT CONFIGURED"; @@ -2500,7 +2500,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x69: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "DATA LOSS ON LOGICAL UNIT"; @@ -2511,14 +2511,14 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x6A: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "INFORMATIONAL, REFER TO LOG"; } break; case 0x6B: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "STATE CHANGE HAS OCCURRED"; @@ -2529,28 +2529,28 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x6C: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "REBUILD FAILURE OCCURRED"; } break; case 0x6D: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "RECALCULATE FAILURE OCCURRED"; } break; case 0x6E: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "COMMAND TO LOGICAL UNIT FAILED"; } break; case 0x6F: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "COPY PROTECTION KEY EXCHANGE FAILURE - AUTHENTICATION FAILURE"; @@ -2573,14 +2573,14 @@ namespace DiscImageChef.Decoders.SCSI case 0x70: return String.Format("DECOMPRESSION EXCEPTION SHORT ALGORITHM ID OF {0:X2}h", ASCQ); case 0x71: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "DECOMPRESSIONG EXCEPTION LONG ALGORITHM ID"; } break; case 0x72: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SESSION FIXATION ERROR"; @@ -2601,7 +2601,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x73: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "CD CONTROL ERROR"; @@ -2626,7 +2626,7 @@ namespace DiscImageChef.Decoders.SCSI } break; case 0x74: - switch (ASCQ) + switch(ASCQ) { case 0x00: return "SECURITY ERROR"; diff --git a/SCSI/Types.cs b/SCSI/Types.cs index 16642d1..e9a7c06 100644 --- a/SCSI/Types.cs +++ b/SCSI/Types.cs @@ -598,7 +598,7 @@ namespace DiscImageChef.Decoders.SCSI /// Exatape75m = 0xD7, - + #endregion Medium Types found in vendor documents } diff --git a/SCSI/VendorString.cs b/SCSI/VendorString.cs index d5908cd..cc02a45 100644 --- a/SCSI/VendorString.cs +++ b/SCSI/VendorString.cs @@ -43,7 +43,7 @@ namespace DiscImageChef.Decoders.SCSI { public static string Prettify(string SCSIVendorString) { - switch (SCSIVendorString) + switch(SCSIVendorString) { case "0B4C": return "MOOSIK Ltd."; diff --git a/Xbox/DMI.cs b/Xbox/DMI.cs index d61d8a8..eb2dde9 100644 --- a/Xbox/DMI.cs +++ b/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();