REFACTOR: Final cleanup of DiscImageChef.Decoders.

This commit is contained in:
2017-12-23 18:31:38 +00:00
parent 60ed13e9b3
commit 354e31d149
100 changed files with 4791 additions and 4707 deletions

View File

@@ -31,6 +31,7 @@
// ****************************************************************************/ // ****************************************************************************/
using System; using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
@@ -1888,10 +1889,8 @@ namespace DiscImageChef.Decoders.ATA
IdentifyDevice ATAID = IdentifyDeviceResponse.Value; 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) atapi = true;
atapi = true; else cfa = true;
else
cfa = true;
if(atapi) sb.AppendLine("ATAPI device"); if(atapi) sb.AppendLine("ATAPI device");
else if(cfa) sb.AppendLine("CompactFlash device"); else if(cfa) sb.AppendLine("CompactFlash device");
@@ -1914,7 +1913,8 @@ namespace DiscImageChef.Decoders.ATA
if(ATAID.MediaSerial != "") sb.AppendFormat("Media serial #: {0}", ATAID.MediaSerial).AppendLine(); if(ATAID.MediaSerial != "") sb.AppendFormat("Media serial #: {0}", ATAID.MediaSerial).AppendLine();
} }
if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.WWN)) sb.AppendFormat("World Wide Name: {0:X16}", ATAID.WWN).AppendLine(); if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.WWN))
sb.AppendFormat("World Wide Name: {0:X16}", ATAID.WWN).AppendLine();
} }
bool ata1 = false, bool ata1 = false,
@@ -2381,10 +2381,7 @@ namespace DiscImageChef.Decoders.ATA
else logicalsectorsize = 512; else logicalsectorsize = 512;
if((ATAID.PhysLogSectorSize & 0x2000) == 0x2000) if((ATAID.PhysLogSectorSize & 0x2000) == 0x2000)
{ physicalsectorsize = logicalsectorsize * (uint)Math.Pow(2, ATAID.PhysLogSectorSize & 0xF);
physicalsectorsize =
logicalsectorsize * (uint)Math.Pow(2, ATAID.PhysLogSectorSize & 0xF);
}
else physicalsectorsize = logicalsectorsize; else physicalsectorsize = logicalsectorsize;
} }
else else
@@ -2422,9 +2419,11 @@ namespace DiscImageChef.Decoders.ATA
ATAID.Cylinders * ATAID.Heads * ATAID.SectorsPerTrack).AppendLine(); ATAID.Cylinders * ATAID.Heads * ATAID.SectorsPerTrack).AppendLine();
} }
if(ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport)) sb.AppendFormat("{0} sectors in 28-bit LBA mode", ATAID.LBASectors).AppendLine(); if(ATAID.Capabilities.HasFlag(CapabilitiesBit.LBASupport))
sb.AppendFormat("{0} sectors in 28-bit LBA mode", ATAID.LBASectors).AppendLine();
if(ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48)) sb.AppendFormat("{0} sectors in 48-bit LBA mode", ATAID.LBA48Sectors).AppendLine(); if(ATAID.CommandSet2.HasFlag(CommandSetBit2.LBA48))
sb.AppendFormat("{0} sectors in 48-bit LBA mode", ATAID.LBA48Sectors).AppendLine();
if(minatalevel <= 5) if(minatalevel <= 5)
if(ATAID.CurrentSectors > 0) if(ATAID.CurrentSectors > 0)
@@ -2533,8 +2532,8 @@ namespace DiscImageChef.Decoders.ATA
switch(ATAID.BufferType) switch(ATAID.BufferType)
{ {
case 1: case 1:
sb.AppendFormat("{0} KiB of single ported single sector buffer", sb.AppendFormat("{0} KiB of single ported single sector buffer", ATAID.BufferSize * 512 / 1024)
ATAID.BufferSize * 512 / 1024).AppendLine(); .AppendLine();
break; break;
case 2: case 2:
sb.AppendFormat("{0} KiB of dual ported multi sector buffer", ATAID.BufferSize * 512 / 1024) sb.AppendFormat("{0} KiB of dual ported multi sector buffer", ATAID.BufferSize * 512 / 1024)
@@ -2758,7 +2757,8 @@ namespace DiscImageChef.Decoders.ATA
.AppendFormat("At minimum {0} ns. transfer cycle time per word in PIO, " + "with IORDY flow control", .AppendFormat("At minimum {0} ns. transfer cycle time per word in PIO, " + "with IORDY flow control",
ATAID.MinPIOCycleTimeFlow); ATAID.MinPIOCycleTimeFlow);
if(ATAID.MaxQueueDepth != 0) sb.AppendLine().AppendFormat("{0} depth of queue maximum", ATAID.MaxQueueDepth + 1); if(ATAID.MaxQueueDepth != 0)
sb.AppendLine().AppendFormat("{0} depth of queue maximum", ATAID.MaxQueueDepth + 1);
if(atapi) if(atapi)
{ {
@@ -2775,19 +2775,28 @@ namespace DiscImageChef.Decoders.ATA
{ {
if(!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear)) if(!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear))
{ {
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed)) sb.AppendLine().Append("SATA 1.5Gb/s is supported"); if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed))
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed)) sb.AppendLine().Append("SATA 3.0Gb/s is supported"); sb.AppendLine().Append("SATA 1.5Gb/s is supported");
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed)) sb.AppendLine().Append("SATA 6.0Gb/s is supported"); if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed))
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PowerReceipt)) sb.AppendLine().Append("Receipt of host initiated power management requests is supported"); sb.AppendLine().Append("SATA 3.0Gb/s is supported");
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter)) sb.AppendLine().Append("PHY Event counters are supported"); if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed))
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.HostSlumbTrans)) sb.AppendLine().Append("Supports host automatic partial to slumber transitions is supported"); sb.AppendLine().Append("SATA 6.0Gb/s is supported");
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.DevSlumbTrans)) sb.AppendLine().Append("Supports device automatic partial to slumber transitions is supported"); if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PowerReceipt))
sb.AppendLine().Append("Receipt of host initiated power management requests is supported");
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter))
sb.AppendLine().Append("PHY Event counters are supported");
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.HostSlumbTrans))
sb.AppendLine().Append("Supports host automatic partial to slumber transitions is supported");
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"); sb.AppendLine().Append("NCQ is supported");
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority)) sb.AppendLine().Append("NCQ priority is supported"); if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority))
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ)) sb.AppendLine().Append("Unload is supported with outstanding NCQ commands"); sb.AppendLine().Append("NCQ priority is supported");
if(ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ))
sb.AppendLine().Append("Unload is supported with outstanding NCQ commands");
} }
} }
@@ -2796,14 +2805,18 @@ namespace DiscImageChef.Decoders.ATA
if(!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) && if(!ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) &&
ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ)) ATAID.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ))
{ {
if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt)) sb.AppendLine().Append("NCQ queue management is supported"); if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt))
if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream)) sb.AppendLine().Append("NCQ streaming is supported"); sb.AppendLine().Append("NCQ queue management is supported");
if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream))
sb.AppendLine().Append("NCQ streaming is supported");
} }
if(atapi) if(atapi)
{ {
if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect)) sb.AppendLine().Append("ATAPI device supports host environment detection"); if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect))
if(ATAID.SATACapabilities2.HasFlag(SATACapabilitiesBit2.DevAttSlimline)) sb.AppendLine().Append("ATAPI device supports attention on slimline connected devices"); sb.AppendLine().Append("ATAPI device supports host environment detection");
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); //sb.AppendFormat("Negotiated speed = {0}", ((ushort)ATAID.SATACapabilities2 & 0x000E) >> 1);
@@ -2967,7 +2980,8 @@ namespace DiscImageChef.Decoders.ATA
if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot)) if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.AddressOffsetReservedAreaBoot))
sb.Append(" and enabled"); sb.Append(" and enabled");
} }
if(ATAID.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired)) sb.AppendLine().Append("SET FEATURES is required before spin-up"); 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"); sb.AppendLine().Append("Power-up in standby is supported");
@@ -2982,7 +2996,8 @@ namespace DiscImageChef.Decoders.ATA
if(ATAID.CommandSet2.HasFlag(CommandSetBit2.APM)) if(ATAID.CommandSet2.HasFlag(CommandSetBit2.APM))
{ {
sb.AppendLine().Append("Advanced Power Management is supported"); sb.AppendLine().Append("Advanced Power Management is supported");
if(ATAID.EnabledCommandSet2.HasFlag(CommandSetBit2.APM)) sb.AppendFormat(" and enabled with value {0}", ATAID.CurrentAPM); 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))
{ {
@@ -3028,9 +3043,12 @@ namespace DiscImageChef.Decoders.ATA
sb.AppendLine().Append("IDLE IMMEDIATE with UNLOAD FEATURE is supported"); sb.AppendLine().Append("IDLE IMMEDIATE with UNLOAD FEATURE is supported");
if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.IdleImmediate)) sb.Append(" and enabled"); if(ATAID.EnabledCommandSet3.HasFlag(CommandSetBit3.IdleImmediate)) sb.Append(" and enabled");
} }
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.WriteURG))
if(ATAID.CommandSet3.HasFlag(CommandSetBit3.ReadURG)) sb.AppendLine().Append("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT"); sb.AppendLine().Append("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT");
if(ATAID.CommandSet3.HasFlag(CommandSetBit3.WWN)) sb.AppendLine().Append("Device has a World Wide Name"); 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))
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"); sb.AppendLine().Append("WRITE DMA QUEUED FUA EXT is supported");
@@ -3132,23 +3150,33 @@ namespace DiscImageChef.Decoders.ATA
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA)) if(ATAID.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA))
sb.AppendLine() sb.AppendLine()
.Append("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported"); .Append("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA)) sb.AppendLine().Append("READ BUFFER DMA is supported"); if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA))
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA)) sb.AppendLine().Append("WRITE BUFFER DMA is supported"); sb.AppendLine().Append("READ BUFFER DMA is supported");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA)) sb.AppendLine().Append("DOWNLOAD MICROCODE DMA is supported"); if(ATAID.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA))
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA)) sb.AppendLine().Append("SET PASSWORD DMA and SET UNLOCK DMA are supported"); sb.AppendLine().Append("WRITE BUFFER DMA is supported");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.Ata28)) sb.AppendLine().Append("Not all 28-bit commands are supported"); if(ATAID.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA))
sb.AppendLine().Append("DOWNLOAD MICROCODE DMA is supported");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA))
sb.AppendLine().Append("SET PASSWORD DMA and SET UNLOCK DMA are supported");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.Ata28))
sb.AppendLine().Append("Not all 28-bit commands are supported");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.CFast)) sb.AppendLine().Append("Device follows CFast specification"); if(ATAID.CommandSet5.HasFlag(CommandSetBit5.CFast))
sb.AppendLine().Append("Device follows CFast specification");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.IEEE1667)) sb.AppendLine().Append("Device follows IEEE-1667"); 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"); sb.AppendLine().Append("Read after TRIM is deterministic");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim)) sb.AppendLine().Append("Read after TRIM returns empty data"); if(ATAID.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim))
sb.AppendLine().Append("Read after TRIM returns empty data");
} }
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError)) sb.AppendLine().Append("Device supports Long Physical Sector Alignment Error Reporting Control"); if(ATAID.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError))
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.Encrypted)) sb.AppendLine().Append("Device encrypts all user data"); sb.AppendLine().Append("Device supports Long Physical Sector Alignment Error Reporting Control");
if(ATAID.CommandSet5.HasFlag(CommandSetBit5.AllCacheNV)) sb.AppendLine().Append("Device's write cache is non-volatile"); if(ATAID.CommandSet5.HasFlag(CommandSetBit5.Encrypted))
sb.AppendLine().Append("Device encrypts all user data");
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"); ATAID.CommandSet5.HasFlag(CommandSetBit5.ZonedBit1)) sb.AppendLine().Append("Device is zoned");
@@ -3223,13 +3251,17 @@ namespace DiscImageChef.Decoders.ATA
if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve)) if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.SettingsPreserve))
sb.Append(" and enabled"); sb.Append(" and enabled");
} }
if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense)) sb.AppendLine().Append("NCQ Autosense is supported"); if(ATAID.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense))
if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber)) sb.AppendLine().Append("Automatic Partial to Slumber transitions are enabled"); sb.AppendLine().Append("NCQ Autosense is supported");
if(ATAID.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber))
sb.AppendLine().Append("Automatic Partial to Slumber transitions are enabled");
} }
} }
if((ATAID.RemovableStatusSet & 0x03) > 0) sb.AppendLine().Append("Removable Media Status Notification feature set is supported"); if((ATAID.RemovableStatusSet & 0x03) > 0)
sb.AppendLine().Append("Removable Media Status Notification feature set is supported");
if(ATAID.FreeFallSensitivity != 0x00 && ATAID.FreeFallSensitivity != 0xFF) sb.AppendLine().AppendFormat("Free-fall sensitivity set to {0}", ATAID.FreeFallSensitivity); if(ATAID.FreeFallSensitivity != 0x00 && ATAID.FreeFallSensitivity != 0xFF)
sb.AppendLine().AppendFormat("Free-fall sensitivity set to {0}", ATAID.FreeFallSensitivity);
if(ATAID.DataSetMgmt.HasFlag(DataSetMgmtBit.Trim)) sb.AppendLine().Append("TRIM is supported"); if(ATAID.DataSetMgmt.HasFlag(DataSetMgmtBit.Trim)) sb.AppendLine().Append("TRIM is supported");
if(ATAID.DataSetMgmtSize > 0) if(ATAID.DataSetMgmtSize > 0)
@@ -3386,7 +3418,7 @@ namespace DiscImageChef.Decoders.ATA
return BitConverter.ToUInt64(qword, 0); return BitConverter.ToUInt64(qword, 0);
} }
static string DescrambleATAString(byte[] buffer, int offset, int length) static string DescrambleATAString(IList<byte> buffer, int offset, int length)
{ {
byte[] outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length]; byte[] outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length];

