mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Use preferred braces style.
This commit is contained in:
@@ -186,10 +186,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0xFF, 5, out duration);
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0x00, 5, out duration);
|
||||
}
|
||||
|
||||
if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode10(modeBuf, devType);
|
||||
|
||||
@@ -198,10 +196,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0x00,
|
||||
5, out duration);
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0x00, 5, out duration);
|
||||
}
|
||||
if(sense || dev.Error) sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out duration);
|
||||
|
||||
if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode6(modeBuf, devType);
|
||||
@@ -245,14 +241,11 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
|
||||
if(sense && blocks == 0)
|
||||
{
|
||||
// Not all MMC devices support READ CAPACITY, as they have READ TOC
|
||||
if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to get media capacity");
|
||||
DicConsole.ErrorWriteLine("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
}
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -337,10 +330,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ GET CONFIGURATION:\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_getconfiguration_current.bin",
|
||||
@@ -447,29 +438,21 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.RecognizedFormatLayers, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: Recognized Format Layers\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_formatlayers.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.WriteProtectionStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Write Protection Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_writeprotection.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
|
||||
// More like a drive information
|
||||
/*
|
||||
@@ -492,10 +475,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin",
|
||||
@@ -507,7 +488,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
// False book types
|
||||
if(dskType == MediaType.DVDROM)
|
||||
{
|
||||
switch(decPfi.Value.DiskCategory)
|
||||
{
|
||||
case Decoders.DVD.DiskCategory.DVDPR:
|
||||
@@ -557,7 +537,6 @@ namespace DiscImageChef.Commands
|
||||
dskType = MediaType.UMD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,10 +544,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin",
|
||||
@@ -600,10 +577,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: CMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_cmi.bin",
|
||||
@@ -621,27 +596,19 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.BurstCuttingArea, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_bca.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdAacs, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD AACS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_aacs.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-ROM and HD DVD-ROM
|
||||
|
||||
@@ -711,10 +678,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_dds.bin",
|
||||
@@ -725,10 +690,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdramMediumStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Medium Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_status.bin",
|
||||
@@ -739,10 +702,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: SAI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_spare.bin",
|
||||
@@ -759,15 +720,11 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.LastBorderOutRmd, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last-Out Border RMD\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_lastrmd.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R and HD DVD-R
|
||||
|
||||
@@ -777,15 +734,11 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PreRecordedInfo, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Pre-Recorded Info\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pri.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R and DVD-RW
|
||||
|
||||
@@ -796,28 +749,20 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdrMediaIdentifier, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R Media ID\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_mediaid.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrPhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R PFI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_pfi.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R, DVD-RW and HD DVD-R
|
||||
|
||||
@@ -828,28 +773,20 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Adip, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: ADIP\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_adip.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Dcb, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DCB\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_dcb.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion All DVD+
|
||||
|
||||
@@ -860,15 +797,11 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.HddvdCopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD CMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvd_cmi.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion HD DVD-ROM
|
||||
|
||||
@@ -879,28 +812,20 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.HddvdrMediumStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: HDDVD-R Medium Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_status.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.HddvdrLastRmd, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last RMD\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_lastrmd.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion HD DVD-R
|
||||
|
||||
@@ -912,15 +837,11 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdrLayerCapacity, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Layer Capacity\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_layercap.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R DL, DVD-RW DL, DVD+R DL, DVD+RW DL
|
||||
|
||||
@@ -930,55 +851,39 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.MiddleZoneStart, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Middle Zone Start\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mzs.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.JumpIntervalSize, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Jump Interval Size\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_jis.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.ManualLayerJumpStartLba, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: Manual Layer Jump Start LBA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_manuallj.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.RemapAnchorPoint, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Remap Anchor Point\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_remapanchor.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R DL
|
||||
|
||||
@@ -989,10 +894,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_di.bin",
|
||||
@@ -1002,15 +905,11 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.Pac, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PAC\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_pac.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion All Blu-ray
|
||||
|
||||
@@ -1021,10 +920,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.BdBurstCuttingArea, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_bca.bin",
|
||||
@@ -1041,10 +938,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdDds, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dds.bin",
|
||||
@@ -1055,10 +950,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.CartridgeStatus, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Cartridge Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_cartstatus.bin",
|
||||
@@ -1069,11 +962,9 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.BdSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: Spare Area Information\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_spare.bin",
|
||||
@@ -1084,23 +975,17 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.RawDfl, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Raw DFL\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dfl.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf,
|
||||
MmcDiscInformationDataTypes.TrackResources, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 001b\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("Track Resources Information:\n{0}",
|
||||
@@ -1111,10 +996,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.PowResources,
|
||||
dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 010b\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("POW Resources Information:\n{0}",
|
||||
@@ -1136,10 +1019,8 @@ namespace DiscImageChef.Commands
|
||||
bool tocSense =
|
||||
dev.ReadTocPmaAtip(out cmdBuf, out senseBuf, false, 0, 0, dev.Timeout, out duration);
|
||||
if(tocSense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: TOC\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
toc = Decoders.CD.TOC.Decode(cmdBuf);
|
||||
@@ -1154,10 +1035,8 @@ namespace DiscImageChef.Commands
|
||||
// ATIP exists on blank CDs
|
||||
sense = dev.ReadAtip(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: ATIP\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_atip.bin", "SCSI READ TOC/PMA/ATIP",
|
||||
@@ -1178,10 +1057,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscInformationDataTypes.DiscInformation, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 000b\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
Decoders.SCSI.MMC.DiscInformation.StandardDiscInformation? discInfo =
|
||||
@@ -1195,7 +1072,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
// If it is a read-only CD, check CD type if available
|
||||
if(dskType == MediaType.CD)
|
||||
{
|
||||
switch(discInfo.Value.DiscType)
|
||||
{
|
||||
case 0x10:
|
||||
@@ -1205,7 +1081,6 @@ namespace DiscImageChef.Commands
|
||||
dskType = MediaType.CDROMXA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1214,10 +1089,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadSessionInfo(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Session info\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_session.bin",
|
||||
@@ -1239,7 +1112,6 @@ namespace DiscImageChef.Commands
|
||||
bool hasVideoTrack = false;
|
||||
|
||||
if(toc.HasValue)
|
||||
{
|
||||
foreach(Decoders.CD.TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors)
|
||||
{
|
||||
if(track.TrackNumber == 1 &&
|
||||
@@ -1260,7 +1132,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
hasVideoTrack |= track.ADR == 4;
|
||||
}
|
||||
}
|
||||
|
||||
if(hasDataTrack && hasAudioTrack && allFirstSessionTracksAreAudio && sessions == 2)
|
||||
dskType = MediaType.CDPLUS;
|
||||
@@ -1271,10 +1142,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadRawToc(out cmdBuf, out senseBuf, 1, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Raw TOC\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_rawtoc.bin",
|
||||
@@ -1283,10 +1152,8 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
sense = dev.ReadPma(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: PMA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_pma.bin", "SCSI READ TOC/PMA/ATIP",
|
||||
@@ -1296,19 +1163,15 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadCdText(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: CD-TEXT\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_cdtext.bin",
|
||||
"SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
if(Decoders.CD.CDTextOnLeadIn.Decode(cmdBuf).HasValue)
|
||||
{
|
||||
DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}",
|
||||
Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1321,10 +1184,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin",
|
||||
@@ -1335,26 +1196,20 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(cmdBuf));
|
||||
if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo &&
|
||||
nintendoPfi.Value.PartVersion == 15)
|
||||
{
|
||||
if(nintendoPfi.Value.DiscSize == Decoders.DVD.DVDSize.Eighty) dskType = MediaType.GOD;
|
||||
else if(nintendoPfi.Value.DiscSize == Decoders.DVD.DVDSize.OneTwenty)
|
||||
dskType = MediaType.WOD;
|
||||
}
|
||||
}
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion Nintendo
|
||||
}
|
||||
@@ -1374,15 +1229,11 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
sense = dev.KreonExtractSs(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "KREON EXTRACT SS:\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_xbox_ss.bin", "KREON EXTRACT SS",
|
||||
cmdBuf);
|
||||
}
|
||||
|
||||
if(Decoders.Xbox.SS.Decode(cmdBuf).HasValue)
|
||||
DicConsole.WriteLine("Xbox Security Sector:\n{0}", Decoders.Xbox.SS.Prettify(cmdBuf));
|
||||
@@ -1486,10 +1337,8 @@ namespace DiscImageChef.Commands
|
||||
#endregion Xbox
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
{
|
||||
dskType = MediaTypeFromScsi.Get((byte)dev.ScsiType, dev.Manufacturer, dev.Model, scsiMediumType,
|
||||
scsiDensityCode, blocks, blockSize);
|
||||
}
|
||||
|
||||
if(dskType == MediaType.Unknown && dev.IsUsb && containsFloppyPage) dskType = MediaType.FlashDrive;
|
||||
|
||||
@@ -1498,10 +1347,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadMediaSerialNumber(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ MEDIA SERIAL NUMBER\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_mediaserialnumber.bin",
|
||||
|
||||
Reference in New Issue
Block a user