mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Use preferred braces style.
This commit is contained in:
@@ -269,7 +269,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(page.Size)
|
||||
{
|
||||
if(page.CacheSegmentSize > 0)
|
||||
{
|
||||
if(page.LBCSS)
|
||||
sb.AppendFormat("\tDrive cache segments should be {0} blocks long", page.CacheSegmentSize)
|
||||
.AppendLine();
|
||||
@@ -277,7 +276,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\tDrive cache segments should be {0} bytes long", page.CacheSegmentSize)
|
||||
.AppendLine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(page.CacheSegments > 0)
|
||||
|
||||
@@ -338,13 +338,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
page.ReadyAENHoldOffPeriod).AppendLine();
|
||||
|
||||
if(page.BusyTimeoutPeriod > 0)
|
||||
{
|
||||
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", page.BusyTimeoutPeriod * 100)
|
||||
.AppendLine();
|
||||
}
|
||||
|
||||
if(page.ExtendedSelfTestCompletionTime > 0)
|
||||
sb.AppendFormat("\t{0} seconds to complete extended self-test", page.ExtendedSelfTestCompletionTime);
|
||||
|
||||
@@ -315,10 +315,8 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(page.PRMWP) sb.AppendLine("\tPermanent write protect is enabled");
|
||||
|
||||
if(page.BAML)
|
||||
{
|
||||
if(page.BAM) sb.AppendLine("\tDrive operates using explicit address mode");
|
||||
else sb.AppendLine("\tDrive operates using implicit address mode");
|
||||
}
|
||||
|
||||
switch(page.RewindOnReset)
|
||||
{
|
||||
|
||||
@@ -247,16 +247,12 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\tMedium has defined {0} partitions", page.PartitionSizes.Length).AppendLine();
|
||||
|
||||
for(int i = 0; i < page.PartitionSizes.Length; i++)
|
||||
{
|
||||
if(page.PartitionSizes[i] == 0)
|
||||
{
|
||||
if(page.PartitionSizes.Length == 1)
|
||||
sb.AppendLine("\tDevice recognizes one single partition spanning whole medium");
|
||||
else sb.AppendFormat("\tPartition {0} runs for rest of medium", i).AppendLine();
|
||||
}
|
||||
else
|
||||
sb.AppendFormat("\tPartition {0} is {1} {2} long", i, page.PartitionSizes[i], measure).AppendLine();
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -184,10 +184,8 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(page.LogErr) sb.AppendLine("\tDrive shall log informational exception conditions");
|
||||
|
||||
if(page.IntervalTimer > 0)
|
||||
{
|
||||
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)
|
||||
sb.AppendFormat("\tInformational exception conditions will be reported a maximum of {0} times",
|
||||
|
||||
@@ -108,7 +108,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
if(page.FirmwareTestControl == page.FirmwareTestControl2)
|
||||
{
|
||||
switch(page.FirmwareTestControl)
|
||||
{
|
||||
case 0:
|
||||
@@ -124,7 +123,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\tUnknown factory test code {0}", page.FirmwareTestControl).AppendLine();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch(page.ExtendedPOSTMode)
|
||||
{
|
||||
|
||||
@@ -377,22 +377,16 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
if(page.ReadCDRW)
|
||||
{
|
||||
if(page.WriteCDRW) sb.AppendLine("\tDrive can read and write CD-RW");
|
||||
else sb.AppendLine("\tDrive can read CD-RW");
|
||||
}
|
||||
|
||||
if(page.ReadDVDROM) sb.AppendLine("\tDrive can read DVD-ROM");
|
||||
if(page.ReadDVDR)
|
||||
{
|
||||
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.WriteDVDRAM) sb.AppendLine("\tDrive can read and write DVD-RAM");
|
||||
else sb.AppendLine("\tDrive can read DVD-RAM");
|
||||
}
|
||||
|
||||
if(page.Composite) sb.AppendLine("\tDrive can deliver a composite audio and video data stream");
|
||||
if(page.DigitalPort1) sb.AppendLine("\tDrive supports IEC-958 digital output on port 1");
|
||||
@@ -419,20 +413,14 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
if(page.WriteSpeedPerformanceDescriptors != null)
|
||||
{
|
||||
foreach(ModePage_2A_WriteDescriptor descriptor in page.WriteSpeedPerformanceDescriptors)
|
||||
{
|
||||
if(descriptor.WriteSpeed > 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)
|
||||
sb.AppendFormat("\tDrive supports writing at is {0} Kbyte/sec. in pure CAV mode",
|
||||
descriptor.WriteSpeed).AppendLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(page.TestWrite) sb.AppendLine("\tDrive supports test writing");
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(header.Value.DPOFUA) sb.AppendLine("\tDrive supports DPO and FUA bits");
|
||||
|
||||
if(header.Value.BlockDescriptors != null)
|
||||
{
|
||||
foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors)
|
||||
{
|
||||
string density = "";
|
||||
@@ -138,16 +137,13 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
if(density != "")
|
||||
{
|
||||
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)
|
||||
sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength)
|
||||
.AppendLine();
|
||||
@@ -155,8 +151,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks,
|
||||
descriptor.BlockLength).AppendLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -373,7 +367,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\tMedium is {0}", medium).AppendLine();
|
||||
|
||||
if(header.Value.BlockDescriptors != null)
|
||||
{
|
||||
foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors)
|
||||
{
|
||||
string density = "";
|
||||
@@ -1463,9 +1456,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
if(density != "")
|
||||
{
|
||||
if(descriptor.Blocks == 0)
|
||||
{
|
||||
if(descriptor.BlockLength == 0)
|
||||
sb
|
||||
.AppendFormat("\tAll remaining blocks conform to {0} and have a variable length",
|
||||
@@ -1473,9 +1464,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
else
|
||||
sb.AppendFormat("\tAll remaining blocks conform to {0} and are {1} bytes each",
|
||||
density, descriptor.BlockLength).AppendLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(descriptor.BlockLength == 0)
|
||||
sb.AppendFormat("\t{0} blocks conform to {1} and have a variable length",
|
||||
descriptor.Blocks, density).AppendLine();
|
||||
@@ -1483,20 +1472,14 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\t{0} blocks conform to {1} and are {2} bytes each",
|
||||
descriptor.Blocks, density, descriptor.BlockLength)
|
||||
.AppendLine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(descriptor.Blocks == 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)
|
||||
sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks)
|
||||
.AppendLine();
|
||||
@@ -1504,9 +1487,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks,
|
||||
descriptor.BlockLength).AppendLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1575,7 +1555,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(header.Value.DPOFUA) sb.AppendLine("\tDrive supports DPO and FUA bits");
|
||||
|
||||
if(header.Value.BlockDescriptors != null)
|
||||
{
|
||||
foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors)
|
||||
{
|
||||
string density = "";
|
||||
@@ -1620,18 +1599,14 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
if(density != "")
|
||||
{
|
||||
if(descriptor.Blocks == 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)
|
||||
sb.AppendFormat("\t{0} blocks are {1} and have a variable length",
|
||||
descriptor.Blocks, density).AppendLine();
|
||||
@@ -1639,20 +1614,14 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\t{0} blocks are {1} and are {2} bytes each",
|
||||
descriptor.Blocks, density, descriptor.BlockLength)
|
||||
.AppendLine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(descriptor.Blocks == 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)
|
||||
sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks)
|
||||
.AppendLine();
|
||||
@@ -1660,9 +1629,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks,
|
||||
descriptor.BlockLength).AppendLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1793,7 +1759,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(header.Value.DPOFUA) sb.AppendLine("\tDrive supports DPO and FUA bits");
|
||||
|
||||
if(header.Value.BlockDescriptors != null)
|
||||
{
|
||||
foreach(BlockDescriptor descriptor in header.Value.BlockDescriptors)
|
||||
{
|
||||
string density = "";
|
||||
@@ -1830,16 +1795,13 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
|
||||
if(density != "")
|
||||
{
|
||||
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)
|
||||
sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength)
|
||||
.AppendLine();
|
||||
@@ -1847,8 +1809,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks,
|
||||
descriptor.BlockLength).AppendLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
bool longLBA = (modeResponse[4] & 0x01) == 0x01;
|
||||
|
||||
if(blockDescLength > 0)
|
||||
{
|
||||
if(longLBA)
|
||||
{
|
||||
header.BlockDescriptors = new BlockDescriptor[blockDescLength / 16];
|
||||
@@ -86,9 +85,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
header.BlockDescriptors[i] = new BlockDescriptor();
|
||||
if(deviceType != PeripheralDeviceTypes.DirectAccess)
|
||||
{
|
||||
header.BlockDescriptors[i].Density = (DensityType)modeResponse[0 + i * 8 + 8];
|
||||
}
|
||||
else
|
||||
{
|
||||
header.BlockDescriptors[i].Density = DensityType.Default;
|
||||
@@ -102,7 +99,6 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
header.BlockDescriptors[i].BlockLength += modeResponse[7 + i * 8 + 8];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(deviceType == PeripheralDeviceTypes.DirectAccess || deviceType == PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user