View File

@@ -434,11 +434,9 @@ namespace DiscImageChef.Decoders.CD
if(response.DiscType) sb.AppendLine("Disc uses phase change"); if(response.DiscType) sb.AppendLine("Disc uses phase change");
else else
{
sb.AppendLine(type < 5 sb.AppendLine(type < 5
? "Disc uses long strategy type dye (Cyanine, AZO, etc...)" ? "Disc uses long strategy type dye (Cyanine, AZO, etc...)"
: "Disc uses short strategy type dye (Phthalocyanine, etc...)"); : "Disc uses short strategy type dye (Phthalocyanine, etc...)");
}
string manufacturer = ManufacturerFromATIP(response.LeadInStartSec, frm); string manufacturer = ManufacturerFromATIP(response.LeadInStartSec, frm);
@@ -458,7 +456,8 @@ namespace DiscImageChef.Decoders.CD
switch(sec) switch(sec)
{ {
case 15: case 15:
switch(frm) { switch(frm)
{
case 00: return "TDK Corporation"; case 00: return "TDK Corporation";
case 10: return "Ritek Co."; case 10: return "Ritek Co.";
case 20: return "Mitsubishi Chemical Corporation"; case 20: return "Mitsubishi Chemical Corporation";
@@ -467,7 +466,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 16: case 16:
switch(frm) { switch(frm)
{
case 20: return "Shenzen SG&Gast Digital Optical Discs"; case 20: return "Shenzen SG&Gast Digital Optical Discs";
case 30: return "Grand Advance Technology Ltd."; case 30: return "Grand Advance Technology Ltd.";
} }
@@ -478,7 +478,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 18: case 18:
switch(frm) { switch(frm)
{
case 10: return "Wealth Fair Investment Ltd."; case 10: return "Wealth Fair Investment Ltd.";
case 60: return "Taroko International Co. Ltd."; case 60: return "Taroko International Co. Ltd.";
} }
@@ -489,7 +490,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 21: case 21:
switch(frm) { switch(frm)
{
case 10: return "Grupo Condor S.L."; case 10: return "Grupo Condor S.L.";
case 30: return "Bestdisc Technology Corporation"; case 30: return "Bestdisc Technology Corporation";
case 40: return "Optical Disc Manufacturing Equipment"; case 40: return "Optical Disc Manufacturing Equipment";
@@ -498,7 +500,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 22: case 22:
switch(frm) { switch(frm)
{
case 00: return "Woongjin Media Corp."; case 00: return "Woongjin Media Corp.";
case 10: return "Seantram Technology Inc."; case 10: return "Seantram Technology Inc.";
case 20: return "Advanced Digital Media"; case 20: return "Advanced Digital Media";
@@ -510,7 +513,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 23: case 23:
switch(frm) { switch(frm)
{
case 00: return "Matsushita Electric Industrial Co., Ltd."; case 00: return "Matsushita Electric Industrial Co., Ltd.";
case 10: return "Doremi Media Co., Ltd."; case 10: return "Doremi Media Co., Ltd.";
case 20: return "Nacar Media s.r.l."; case 20: return "Nacar Media s.r.l.";
@@ -522,7 +526,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 24: case 24:
switch(frm) { switch(frm)
{
case 00: return "Taiyo Yuden Company Ltd."; case 00: return "Taiyo Yuden Company Ltd.";
case 10: return "SONY Corporation"; case 10: return "SONY Corporation";
case 20: return "Computer Support Italy s.r.l."; case 20: return "Computer Support Italy s.r.l.";
@@ -534,7 +539,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 25: case 25:
switch(frm) { switch(frm)
{
case 00: return "MPO"; case 00: return "MPO";
case 20: return "Hitachi Maxell, Ltd."; case 20: return "Hitachi Maxell, Ltd.";
case 30: return "Infodisc Technology Co. Ltd."; case 30: return "Infodisc Technology Co. Ltd.";
@@ -545,7 +551,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 26: case 26:
switch(frm) { switch(frm)
{
case 00: return "Fornet International Pte Ltd."; case 00: return "Fornet International Pte Ltd.";
case 10: return "POSTECH Corporation"; case 10: return "POSTECH Corporation";
case 20: return "SKC Co., Ltd."; case 20: return "SKC Co., Ltd.";
@@ -557,7 +564,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 27: case 27:
switch(frm) { switch(frm)
{
case 00: return "Digital Storage Technology Co., Ltd."; case 00: return "Digital Storage Technology Co., Ltd.";
case 10: return "Plasmon Data systems Ltd."; case 10: return "Plasmon Data systems Ltd.";
case 20: return "Princo Corporation"; case 20: return "Princo Corporation";
@@ -569,7 +577,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 28: case 28:
switch(frm) { switch(frm)
{
case 00: return "Opti.Me.S. S.p.A."; case 00: return "Opti.Me.S. S.p.A.";
case 10: return "Gigastore Corporation"; case 10: return "Gigastore Corporation";
case 20: return "Multi Media Masters & Machinary SA"; case 20: return "Multi Media Masters & Machinary SA";
@@ -581,7 +590,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 29: case 29:
switch(frm) { switch(frm)
{
case 00: return "Taeil Media Co., Ltd."; case 00: return "Taeil Media Co., Ltd.";
case 10: return "Vanguard Disc Inc."; case 10: return "Vanguard Disc Inc.";
case 20: return "Unidisc Technology Co., Ltd."; case 20: return "Unidisc Technology Co., Ltd.";
@@ -596,14 +606,16 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 31: case 31:
switch(frm) { switch(frm)
{
case 00: return "Ritek Co."; case 00: return "Ritek Co.";
case 30: return "Grand Advance Technology Ltd."; case 30: return "Grand Advance Technology Ltd.";
} }
break; break;
case 32: case 32:
switch(frm) { switch(frm)
{
case 00: return "TDK Corporation"; case 00: return "TDK Corporation";
case 10: return "Prodisc Technology Inc."; case 10: return "Prodisc Technology Inc.";
} }
@@ -618,7 +630,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 45: case 45:
switch(frm) { switch(frm)
{
case 00: return "Fornet International Pte Ltd."; case 00: return "Fornet International Pte Ltd.";
case 10: return "Unitech Japan Inc."; case 10: return "Unitech Japan Inc.";
case 20: return "Acer Media Technology, Inc."; case 20: return "Acer Media Technology, Inc.";
@@ -629,7 +642,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 46: case 46:
switch(frm) { switch(frm)
{
case 00: return "Taiyo Yuden Company Ltd."; case 00: return "Taiyo Yuden Company Ltd.";
case 10: return "Hong Kong Digital Technology Co., Ltd."; case 10: return "Hong Kong Digital Technology Co., Ltd.";
case 20: return "Multi Media Masters & Machinary SA"; case 20: return "Multi Media Masters & Machinary SA";
@@ -641,7 +655,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 47: case 47:
switch(frm) { switch(frm)
{
case 10: return "Hitachi Maxell, Ltd."; case 10: return "Hitachi Maxell, Ltd.";
case 20: return "Princo Corporation"; case 20: return "Princo Corporation";
case 40: return "POSTECH Corporation"; case 40: return "POSTECH Corporation";
@@ -651,7 +666,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 48: case 48:
switch(frm) { switch(frm)
{
case 00: return "Ricoh Company Ltd."; case 00: return "Ricoh Company Ltd.";
case 10: return "Kodak Japan Ltd."; case 10: return "Kodak Japan Ltd.";
case 20: return "Plasmon Data systems Ltd."; case 20: return "Plasmon Data systems Ltd.";
@@ -663,7 +679,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 49: case 49:
switch(frm) { switch(frm)
{
case 00: return "TDK Corporation"; case 00: return "TDK Corporation";
case 10: return "Gigastore Corporation"; case 10: return "Gigastore Corporation";
case 20: return "King Pro Mediatek Inc."; case 20: return "King Pro Mediatek Inc.";
@@ -674,7 +691,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 50: case 50:
switch(frm) { switch(frm)
{
case 10: return "Vanguard Disc Inc."; case 10: return "Vanguard Disc Inc.";
case 20: return "Mitsubishi Chemical Corporation"; case 20: return "Mitsubishi Chemical Corporation";
case 30: return "CDA Datenträger Albrechts GmbH"; case 30: return "CDA Datenträger Albrechts GmbH";
@@ -682,7 +700,8 @@ namespace DiscImageChef.Decoders.CD
break; break;
case 51: case 51:
switch(frm) { switch(frm)
{
case 10: return "Grand Advance Technology Ltd."; case 10: return "Grand Advance Technology Ltd.";
case 20: return "Infodisc Technology Co. Ltd."; case 20: return "Infodisc Technology Co. Ltd.";
case 50: return "Hile Optical Disc Technology Corp."; case 50: return "Hile Optical Disc Technology Corp.";

View File

@@ -188,8 +188,7 @@ namespace DiscImageChef.Decoders.DVD
sb.AppendLine("Disc is write inhibited for an unspecified reason"); sb.AppendLine("Disc is write inhibited for an unspecified reason");
break; break;
default: default:
sb.AppendFormat("Disc has unknown reason {0} for write inhibition", decoded.RAMSWI) sb.AppendFormat("Disc has unknown reason {0} for write inhibition", decoded.RAMSWI).AppendLine();
.AppendLine();
break; break;
} }

View File

@@ -56,20 +56,28 @@ namespace DiscImageChef.Decoders.DVD
/// ECMA 274: Data Interchange on 120 mm Optical Disk using +RW Format - Capacity: 3,0 Gbytes and 6,0 Gbytes /// ECMA 274: Data Interchange on 120 mm Optical Disk using +RW Format - Capacity: 3,0 Gbytes and 6,0 Gbytes
/// ECMA 279: 80 mm (1,23 Gbytes per side) and 120 mm (3,95 Gbytes per side) DVD-Recordable Disk (DVD-R) /// ECMA 279: 80 mm (1,23 Gbytes per side) and 120 mm (3,95 Gbytes per side) DVD-Recordable Disk (DVD-R)
/// ECMA 330: 120 mm (4,7 Gbytes per side) and 80 mm (1,46 Gbytes per side) DVD Rewritable Disk (DVD-RAM) /// ECMA 330: 120 mm (4,7 Gbytes per side) and 80 mm (1,46 Gbytes per side) DVD Rewritable Disk (DVD-RAM)
/// ECMA 337: Data Interchange on 120 mm and 80 mm Optical Disk using +RW Format - Capacity: 4,7 and 1,46 Gbytes per Side /// ECMA 337: Data Interchange on 120 mm and 80 mm Optical Disk using +RW Format - Capacity: 4,7 and 1,46 Gbytes per
/// Side
/// ECMA 338: 80 mm (1,46 Gbytes per side) and 120 mm (4,70 Gbytes per side) DVD Re-recordable Disk (DVD-RW) /// ECMA 338: 80 mm (1,46 Gbytes per side) and 120 mm (4,70 Gbytes per side) DVD Re-recordable Disk (DVD-RW)
/// ECMA 349: Data Interchange on 120 mm and 80 mm Optical Disk using +R Format - Capacity: 4,7 and 1,46 Gbytes per Side /// ECMA 349: Data Interchange on 120 mm and 80 mm Optical Disk using +R Format - Capacity: 4,7 and 1,46 Gbytes per
/// Side
/// ECMA 359: 80 mm (1,46 Gbytes per side) and 120 mm (4,70 Gbytes per side) DVD Recordable Disk (DVD-R) /// ECMA 359: 80 mm (1,46 Gbytes per side) and 120 mm (4,70 Gbytes per side) DVD Recordable Disk (DVD-R)
/// ECMA 364: Data Interchange on 120 mm and 80 mm Optical Disk using +R DL Format - Capacity 8,55 and 2,66 Gbytes per Side /// ECMA 364: Data Interchange on 120 mm and 80 mm Optical Disk using +R DL Format - Capacity 8,55 and 2,66 Gbytes per
/// Side
/// ECMA 365: Data Interchange on 60 mm Read-Only ODC - Capacity: 1,8 Gbytes (UMD™) /// ECMA 365: Data Interchange on 60 mm Read-Only ODC - Capacity: 1,8 Gbytes (UMD™)
/// ECMA 371: Data Interchange on 120 mm and 80 mm Optical Disk using +RW HS Format - Capacity 4,7 and 1,46 Gbytes per side /// ECMA 371: Data Interchange on 120 mm and 80 mm Optical Disk using +RW HS Format - Capacity 4,7 and 1,46 Gbytes per
/// ECMA 374: Data Interchange on 120 mm and 80 mm Optical Disk using +RW DL Format - Capacity 8,55 and 2,66 Gbytes per side /// side
/// ECMA 382: 120 mm (8,54 Gbytes per side) and 80 mm (2,66 Gbytes per side) DVD Recordable Disk for Dual Layer (DVD-R for DL) /// ECMA 374: Data Interchange on 120 mm and 80 mm Optical Disk using +RW DL Format - Capacity 8,55 and 2,66 Gbytes per
/// ECMA 384: 120 mm (8,54 Gbytes per side) and 80 mm (2,66 Gbytes per side) DVD Re-recordable Disk for Dual Layer (DVD-RW for DL) /// side
/// ECMA 382: 120 mm (8,54 Gbytes per side) and 80 mm (2,66 Gbytes per side) DVD Recordable Disk for Dual Layer (DVD-R
/// for DL)
/// ECMA 384: 120 mm (8,54 Gbytes per side) and 80 mm (2,66 Gbytes per side) DVD Re-recordable Disk for Dual Layer
/// (DVD-RW for DL)
/// </summary> /// </summary>
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "MemberCanBeInternal")] [SuppressMessage("ReSharper", "MemberCanBeInternal")]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
public static class PFI public static class PFI
{ {
public struct PhysicalFormatInformation public struct PhysicalFormatInformation
@@ -158,7 +166,8 @@ namespace DiscImageChef.Decoders.DVD
public uint Layer0EndPSN; public uint Layer0EndPSN;
/// <summary> /// <summary>
/// Byte 20, bit 7 /// Byte 20, bit 7
/// True if BCA exists. GC/Wii discs do not have this bit set, but there is a BCA, making it unreadable in normal DVD drives /// True if BCA exists. GC/Wii discs do not have this bit set, but there is a BCA, making it unreadable in normal DVD
/// drives
/// </summary> /// </summary>
public bool BCA; public bool BCA;
/// <summary> /// <summary>
@@ -1082,9 +1091,11 @@ namespace DiscImageChef.Decoders.DVD
pfi.Layer0EndPSN = (uint)((response[16] << 24) + (response[17] << 16) + (response[18] << 8) + response[19]); pfi.Layer0EndPSN = (uint)((response[16] << 24) + (response[17] << 16) + (response[18] << 8) + response[19]);
pfi.BCA |= (response[20] & 0x80) == 0x80; pfi.BCA |= (response[20] & 0x80) == 0x80;
switch(pfi.DiskCategory) { switch(pfi.DiskCategory)
{
// UMD // UMD
case DiskCategory.UMD: pfi.MediaAttribute = (ushort)((response[21] << 8) + response[22]); case DiskCategory.UMD:
pfi.MediaAttribute = (ushort)((response[21] << 8) + response[22]);
break; break;
// DVD-RAM // DVD-RAM
case DiskCategory.DVDRAM: case DiskCategory.DVDRAM:
@@ -1231,7 +1242,8 @@ namespace DiscImageChef.Decoders.DVD
pfi.PFIUsedInADIP = response[35]; pfi.PFIUsedInADIP = response[35];
} }
switch(pfi.DiskCategory) { switch(pfi.DiskCategory)
{
// DVD+RW // DVD+RW
case DiskCategory.DVDPRW when pfi.PartVersion == 2: case DiskCategory.DVDPRW when pfi.PartVersion == 2:
pfi.TopFirstPulseDuration = response[55]; pfi.TopFirstPulseDuration = response[55];
@@ -1270,9 +1282,11 @@ namespace DiscImageChef.Decoders.DVD
break; break;
} }
switch(pfi.DiskCategory) { switch(pfi.DiskCategory)
{
// DVD+R DL // DVD+R DL
case DiskCategory.DVDPRDL: pfi.LayerStructure = (DVDLayerStructure)((response[34] & 0xC0) >> 6); case DiskCategory.DVDPRDL:
pfi.LayerStructure = (DVDLayerStructure)((response[34] & 0xC0) >> 6);
break; break;
// DVD+RW DL // DVD+RW DL
case DiskCategory.DVDPRWDL: case DiskCategory.DVDPRWDL:
@@ -1351,10 +1365,13 @@ namespace DiscImageChef.Decoders.DVD
{ {
case DiskCategory.DVDROM: case DiskCategory.DVDROM:
sb.AppendFormat(categorySentence, sizeString, "DVD-ROM", decoded.PartVersion).AppendLine(); sb.AppendFormat(categorySentence, sizeString, "DVD-ROM", decoded.PartVersion).AppendLine();
switch(decoded.DiscSize) { switch(decoded.DiscSize)
case DVDSize.OneTwenty when decoded.PartVersion == 1: sb.AppendLine("Disc claims conformation to ECMA-267"); {
case DVDSize.OneTwenty when decoded.PartVersion == 1:
sb.AppendLine("Disc claims conformation to ECMA-267");
break; break;
case DVDSize.Eighty when decoded.PartVersion == 1: sb.AppendLine("Disc claims conformation to ECMA-268"); case DVDSize.Eighty when decoded.PartVersion == 1:
sb.AppendLine("Disc claims conformation to ECMA-268");
break; break;
} }
@@ -1583,8 +1600,10 @@ namespace DiscImageChef.Decoders.DVD
if(decoded.BCA) sb.AppendLine("Disc has a burst cutting area"); if(decoded.BCA) sb.AppendLine("Disc has a burst cutting area");
switch(decoded.DiskCategory) { switch(decoded.DiskCategory)
case DiskCategory.UMD: sb.AppendFormat("Media attribute is {0}", decoded.MediaAttribute).AppendLine(); {
case DiskCategory.UMD:
sb.AppendFormat("Media attribute is {0}", decoded.MediaAttribute).AppendLine();
break; break;
case DiskCategory.DVDRAM: case DiskCategory.DVDRAM:
switch(decoded.DiscType) switch(decoded.DiscType)
@@ -1611,7 +1630,8 @@ namespace DiscImageChef.Decoders.DVD
case DiskCategory.DVDRW when decoded.PartVersion < 3: case DiskCategory.DVDRW when decoded.PartVersion < 3:
sb.AppendFormat("Current Border-Out first sector is PSN {0:X}h", decoded.CurrentBorderOutSector) sb.AppendFormat("Current Border-Out first sector is PSN {0:X}h", decoded.CurrentBorderOutSector)
.AppendLine(); .AppendLine();
sb.AppendFormat("Next Border-In first sector is PSN {0:X}h", decoded.NextBorderInSector).AppendLine(); sb.AppendFormat("Next Border-In first sector is PSN {0:X}h", decoded.NextBorderInSector)
.AppendLine();
break; break;
case DiskCategory.DVDPR: case DiskCategory.DVDPR:
case DiskCategory.DVDPRW: case DiskCategory.DVDPRW:
@@ -1628,10 +1648,9 @@ namespace DiscImageChef.Decoders.DVD
if((decoded.DiskCategory != DiskCategory.DVDR || decoded.PartVersion < 6) && if((decoded.DiskCategory != DiskCategory.DVDR || decoded.PartVersion < 6) &&
(decoded.DiskCategory != DiskCategory.DVDRW || decoded.PartVersion < 3)) return sb.ToString(); (decoded.DiskCategory != DiskCategory.DVDRW || decoded.PartVersion < 3)) return sb.ToString();
sb.AppendFormat("Current RMD in extra Border zone starts at PSN {0:X}h", sb.AppendFormat("Current RMD in extra Border zone starts at PSN {0:X}h", decoded.CurrentRMDExtraBorderPSN)
decoded.CurrentRMDExtraBorderPSN).AppendLine();
sb.AppendFormat("PFI in extra Border zone starts at PSN {0:X}h", decoded.PFIExtraBorderPSN)
.AppendLine(); .AppendLine();
sb.AppendFormat("PFI in extra Border zone starts at PSN {0:X}h", decoded.PFIExtraBorderPSN).AppendLine();
if(!decoded.PreRecordedControlDataInv) sb.AppendLine("Control Data Zone is pre-recorded"); if(!decoded.PreRecordedControlDataInv) sb.AppendLine("Control Data Zone is pre-recorded");
if(decoded.PreRecordedLeadIn) sb.AppendLine("Lead-In is pre-recorded"); if(decoded.PreRecordedLeadIn) sb.AppendLine("Lead-In is pre-recorded");
if(decoded.PreRecordedLeadOut) sb.AppendLine("Lead-Out is pre-recorded"); if(decoded.PreRecordedLeadOut) sb.AppendLine("Lead-Out is pre-recorded");

View File

@@ -70,10 +70,6 @@ namespace DiscImageChef.Decoders.Floppy
/// </summary> /// </summary>
public RawAddressField addressField; public RawAddressField addressField;
/// <summary> /// <summary>
/// Track preamble, set to self-sync 0xFF, between 5 and 10 bytes
/// </summary>
public byte[] innerGap;
/// <summary>
/// Data field /// Data field
/// </summary> /// </summary>
public RawDataField dataField; public RawDataField dataField;
@@ -81,6 +77,10 @@ namespace DiscImageChef.Decoders.Floppy
/// Track preamble, set to self-sync 0xFF, between 14 and 24 bytes /// Track preamble, set to self-sync 0xFF, between 14 and 24 bytes
/// </summary> /// </summary>
public byte[] gap; public byte[] gap;
/// <summary>
/// Track preamble, set to self-sync 0xFF, between 5 and 10 bytes
/// </summary>
public byte[] innerGap;
} }
/// <summary> /// <summary>
@@ -88,28 +88,6 @@ namespace DiscImageChef.Decoders.Floppy
/// </summary> /// </summary>
public class RawAddressField public class RawAddressField
{ {
/// <summary>
/// Always 0xD5, 0xAA, 0x96
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] prologue;
/// <summary>
/// Volume number encoded as:
/// volume[0] = (decodedVolume >> 1) | 0xAA
/// volume[1] = decodedVolume | 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] volume;
/// <summary>
/// Track number encoded as:
/// track[0] = (decodedTrack >> 1) | 0xAA
/// track[1] = decodedTrack | 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] track;
/// <summary>
/// Sector number encoded as:
/// sector[0] = (decodedSector >> 1) | 0xAA
/// sector[1] = decodedSector | 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] sector;
/// <summary> /// <summary>
/// decodedChecksum = decodedVolume ^ decodedTrack ^ decodedSector /// decodedChecksum = decodedVolume ^ decodedTrack ^ decodedSector
/// checksum[0] = (decodedChecksum >> 1) | 0xAA /// checksum[0] = (decodedChecksum >> 1) | 0xAA
@@ -120,6 +98,28 @@ namespace DiscImageChef.Decoders.Floppy
/// Always 0xDE, 0xAA, 0xEB /// Always 0xDE, 0xAA, 0xEB
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] epilogue; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] epilogue;
/// <summary>
/// Always 0xD5, 0xAA, 0x96
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] prologue;
/// <summary>
/// Sector number encoded as:
/// sector[0] = (decodedSector >> 1) | 0xAA
/// sector[1] = decodedSector | 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] sector;
/// <summary>
/// Track number encoded as:
/// track[0] = (decodedTrack >> 1) | 0xAA
/// track[1] = decodedTrack | 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] track;
/// <summary>
/// Volume number encoded as:
/// volume[0] = (decodedVolume >> 1) | 0xAA
/// volume[1] = decodedVolume | 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] volume;
} }
/// <summary> /// <summary>
@@ -127,21 +127,21 @@ namespace DiscImageChef.Decoders.Floppy
/// </summary> /// </summary>
public class RawDataField public class RawDataField
{ {
/// <summary> public byte checksum;
/// Always 0xD5, 0xAA, 0xAD
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] prologue;
/// <summary> /// <summary>
/// Encoded data bytes. /// Encoded data bytes.
/// 410 bytes for 5to3 (aka DOS 3.2) format /// 410 bytes for 5to3 (aka DOS 3.2) format
/// 342 bytes for 6to2 (aka DOS 3.3) format /// 342 bytes for 6to2 (aka DOS 3.3) format
/// </summary> /// </summary>
public byte[] data; public byte[] data;
public byte checksum;
/// <summary> /// <summary>
/// Always 0xDE, 0xAA, 0xEB /// Always 0xDE, 0xAA, 0xEB
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] epilogue; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] epilogue;
/// <summary>
/// Always 0xD5, 0xAA, 0xAD
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] prologue;
} }
static readonly byte[] ReadTable5and3 = static readonly byte[] ReadTable5and3 =
@@ -549,8 +549,7 @@ namespace DiscImageChef.Decoders.Floppy
MemoryStream raw = new MemoryStream(); MemoryStream raw = new MemoryStream();
raw.Write(track.gap, 0, track.gap.Length); raw.Write(track.gap, 0, track.gap.Length);
foreach(byte[] rawSector in track.sectors.Select(MarshalSector)) foreach(byte[] rawSector in track.sectors.Select(MarshalSector)) raw.Write(rawSector, 0, rawSector.Length);
{ raw.Write(rawSector, 0, rawSector.Length); }
return raw.ToArray(); return raw.ToArray();
} }
@@ -589,7 +588,7 @@ namespace DiscImageChef.Decoders.Floppy
if(disk == null) return null; if(disk == null) return null;
MemoryStream raw = new MemoryStream(); MemoryStream raw = new MemoryStream();
foreach(byte[] rawTrack in disk.Select(MarshalTrack)) { raw.Write(rawTrack, 0, rawTrack.Length); } foreach(byte[] rawTrack in disk.Select(MarshalTrack)) raw.Write(rawTrack, 0, rawTrack.Length);
return raw.ToArray(); return raw.ToArray();
} }

View File

@@ -73,10 +73,6 @@ namespace DiscImageChef.Decoders.Floppy
/// </summary> /// </summary>
public RawAddressField addressField; public RawAddressField addressField;
/// <summary> /// <summary>
/// Track preamble, set to self-sync 0xFF, 6 bytes
/// </summary>
public byte[] innerGap;
/// <summary>
/// Data field /// Data field
/// </summary> /// </summary>
public RawDataField dataField; public RawDataField dataField;
@@ -84,6 +80,10 @@ namespace DiscImageChef.Decoders.Floppy
/// Track preamble, set to self-sync 0xFF, unknown size /// Track preamble, set to self-sync 0xFF, unknown size
/// </summary> /// </summary>
public byte[] gap; public byte[] gap;
/// <summary>
/// Track preamble, set to self-sync 0xFF, 6 bytes
/// </summary>
public byte[] innerGap;
} }
/// <summary> /// <summary>
@@ -91,15 +91,23 @@ namespace DiscImageChef.Decoders.Floppy
/// </summary> /// </summary>
public class RawAddressField public class RawAddressField
{ {
/// <summary>
/// Checksum
/// </summary>
public byte checksum;
/// <summary>
/// Always 0xDE, 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] epilogue;
/// <summary>
/// Disk format
/// </summary>
public AppleEncodedFormat format;
/// <summary> /// <summary>
/// Always 0xD5, 0xAA, 0x96 /// Always 0xD5, 0xAA, 0x96
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] prologue; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] prologue;
/// <summary> /// <summary>
/// Encoded (decodedTrack &amp; 0x3F)
/// </summary>
public byte track;
/// <summary>
/// Encoded sector number /// Encoded sector number
/// </summary> /// </summary>
public byte sector; public byte sector;
@@ -108,17 +116,9 @@ namespace DiscImageChef.Decoders.Floppy
/// </summary> /// </summary>
public byte side; public byte side;
/// <summary> /// <summary>
/// Disk format /// Encoded (decodedTrack &amp; 0x3F)
/// </summary> /// </summary>
public AppleEncodedFormat format; public byte track;
/// <summary>
/// Checksum
/// </summary>
public byte checksum;
/// <summary>
/// Always 0xDE, 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] epilogue;
} }
/// <summary> /// <summary>
@@ -126,6 +126,18 @@ namespace DiscImageChef.Decoders.Floppy
/// </summary> /// </summary>
public class RawDataField public class RawDataField
{ {
/// <summary>
/// Checksum
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] checksum;
/// <summary>
/// Encoded data bytes.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 698)] public byte[] data;
/// <summary>
/// Always 0xDE, 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] epilogue;
/// <summary> /// <summary>
/// Always 0xD5, 0xAA, 0xAD /// Always 0xD5, 0xAA, 0xAD
/// </summary> /// </summary>
@@ -134,18 +146,6 @@ namespace DiscImageChef.Decoders.Floppy
/// Spare, usually <see cref="RawAddressField.sector" /> /// Spare, usually <see cref="RawAddressField.sector" />
/// </summary> /// </summary>
public byte spare; public byte spare;
/// <summary>
/// Encoded data bytes.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 698)] public byte[] data;
/// <summary>
/// Checksum
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] checksum;
/// <summary>
/// Always 0xDE, 0xAA
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] epilogue;
} }
public static byte[] DecodeSector(RawSector sector) public static byte[] DecodeSector(RawSector sector)
@@ -441,8 +441,7 @@ namespace DiscImageChef.Decoders.Floppy
MemoryStream raw = new MemoryStream(); MemoryStream raw = new MemoryStream();
raw.Write(track.gap, 0, track.gap.Length); raw.Write(track.gap, 0, track.gap.Length);
foreach(byte[] rawSector in track.sectors.Select(MarshalSector)) foreach(byte[] rawSector in track.sectors.Select(MarshalSector)) raw.Write(rawSector, 0, rawSector.Length);
{ raw.Write(rawSector, 0, rawSector.Length); }
return raw.ToArray(); return raw.ToArray();
} }
@@ -481,7 +480,7 @@ namespace DiscImageChef.Decoders.Floppy
if(disk == null) return null; if(disk == null) return null;
MemoryStream raw = new MemoryStream(); MemoryStream raw = new MemoryStream();
foreach(byte[] rawTrack in disk.Select(MarshalTrack)) { raw.Write(rawTrack, 0, rawTrack.Length); } foreach(byte[] rawTrack in disk.Select(MarshalTrack)) raw.Write(rawTrack, 0, rawTrack.Length);
return raw.ToArray(); return raw.ToArray();
} }

View File

@@ -271,7 +271,8 @@ namespace DiscImageChef.Decoders.PCMCIA
else else
{ {
sb.AppendLine("\tAdditional information:"); sb.AppendLine("\tAdditional information:");
foreach(string info in tuple.AdditionalInformation.Where(info => !string.IsNullOrEmpty(info))) sb.AppendFormat("\t\t{0}", info).AppendLine(); foreach(string info in tuple.AdditionalInformation.Where(info => !string.IsNullOrEmpty(info)))
sb.AppendFormat("\t\t{0}", info).AppendLine();
} }
return sb.ToString(); return sb.ToString();

View File

@@ -126,7 +126,8 @@ namespace DiscImageChef.Decoders.PCMCIA
public class LongLinkTuple public class LongLinkTuple
{ {
/// <summary> /// <summary>
/// <see cref="TupleCodes.CISTPL_LONGLINK_A"/> or <see cref="TupleCodes.CISTPL_LONGLINK_C"/> or <see cref="TupleCodes.CISTPL_LONGLINK_CB"/> /// <see cref="TupleCodes.CISTPL_LONGLINK_A" /> or <see cref="TupleCodes.CISTPL_LONGLINK_C" /> or
/// <see cref="TupleCodes.CISTPL_LONGLINK_CB" />
/// </summary> /// </summary>
public TupleCodes Code; public TupleCodes Code;
/// <summary> /// <summary>
@@ -210,7 +211,8 @@ namespace DiscImageChef.Decoders.PCMCIA
/// </summary> /// </summary>
public byte Link; public byte Link;
/// <summary> /// <summary>
/// Array of strings. On memory they're preceded by an ISO Escape Code indicating codepage. Here they're stored as Unicode, so no need for it. /// Array of strings. On memory they're preceded by an ISO Escape Code indicating codepage. Here they're stored as
/// Unicode, so no need for it.
/// </summary> /// </summary>
public string[] Strings; public string[] Strings;
} }

View File

@@ -390,7 +390,6 @@ namespace DiscImageChef.Decoders.SCSI
PageLength = (byte)(pageResponse[3] + 4) PageLength = (byte)(pageResponse[3] + 4)
}; };
int position = 4; int position = 4;
List<IdentificatonDescriptor> descriptors = new List<IdentificatonDescriptor>(); List<IdentificatonDescriptor> descriptors = new List<IdentificatonDescriptor>();
@@ -409,12 +408,16 @@ namespace DiscImageChef.Decoders.SCSI
if(descriptor.Length + position + 4 >= pageResponse.Length) if(descriptor.Length + position + 4 >= pageResponse.Length)
descriptor.Length = (byte)(pageResponse.Length - position - 4); descriptor.Length = (byte)(pageResponse.Length - position - 4);
Array.Copy(pageResponse, position + 4, descriptor.Binary, 0, descriptor.Length); Array.Copy(pageResponse, position + 4, descriptor.Binary, 0, descriptor.Length);
switch(descriptor.CodeSet) { switch(descriptor.CodeSet)
case IdentificationCodeSet.ASCII: descriptor.ASCII = StringHandlers.CToString(descriptor.Binary); {
case IdentificationCodeSet.ASCII:
descriptor.ASCII = StringHandlers.CToString(descriptor.Binary);
break; break;
case IdentificationCodeSet.UTF8: descriptor.ASCII = Encoding.UTF8.GetString(descriptor.Binary); case IdentificationCodeSet.UTF8:
descriptor.ASCII = Encoding.UTF8.GetString(descriptor.Binary);
break; break;
default: descriptor.ASCII = ""; default:
descriptor.ASCII = "";
break; break;
} }
@@ -521,9 +524,11 @@ namespace DiscImageChef.Decoders.SCSI
switch(descriptor.Type) switch(descriptor.Type)
{ {
case IdentificationTypes.NoAuthority: case IdentificationTypes.NoAuthority:
switch(descriptor.CodeSet) { switch(descriptor.CodeSet)
{
case IdentificationCodeSet.ASCII: case IdentificationCodeSet.ASCII:
case IdentificationCodeSet.UTF8: sb.AppendFormat("\tVendor descriptor contains: {0}", descriptor.ASCII).AppendLine(); case IdentificationCodeSet.UTF8:
sb.AppendFormat("\tVendor descriptor contains: {0}", descriptor.ASCII).AppendLine();
break; break;
case IdentificationCodeSet.Binary: case IdentificationCodeSet.Binary:
sb.AppendFormat("\tVendor descriptor contains binary data (hex): {0}", sb.AppendFormat("\tVendor descriptor contains binary data (hex): {0}",
@@ -538,9 +543,11 @@ namespace DiscImageChef.Decoders.SCSI
break; break;
case IdentificationTypes.Inquiry: case IdentificationTypes.Inquiry:
switch(descriptor.CodeSet) { switch(descriptor.CodeSet)
{
case IdentificationCodeSet.ASCII: case IdentificationCodeSet.ASCII:
case IdentificationCodeSet.UTF8: sb.AppendFormat("\tInquiry descriptor contains: {0}", descriptor.ASCII).AppendLine(); case IdentificationCodeSet.UTF8:
sb.AppendFormat("\tInquiry descriptor contains: {0}", descriptor.ASCII).AppendLine();
break; break;
case IdentificationCodeSet.Binary: case IdentificationCodeSet.Binary:
sb.AppendFormat("\tInquiry descriptor contains binary data (hex): {0}", sb.AppendFormat("\tInquiry descriptor contains binary data (hex): {0}",
@@ -720,7 +727,8 @@ namespace DiscImageChef.Decoders.SCSI
break; break;
default: default:
switch(descriptor.CodeSet) { switch(descriptor.CodeSet)
{
case IdentificationCodeSet.ASCII: case IdentificationCodeSet.ASCII:
case IdentificationCodeSet.UTF8: case IdentificationCodeSet.UTF8:
sb.AppendFormat("\tUnknown descriptor type {1} contains: {0}", descriptor.ASCII, sb.AppendFormat("\tUnknown descriptor type {1} contains: {0}", descriptor.ASCII,
@@ -732,7 +740,8 @@ namespace DiscImageChef.Decoders.SCSI
(byte)descriptor.Type).AppendLine(); (byte)descriptor.Type).AppendLine();
break; break;
default: default:
sb.AppendFormat("Inquiry descriptor type {2} contains unknown kind {1} of data (hex): {0}", sb
.AppendFormat("Inquiry descriptor type {2} contains unknown kind {1} of data (hex): {0}",
PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40), PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40),
(byte)descriptor.CodeSet, (byte)descriptor.Type).AppendLine(); (byte)descriptor.CodeSet, (byte)descriptor.Type).AppendLine();
break; break;
@@ -798,7 +807,6 @@ namespace DiscImageChef.Decoders.SCSI
PageLength = (byte)(pageResponse[3] + 4) PageLength = (byte)(pageResponse[3] + 4)
}; };
int position = 4; int position = 4;
List<SoftwareIdentifier> identifiers = new List<SoftwareIdentifier>(); List<SoftwareIdentifier> identifiers = new List<SoftwareIdentifier>();
@@ -924,7 +932,6 @@ namespace DiscImageChef.Decoders.SCSI
PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4) PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4)
}; };
int position = 4; int position = 4;
List<NetworkDescriptor> descriptors = new List<NetworkDescriptor>(); List<NetworkDescriptor> descriptors = new List<NetworkDescriptor>();
@@ -1223,7 +1230,8 @@ namespace DiscImageChef.Decoders.SCSI
sb.AppendLine("SCSI Extended INQUIRY Data:"); sb.AppendLine("SCSI Extended INQUIRY Data:");
switch(page.PeripheralDeviceType) { switch(page.PeripheralDeviceType)
{
case PeripheralDeviceTypes.DirectAccess: case PeripheralDeviceTypes.DirectAccess:
case PeripheralDeviceTypes.SCSIZonedBlockDevice: case PeripheralDeviceTypes.SCSIZonedBlockDevice:
switch(page.SPT) switch(page.SPT)
@@ -1256,7 +1264,8 @@ namespace DiscImageChef.Decoders.SCSI
} }
break; break;
case PeripheralDeviceTypes.SequentialAccess when page.SPT == 1: sb.AppendLine("Logical unit supports logical block protection"); case PeripheralDeviceTypes.SequentialAccess when page.SPT == 1:
sb.AppendLine("Logical unit supports logical block protection");
break; break;
} }
@@ -1813,7 +1822,8 @@ namespace DiscImageChef.Decoders.SCSI
CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4), CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4),
PortATransportType = pageResponse[12], PortATransportType = pageResponse[12],
PortASelectionID = pageResponse[15], PortASelectionID = pageResponse[15],
OperatingHours = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) + (pageResponse[22] << 8) + OperatingHours =
(uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) + (pageResponse[22] << 8) +
pageResponse[23]), pageResponse[23]),
CartridgeSerialNumber = new byte[32] CartridgeSerialNumber = new byte[32]
}; };
@@ -1996,8 +2006,6 @@ namespace DiscImageChef.Decoders.SCSI
Date = new byte[8] Date = new byte[8]
}; };
Array.Copy(pageResponse, 4, decoded.CodeName, 0, 12); Array.Copy(pageResponse, 4, decoded.CodeName, 0, 12);
Array.Copy(pageResponse, 23, decoded.Date, 0, 8); Array.Copy(pageResponse, 23, decoded.Date, 0, 8);
@@ -2291,7 +2299,8 @@ namespace DiscImageChef.Decoders.SCSI
if(pageResponse[4] != pageResponse[3] - 1) return null; if(pageResponse[4] != pageResponse[3] - 1) return null;
List<byte> array = new List<byte>(); List<byte> array = new List<byte>();
const string fwRegExStr = @"Firmware Rev\s+=\s+(?<fw>\d+\.\d+)\s+Build date\s+=\s+(?<date>(\w|\d|\s*.)*)\s*$"; const string fwRegExStr =
@"Firmware Rev\s+=\s+(?<fw>\d+\.\d+)\s+Build date\s+=\s+(?<date>(\w|\d|\s*.)*)\s*$";
const string fwcRegExStr = @"FW_CONF\s+=\s+(?<value>0x[0-9A-Fa-f]{8})\s*$"; const string fwcRegExStr = @"FW_CONF\s+=\s+(?<value>0x[0-9A-Fa-f]{8})\s*$";
const string servoRegExStr = @"Servo\s+Rev\s+=\s+(?<version>\d+\.\d+)\s*$"; const string servoRegExStr = @"Servo\s+Rev\s+=\s+(?<version>\d+\.\d+)\s*$";
Regex fwRegEx = new Regex(fwRegExStr); Regex fwRegEx = new Regex(fwRegExStr);
@@ -2314,8 +2323,7 @@ namespace DiscImageChef.Decoders.SCSI
decoded.Version = Encoding.ASCII.GetBytes(fwMatch.Groups["fw"].Value); decoded.Version = Encoding.ASCII.GetBytes(fwMatch.Groups["fw"].Value);
decoded.Date = Encoding.ASCII.GetBytes(fwMatch.Groups["date"].Value); decoded.Date = Encoding.ASCII.GetBytes(fwMatch.Groups["date"].Value);
} }
else if(fwcMatch.Success) else if(fwcMatch.Success) decoded.Variant = Encoding.ASCII.GetBytes(fwMatch.Groups["value"].Value);
decoded.Variant = Encoding.ASCII.GetBytes(fwMatch.Groups["value"].Value);
else if(servoMatch.Success) else if(servoMatch.Success)
{ {
decoded.Component = Encoding.ASCII.GetBytes("Servo"); decoded.Component = Encoding.ASCII.GetBytes("Servo");
@@ -2425,8 +2433,6 @@ namespace DiscImageChef.Decoders.SCSI
ServoFirmware = new byte[4] ServoFirmware = new byte[4]
}; };
Array.Copy(pageResponse, 4, decoded.ControllerFirmware, 0, 4); Array.Copy(pageResponse, 4, decoded.ControllerFirmware, 0, 4);
Array.Copy(pageResponse, 8, decoded.BootFirmware, 0, 4); Array.Copy(pageResponse, 8, decoded.BootFirmware, 0, 4);
Array.Copy(pageResponse, 12, decoded.ServoFirmware, 0, 4); Array.Copy(pageResponse, 12, decoded.ServoFirmware, 0, 4);

View File

@@ -227,7 +227,8 @@ namespace DiscImageChef.Decoders.SCSI
else descriptorsNo = (SCSIInquiryResponse.Length - 58) / 2; else descriptorsNo = (SCSIInquiryResponse.Length - 58) / 2;
decoded.VersionDescriptors = new ushort[descriptorsNo]; decoded.VersionDescriptors = new ushort[descriptorsNo];
for(int i = 0; i < descriptorsNo; i++) decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + i * 2); 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)

View File

@@ -415,8 +415,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
sb.AppendFormat("Last track in last session is track {0}", decoded.LastTrackLastSession).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}", 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, (decoded.LastSessionLeadInStartLBA & 0xFF0000) >> 16,
(decoded.LastSessionLeadInStartLBA & 0xFF00) >> 8, (decoded.LastSessionLeadInStartLBA & 0xFF00) >> 8, decoded.LastSessionLeadInStartLBA & 0xFF)
decoded.LastSessionLeadInStartLBA & 0xFF).AppendLine(); .AppendLine();
sb.AppendFormat("Last possible Lead-Out address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", 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, (decoded.LastPossibleLeadOutStartLBA & 0xFF0000) >> 16,
(decoded.LastPossibleLeadOutStartLBA & 0xFF00) >> 8, (decoded.LastPossibleLeadOutStartLBA & 0xFF00) >> 8,

View File

@@ -5344,25 +5344,6 @@ namespace DiscImageChef.Decoders.SCSI.MMC
return Prettify_0142(Decode_0142(feature)); return Prettify_0142(Decode_0142(feature));
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct FeatureDescriptor
{
public ushort Code;
public byte[] Data;
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct SeparatedFeatures
{
public uint DataLength;
public ushort CurrentProfile;
public FeatureDescriptor[] Descriptors;
}
public static SeparatedFeatures Separate(byte[] response) public static SeparatedFeatures Separate(byte[] response)
{ {
SeparatedFeatures dec = new SeparatedFeatures SeparatedFeatures dec = new SeparatedFeatures
@@ -5391,5 +5372,24 @@ namespace DiscImageChef.Decoders.SCSI.MMC
return dec; return dec;
} }
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct FeatureDescriptor
{
public ushort Code;
public byte[] Data;
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
public struct SeparatedFeatures
{
public uint DataLength;
public ushort CurrentProfile;
public FeatureDescriptor[] Descriptors;
}
} }
} }

View File

@@ -127,7 +127,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
decoded.FormatLayers = new ushort[(FormatLayersResponse.Length - 6) / 2]; decoded.FormatLayers = new ushort[(FormatLayersResponse.Length - 6) / 2];
for(int i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++) decoded.FormatLayers[i] = BigEndianBitConverter.ToUInt16(FormatLayersResponse, i * 2 + 6); for(int i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++)
decoded.FormatLayers[i] = BigEndianBitConverter.ToUInt16(FormatLayersResponse, i * 2 + 6);
return decoded; return decoded;
} }

View File

@@ -189,6 +189,7 @@ namespace DiscImageChef.Decoders.SCSI
return sb.ToString(); return sb.ToString();
} }
#endregion Mode Page 0x01: Read-write error recovery page #endregion Mode Page 0x01: Read-write error recovery page
public static byte[] EncodeModePage_01(ModePage_01 page) public static byte[] EncodeModePage_01(ModePage_01 page)
{ {
byte[] pg = new byte[8]; byte[] pg = new byte[8];

View File

@@ -195,6 +195,7 @@ namespace DiscImageChef.Decoders.SCSI
return sb.ToString(); return sb.ToString();
} }
#endregion Mode Page 0x01: Read error recovery page for MultiMedia Devices #endregion Mode Page 0x01: Read error recovery page for MultiMedia Devices
public static byte[] EncodeModePage_01_MMC(ModePage_01_MMC page) public static byte[] EncodeModePage_01_MMC(ModePage_01_MMC page)
{ {
byte[] pg = new byte[12]; byte[] pg = new byte[12];

View File

@@ -69,7 +69,8 @@ namespace DiscImageChef.Decoders.SCSI
/// </summary> /// </summary>
public ushort DisconnectTimeLimit; public ushort DisconnectTimeLimit;
/// <summary> /// <summary>
/// Max. time in 100 µs increments allowed to use the bus before disconnecting, if granted the privilege and not restricted by <see cref="DTDC"/> /// Max. time in 100 µs increments allowed to use the bus before disconnecting, if granted the privilege and not
/// restricted by <see cref="DTDC" />
/// </summary> /// </summary>
public ushort ConnectTimeLimit; public ushort ConnectTimeLimit;
/// <summary> /// <summary>

View File

@@ -62,7 +62,8 @@ namespace DiscImageChef.Decoders.SCSI
/// </summary> /// </summary>
public byte QueueAlgorithm; public byte QueueAlgorithm;
/// <summary> /// <summary>
/// If set all remaining suspended I/O processes shall be aborted after the contingent allegiance condition or extended contingent allegiance condition /// If set all remaining suspended I/O processes shall be aborted after the contingent allegiance condition or extended
/// contingent allegiance condition
/// </summary> /// </summary>
public byte QErr; public byte QErr;
/// <summary> /// <summary>
@@ -129,7 +130,8 @@ namespace DiscImageChef.Decoders.SCSI
/// </summary> /// </summary>
public bool TMF_ONLY; public bool TMF_ONLY;
/// <summary> /// <summary>
/// Device shall return descriptor format sense data when returning sense data in the same transactions as a CHECK CONDITION /// Device shall return descriptor format sense data when returning sense data in the same transactions as a CHECK
/// CONDITION
/// </summary> /// </summary>
public bool D_SENSE; public bool D_SENSE;
/// <summary> /// <summary>

View File

@@ -196,8 +196,7 @@ namespace DiscImageChef.Decoders.SCSI
sb.AppendLine("\tDevice shall erase all partitions on MODE SELECT for partitioning"); sb.AppendLine("\tDevice shall erase all partitions on MODE SELECT for partitioning");
else if(!page.CLEAR) else if(!page.CLEAR)
sb.AppendLine("\tDevice shall not erase any partition on MODE SELECT for partitioning"); sb.AppendLine("\tDevice shall not erase any partition on MODE SELECT for partitioning");
else else sb.AppendLine("\tDevice shall erase all partitions differing on size on MODE SELECT for partitioning");
sb.AppendLine("\tDevice shall erase all partitions differing on size on MODE SELECT for partitioning");
string measure; string measure;

View File

@@ -283,13 +283,11 @@ namespace DiscImageChef.Decoders.SCSI
decoded.WriteSpeedPerformanceDescriptors = new ModePage_2A_WriteDescriptor[descriptors]; 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] = new ModePage_2A_WriteDescriptor
{ {
RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07), RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07),
WriteSpeed = (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4]) WriteSpeed = (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4])
}; };
}
return decoded; return decoded;
} }
@@ -355,11 +353,9 @@ namespace DiscImageChef.Decoders.SCSI
: "\tDrive is not locked, media can be ejected and inserted"); : "\tDrive is not locked, media can be ejected and inserted");
} }
else else
{
sb.AppendLine(page.LockState sb.AppendLine(page.LockState
? "\tDrive is locked, media cannot be ejected, but if empty, can be inserted" ? "\tDrive is locked, media cannot be ejected, but if empty, can be inserted"
: "\tDrive is not locked, media can be ejected and inserted"); : "\tDrive is not locked, media can be ejected and inserted");
}
if(page.Eject) sb.AppendLine("\tDrive can eject media"); if(page.Eject) sb.AppendLine("\tDrive can eject media");
if(page.SeparateChannelMute) sb.AppendLine("\tEach channel can be muted independently"); if(page.SeparateChannelMute) sb.AppendLine("\tEach channel can be muted independently");
@@ -414,9 +410,11 @@ namespace DiscImageChef.Decoders.SCSI
} }
if(page.WriteSpeedPerformanceDescriptors != null) if(page.WriteSpeedPerformanceDescriptors != null)
foreach(ModePage_2A_WriteDescriptor descriptor in page.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0)) if(descriptor.RotationControl == 0) foreach(ModePage_2A_WriteDescriptor descriptor in
sb.AppendFormat("\tDrive supports writing at {0} Kbyte/sec. in CLV mode", page.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0))
descriptor.WriteSpeed).AppendLine(); 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", sb.AppendFormat("\tDrive supports writing at is {0} Kbyte/sec. in pure CAV mode",
descriptor.WriteSpeed).AppendLine(); descriptor.WriteSpeed).AppendLine();

View File

@@ -86,7 +86,9 @@ namespace DiscImageChef.Decoders.SCSI
if(page.PS) sb.AppendLine("\tParameters can be saved"); if(page.PS) sb.AppendLine("\tParameters can be saved");
sb.AppendLine(page.CDmode ? "\tDrive is emulating a CD-ROM drive" : "\tDrive is not emulating a CD-ROM drive"); sb.AppendLine(page.CDmode
? "\tDrive is emulating a CD-ROM drive"
: "\tDrive is not emulating a CD-ROM drive");
if(page.NonAuto) sb.AppendLine("\tDrive will not exit emulation automatically"); if(page.NonAuto) sb.AppendLine("\tDrive will not exit emulation automatically");
return sb.ToString(); return sb.ToString();

View File

@@ -146,8 +146,7 @@ namespace DiscImageChef.Decoders.SCSI
else else
sb.AppendFormat("\t{0} blocks have {1} and are {2} bytes each", descriptor.Blocks, sb.AppendFormat("\t{0} blocks have {1} and are {2} bytes each", descriptor.Blocks,
density, descriptor.BlockLength).AppendLine(); density, descriptor.BlockLength).AppendLine();
else else if(descriptor.Blocks == 0)
if(descriptor.Blocks == 0)
sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength) sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength)
.AppendLine(); .AppendLine();
else else
@@ -1421,25 +1420,20 @@ namespace DiscImageChef.Decoders.SCSI
else else
sb.AppendFormat("\tAll remaining blocks conform to {0} and are {1} bytes each", sb.AppendFormat("\tAll remaining blocks conform to {0} and are {1} bytes each",
density, descriptor.BlockLength).AppendLine(); density, descriptor.BlockLength).AppendLine();
else else if(descriptor.BlockLength == 0)
if(descriptor.BlockLength == 0)
sb.AppendFormat("\t{0} blocks conform to {1} and have a variable length", sb.AppendFormat("\t{0} blocks conform to {1} and have a variable length",
descriptor.Blocks, density).AppendLine(); descriptor.Blocks, density).AppendLine();
else else
sb.AppendFormat("\t{0} blocks conform to {1} and are {2} bytes each", sb.AppendFormat("\t{0} blocks conform to {1} and are {2} bytes each",
descriptor.Blocks, density, descriptor.BlockLength) descriptor.Blocks, density, descriptor.BlockLength).AppendLine();
.AppendLine(); else if(descriptor.Blocks == 0)
else
if(descriptor.Blocks == 0)
if(descriptor.BlockLength == 0) if(descriptor.BlockLength == 0)
sb.AppendFormat("\tAll remaining blocks have a variable length").AppendLine(); sb.AppendFormat("\tAll remaining blocks have a variable length").AppendLine();
else else
sb.AppendFormat("\tAll remaining blocks are {0} bytes each", sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength)
descriptor.BlockLength).AppendLine();
else
if(descriptor.BlockLength == 0)
sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks)
.AppendLine(); .AppendLine();
else if(descriptor.BlockLength == 0)
sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks).AppendLine();
else else
sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks, sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks,
descriptor.BlockLength).AppendLine(); descriptor.BlockLength).AppendLine();
@@ -1563,25 +1557,20 @@ namespace DiscImageChef.Decoders.SCSI
else else
sb.AppendFormat("\tAll remaining blocks are {0} and are {1} bytes each", sb.AppendFormat("\tAll remaining blocks are {0} and are {1} bytes each",
density, descriptor.BlockLength).AppendLine(); density, descriptor.BlockLength).AppendLine();
else else if(descriptor.BlockLength == 0)
if(descriptor.BlockLength == 0)
sb.AppendFormat("\t{0} blocks are {1} and have a variable length", sb.AppendFormat("\t{0} blocks are {1} and have a variable length",
descriptor.Blocks, density).AppendLine(); descriptor.Blocks, density).AppendLine();
else else
sb.AppendFormat("\t{0} blocks are {1} and are {2} bytes each", sb.AppendFormat("\t{0} blocks are {1} and are {2} bytes each", descriptor.Blocks,
descriptor.Blocks, density, descriptor.BlockLength) density, descriptor.BlockLength).AppendLine();
.AppendLine(); else if(descriptor.Blocks == 0)
else
if(descriptor.Blocks == 0)
if(descriptor.BlockLength == 0) if(descriptor.BlockLength == 0)
sb.AppendFormat("\tAll remaining blocks have a variable length").AppendLine(); sb.AppendFormat("\tAll remaining blocks have a variable length").AppendLine();
else else
sb.AppendFormat("\tAll remaining blocks are {0} bytes each", sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength)
descriptor.BlockLength).AppendLine();
else
if(descriptor.BlockLength == 0)
sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks)
.AppendLine(); .AppendLine();
else if(descriptor.BlockLength == 0)
sb.AppendFormat("\t{0} blocks have a variable length", descriptor.Blocks).AppendLine();
else else
sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks, sb.AppendFormat("\t{0} blocks are {1} bytes each", descriptor.Blocks,
descriptor.BlockLength).AppendLine(); descriptor.BlockLength).AppendLine();
@@ -1758,8 +1747,7 @@ namespace DiscImageChef.Decoders.SCSI
else else
sb.AppendFormat("\t{0} blocks have {1} and are {2} bytes each", descriptor.Blocks, sb.AppendFormat("\t{0} blocks have {1} and are {2} bytes each", descriptor.Blocks,
density, descriptor.BlockLength).AppendLine(); density, descriptor.BlockLength).AppendLine();
else else if(descriptor.Blocks == 0)
if(descriptor.Blocks == 0)
sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength) sb.AppendFormat("\tAll remaining blocks are {0} bytes each", descriptor.BlockLength)
.AppendLine(); .AppendLine();
else else

View File

@@ -103,7 +103,8 @@ namespace DiscImageChef.Decoders.SCSI
} }
} }
switch(deviceType) { switch(deviceType)
{
case PeripheralDeviceTypes.DirectAccess: case PeripheralDeviceTypes.DirectAccess:
case PeripheralDeviceTypes.MultiMediaDevice: case PeripheralDeviceTypes.MultiMediaDevice:
header.WriteProtected = (modeResponse[3] & 0x80) == 0x80; header.WriteProtected = (modeResponse[3] & 0x80) == 0x80;
@@ -114,7 +115,8 @@ namespace DiscImageChef.Decoders.SCSI
header.Speed = (byte)(modeResponse[3] & 0x0F); header.Speed = (byte)(modeResponse[3] & 0x0F);
header.BufferedMode = (byte)((modeResponse[3] & 0x70) >> 4); header.BufferedMode = (byte)((modeResponse[3] & 0x70) >> 4);
break; break;
case PeripheralDeviceTypes.PrinterDevice: header.BufferedMode = (byte)((modeResponse[3] & 0x70) >> 4); case PeripheralDeviceTypes.PrinterDevice:
header.BufferedMode = (byte)((modeResponse[3] & 0x70) >> 4);
break; break;
case PeripheralDeviceTypes.OpticalDevice: case PeripheralDeviceTypes.OpticalDevice:
header.WriteProtected = (modeResponse[3] & 0x80) == 0x80; header.WriteProtected = (modeResponse[3] & 0x80) == 0x80;
@@ -200,17 +202,21 @@ namespace DiscImageChef.Decoders.SCSI
return decoded; return decoded;
} }
public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType, bool longLBA = false) public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType,
bool longLBA = false)
{ {
byte[] hdr; byte[] hdr;
if(header.BlockDescriptors != null) if(header.BlockDescriptors != null)
hdr = longLBA ? new byte[8 + header.BlockDescriptors.Length * 16] : new byte[8 + header.BlockDescriptors.Length * 8]; hdr = longLBA
? new byte[8 + header.BlockDescriptors.Length * 16]
: new byte[8 + header.BlockDescriptors.Length * 8];
else hdr = new byte[8]; else hdr = new byte[8];
hdr[2] = (byte)header.MediumType; hdr[2] = (byte)header.MediumType;
switch(deviceType) { switch(deviceType)
{
case PeripheralDeviceTypes.DirectAccess: case PeripheralDeviceTypes.DirectAccess:
case PeripheralDeviceTypes.MultiMediaDevice: case PeripheralDeviceTypes.MultiMediaDevice:
if(header.WriteProtected) hdr[3] += 0x80; if(header.WriteProtected) hdr[3] += 0x80;
@@ -221,7 +227,8 @@ namespace DiscImageChef.Decoders.SCSI
hdr[3] += (byte)(header.Speed & 0x0F); hdr[3] += (byte)(header.Speed & 0x0F);
hdr[3] += (byte)((header.BufferedMode << 4) & 0x70); hdr[3] += (byte)((header.BufferedMode << 4) & 0x70);
break; break;
case PeripheralDeviceTypes.PrinterDevice: hdr[3] += (byte)((header.BufferedMode << 4) & 0x70); case PeripheralDeviceTypes.PrinterDevice:
hdr[3] += (byte)((header.BufferedMode << 4) & 0x70);
break; break;
case PeripheralDeviceTypes.OpticalDevice: case PeripheralDeviceTypes.OpticalDevice:
if(header.WriteProtected) hdr[3] += 0x80; if(header.WriteProtected) hdr[3] += 0x80;

View File

@@ -64,7 +64,8 @@ namespace DiscImageChef.Decoders.SCSI
} }
} }
switch(deviceType) { switch(deviceType)
{
case PeripheralDeviceTypes.DirectAccess: case PeripheralDeviceTypes.DirectAccess:
case PeripheralDeviceTypes.MultiMediaDevice: case PeripheralDeviceTypes.MultiMediaDevice:
header.WriteProtected = (modeResponse[2] & 0x80) == 0x80; header.WriteProtected = (modeResponse[2] & 0x80) == 0x80;
@@ -75,7 +76,8 @@ namespace DiscImageChef.Decoders.SCSI
header.Speed = (byte)(modeResponse[2] & 0x0F); header.Speed = (byte)(modeResponse[2] & 0x0F);
header.BufferedMode = (byte)((modeResponse[2] & 0x70) >> 4); header.BufferedMode = (byte)((modeResponse[2] & 0x70) >> 4);
break; break;
case PeripheralDeviceTypes.PrinterDevice: header.BufferedMode = (byte)((modeResponse[2] & 0x70) >> 4); case PeripheralDeviceTypes.PrinterDevice:
header.BufferedMode = (byte)((modeResponse[2] & 0x70) >> 4);
break; break;
case PeripheralDeviceTypes.OpticalDevice: case PeripheralDeviceTypes.OpticalDevice:
header.WriteProtected = (modeResponse[2] & 0x80) == 0x80; header.WriteProtected = (modeResponse[2] & 0x80) == 0x80;
@@ -160,11 +162,14 @@ namespace DiscImageChef.Decoders.SCSI
public static byte[] EncodeModeHeader6(ModeHeader header, PeripheralDeviceTypes deviceType) public static byte[] EncodeModeHeader6(ModeHeader header, PeripheralDeviceTypes deviceType)
{ {
byte[] hdr = header.BlockDescriptors != null ? new byte[4 + header.BlockDescriptors.Length * 8] : new byte[4]; byte[] hdr = header.BlockDescriptors != null
? new byte[4 + header.BlockDescriptors.Length * 8]
: new byte[4];
hdr[1] = (byte)header.MediumType; hdr[1] = (byte)header.MediumType;
switch(deviceType) { switch(deviceType)
{
case PeripheralDeviceTypes.DirectAccess: case PeripheralDeviceTypes.DirectAccess:
case PeripheralDeviceTypes.MultiMediaDevice: case PeripheralDeviceTypes.MultiMediaDevice:
if(header.WriteProtected) hdr[2] += 0x80; if(header.WriteProtected) hdr[2] += 0x80;
@@ -175,7 +180,8 @@ namespace DiscImageChef.Decoders.SCSI
hdr[2] += (byte)(header.Speed & 0x0F); hdr[2] += (byte)(header.Speed & 0x0F);
hdr[2] += (byte)((header.BufferedMode << 4) & 0x70); hdr[2] += (byte)((header.BufferedMode << 4) & 0x70);
break; break;
case PeripheralDeviceTypes.PrinterDevice: hdr[2] += (byte)((header.BufferedMode << 4) & 0x70); case PeripheralDeviceTypes.PrinterDevice:
hdr[2] += (byte)((header.BufferedMode << 4) & 0x70);
break; break;
case PeripheralDeviceTypes.OpticalDevice: case PeripheralDeviceTypes.OpticalDevice:
if(header.WriteProtected) hdr[2] += 0x80; if(header.WriteProtected) hdr[2] += 0x80;

View File

@@ -86,8 +86,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC
if(decoded.Value.granularity > 0) if(decoded.Value.granularity > 0)
sb.AppendFormat("Device's needs a block size granularity of 2^{0} ({1}) bytes", sb.AppendFormat("Device's needs a block size granularity of 2^{0} ({1}) bytes",
decoded.Value.granularity, Math.Pow(2, decoded.Value.granularity)) decoded.Value.granularity, Math.Pow(2, decoded.Value.granularity)).AppendLine();
.AppendLine();
} }
return sb.ToString(); return sb.ToString();

View File

@@ -167,8 +167,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC
if(descriptor.duplicate) sb.AppendLine("\tThis descriptor is duplicated"); if(descriptor.duplicate) sb.AppendLine("\tThis descriptor is duplicated");
if(descriptor.defaultDensity) sb.AppendLine("\tThis is the default density on the drive"); 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", sb.AppendFormat("\tDensity has {0} bits per mm, with {1} tracks in a {2} mm width tape",
descriptor.bpmm, descriptor.tracks, descriptor.width / (double)10) descriptor.bpmm, descriptor.tracks, descriptor.width / (double)10).AppendLine();
.AppendLine();
sb.AppendFormat("\tDensity maximum capacity is {0} megabytes", descriptor.capacity).AppendLine(); sb.AppendFormat("\tDensity maximum capacity is {0} megabytes", descriptor.capacity).AppendLine();
sb.AppendFormat("\tDensity description: {0}", descriptor.description).AppendLine(); sb.AppendFormat("\tDensity description: {0}", descriptor.description).AppendLine();
sb.AppendLine(); sb.AppendLine();
@@ -258,8 +257,8 @@ namespace DiscImageChef.Decoders.SCSI.SSC
sb.AppendLine(); sb.AppendLine();
} }
sb.AppendFormat("\tMedium has a nominal length of {0} m in a {1} mm width tape", sb.AppendFormat("\tMedium has a nominal length of {0} m in a {1} mm width tape", descriptor.length,
descriptor.length, descriptor.width / (double)10).AppendLine(); descriptor.width / (double)10).AppendLine();
sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine(); sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine();
sb.AppendLine(); sb.AppendLine();
} }

View File

@@ -425,8 +425,8 @@ namespace DiscImageChef.Decoders.SCSI
if((decoded.SenseKeySpecific & 0x200000) == 0x200000) if((decoded.SenseKeySpecific & 0x200000) == 0x200000)
sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB", sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB",
(decoded.SenseKeySpecific & 0x70000) >> 16, (decoded.SenseKeySpecific & 0x70000) >> 16, decoded.SenseKeySpecific & 0xFFFF)
decoded.SenseKeySpecific & 0xFFFF).AppendLine(); .AppendLine();
else else
sb.AppendFormat("Invalid value in field {0} of CDB", decoded.SenseKeySpecific & 0xFFFF) sb.AppendFormat("Invalid value in field {0} of CDB", decoded.SenseKeySpecific & 0xFFFF)
.AppendLine(); .AppendLine();

View File

@@ -45,7 +45,8 @@ namespace DiscImageChef.Decoders.SCSI
/// </summary> /// </summary>
ECMA54 = 0x09, ECMA54 = 0x09,
/// <summary> /// <summary>
/// ECMA-59 &amp; ANSI X3.121-1984: 200 mm Flexible Disk Cartridge using Two-Frequency Recording at 13262 ftprad on Both Sides /// ECMA-59 &amp; ANSI X3.121-1984: 200 mm Flexible Disk Cartridge using Two-Frequency Recording at 13262 ftprad on
/// Both Sides
/// </summary> /// </summary>
ECMA59 = 0x0A, ECMA59 = 0x0A,
/// <summary> /// <summary>
@@ -57,19 +58,23 @@ namespace DiscImageChef.Decoders.SCSI
/// </summary> /// </summary>
ECMA66 = 0x0E, ECMA66 = 0x0E,
/// <summary> /// <summary>
/// ECMA-70 &amp; ANSI X3.125-1985: 130 mm Flexible Disk Cartridge using MFM Recording at 7958 ftprad on Both Sides; 1,9 Tracks per mm /// ECMA-70 &amp; ANSI X3.125-1985: 130 mm Flexible Disk Cartridge using MFM Recording at 7958 ftprad on Both Sides;
/// 1,9 Tracks per mm
/// </summary> /// </summary>
ECMA70 = 0x12, ECMA70 = 0x12,
/// <summary> /// <summary>
/// ECMA-78 &amp; ANSI X3.126-1986: 130 mm Flexible Disk Cartridge using MFM Recording at 7958 ftprad on Both Sides; 3,8 Tracks per mm /// ECMA-78 &amp; ANSI X3.126-1986: 130 mm Flexible Disk Cartridge using MFM Recording at 7958 ftprad on Both Sides;
/// 3,8 Tracks per mm
/// </summary> /// </summary>
ECMA78 = 0x16, ECMA78 = 0x16,
/// <summary> /// <summary>
/// ECMA-99 &amp; ISO 8630-1985: 130 mm Flexible Disk Cartridge using MFM Recording at 13262 ftprad on Both Sides; 3,8 Tracks per mm /// ECMA-99 &amp; ISO 8630-1985: 130 mm Flexible Disk Cartridge using MFM Recording at 13262 ftprad on Both Sides; 3,8
/// Tracks per mm
/// </summary> /// </summary>
ECMA99 = 0x1A, ECMA99 = 0x1A,
/// <summary> /// <summary>
/// ECMA-100 &amp; ANSI X3.137: 90 mm Flexible Disk Cartridge using MFM Recording at 7859 ftprad on Both Sides; 5,3 Tracks per mm /// ECMA-100 &amp; ANSI X3.137: 90 mm Flexible Disk Cartridge using MFM Recording at 7859 ftprad on Both Sides; 5,3
/// Tracks per mm
/// </summary> /// </summary>
ECMA100 = 0x1E, ECMA100 = 0x1E,
#endregion Medium Types defined in ECMA-111 for Direct-Access devices #endregion Medium Types defined in ECMA-111 for Direct-Access devices
@@ -626,7 +631,8 @@ namespace DiscImageChef.Decoders.SCSI
/// </summary> /// </summary>
ECMA79 = 0x07, ECMA79 = 0x07,
/// <summary> /// <summary>
/// Draft ECMA &amp; ANSI X3B5/87-099: 12,7 mm Magnetic Tape Cartridge using IFM Recording on 18 Tracks at 1944 ftpmm, GCR (IBM 3480, 3490, 3490E) /// Draft ECMA &amp; ANSI X3B5/87-099: 12,7 mm Magnetic Tape Cartridge using IFM Recording on 18 Tracks at 1944 ftpmm,
/// GCR (IBM 3480, 3490, 3490E)
/// </summary> /// </summary>
IBM3480 = 0x09, IBM3480 = 0x09,
/// <summary> /// <summary>

View File

@@ -189,7 +189,9 @@ namespace DiscImageChef.Decoders.Sega
provider); provider);
} }
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch { // ignored catch
{
// ignored
} }
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
} }

View File

@@ -235,7 +235,8 @@ namespace DiscImageChef.Decoders.Xbox
sb.Append("-"); sb.Append("-");
switch(decoded.CatalogNumber.Length) { switch(decoded.CatalogNumber.Length)
{
case 13: case 13:
for(int i = 8; i < 10; i++) sb.AppendFormat("{0}", decoded.CatalogNumber[i]); for(int i = 8; i < 10; i++) sb.AppendFormat("{0}", decoded.CatalogNumber[i]);

View File

@@ -265,7 +265,6 @@ namespace DiscImageChef.Decoders.Xbox
Array.Copy(response, 724, ss.Unknown5, 0, 43); Array.Copy(response, 724, ss.Unknown5, 0, 43);
for(int i = 0; i < 23; i++) for(int i = 0; i < 23; i++)
{
ss.ChallengeEntries[i] = new ChallengeEntry ss.ChallengeEntries[i] = new ChallengeEntry
{ {
Level = response[770 + i * 11 + 0], Level = response[770 + i * 11 + 0],
@@ -277,7 +276,6 @@ namespace DiscImageChef.Decoders.Xbox
ResponseValue = (uint)((response[770 + i * 11 + 7] << 24) + (response[770 + i * 11 + 8] << 16) + ResponseValue = (uint)((response[770 + i * 11 + 7] << 24) + (response[770 + i * 11 + 8] << 16) +
(response[770 + i * 11 + 9] << 8) + response[770 + i * 11 + 10]) (response[770 + i * 11 + 9] << 8) + response[770 + i * 11 + 10])
}; };
}
Array.Copy(response, 1052, ss.Unknown7, 0, 48); Array.Copy(response, 1052, ss.Unknown7, 0, 48);
Array.Copy(response, 1120, ss.Unknown8, 0, 16); Array.Copy(response, 1120, ss.Unknown8, 0, 16);
@@ -285,7 +283,6 @@ namespace DiscImageChef.Decoders.Xbox
Array.Copy(response, 1208, ss.Unknown10, 0, 303); Array.Copy(response, 1208, ss.Unknown10, 0, 303);
Array.Copy(response, 1528, ss.Unknown11, 0, 104); Array.Copy(response, 1528, ss.Unknown11, 0, 104);
for(int i = 0; i < 23; i++) for(int i = 0; i < 23; i++)
{
ss.Extents[i] = new SecuritySectorExtent ss.Extents[i] = new SecuritySectorExtent
{ {
Unknown = Unknown =
@@ -297,10 +294,8 @@ namespace DiscImageChef.Decoders.Xbox
EndPSN = (uint)((response[1633 + i * 9 + 6] << 16) + (response[1633 + i * 9 + 7] << 8) + EndPSN = (uint)((response[1633 + i * 9 + 6] << 16) + (response[1633 + i * 9 + 7] << 8) +
response[1633 + i * 9 + 8]) response[1633 + i * 9 + 8])
}; };
}
for(int i = 0; i < 23; i++) for(int i = 0; i < 23; i++)
{
ss.ExtentsCopy[i] = new SecuritySectorExtent ss.ExtentsCopy[i] = new SecuritySectorExtent
{ {
Unknown = Unknown =
@@ -312,7 +307,6 @@ namespace DiscImageChef.Decoders.Xbox
EndPSN = (uint)((response[1840 + i * 9 + 6] << 16) + (response[1840 + i * 9 + 7] << 8) + EndPSN = (uint)((response[1840 + i * 9 + 6] << 16) + (response[1840 + i * 9 + 7] << 8) +
response[1840 + i * 9 + 8]) response[1840 + i * 9 + 8])
}; };
}
return ss; return ss;
} }