* DiscImageChef.CommonTypes/DiskType.cs:

Added DVD-RW DL, DVD-Download, HD DVD-R DL and HD DVD-RW DL.

	* DiscImageChef.Decoders/CD/ATIP.cs:
	  ATIP not always contain S4.
	Corrected typo.

	* DiscImageChef.Decoders/CD/Session.cs:
	  Added missing newlines.

	* DiscImageChef.Decoders/CD/TOC.cs:
	  Added missing newlines.
	Recognize Lead-Out track.

	* DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs:
	  Added structures for Disc Informations 001b and 010b.

	* DiscImageChef.Devices/Device/ScsiCommands.cs:
	  On READ TOC/PMA/ATIP and READ DISC INFORMATION if trying
	  small buffer and then real-sized buffer, some drives send
	  garbage, so get a big enough buffer and return only the
	  applicable data size.

	* DiscImageChef/Commands/MediaInfo.cs:
	  Check current profile and prettify TOC, PMA, ATIP, Session
	  and CD-TEXT.
This commit is contained in:
2015-11-24 00:40:33 +00:00
parent 3bd7427257
commit 06dd7c2b6e
5 changed files with 119 additions and 12 deletions

View File

@@ -231,7 +231,7 @@ namespace DiscImageChef.Decoders.CD
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
if (CDATIPResponse.Length != 32)
if (CDATIPResponse.Length != 32 && CDATIPResponse.Length != 28)
{
DicConsole.DebugWriteLine("CD ATIP decoder", "Expected CD ATIP size (32 bytes) is not received size ({0} bytes), not decoding", CDATIPResponse.Length);
return null;
@@ -267,17 +267,21 @@ namespace DiscImageChef.Decoders.CD
decoded.A1Values = new byte[3];
decoded.A2Values = new byte[3];
decoded.A3Values = new byte[3];
decoded.S4Values = new byte[3];
Array.Copy(CDATIPResponse, 16, decoded.A1Values, 0, 3);
Array.Copy(CDATIPResponse, 20, decoded.A1Values, 0, 3);
Array.Copy(CDATIPResponse, 24, decoded.A1Values, 0, 3);
Array.Copy(CDATIPResponse, 28, decoded.A1Values, 0, 3);
Array.Copy(CDATIPResponse, 20, decoded.A2Values, 0, 3);
Array.Copy(CDATIPResponse, 24, decoded.A3Values, 0, 3);
decoded.Reserved7 = CDATIPResponse[19];
decoded.Reserved8 = CDATIPResponse[23];
decoded.Reserved9 = CDATIPResponse[27];
if (CDATIPResponse.Length >= 32)
{
decoded.S4Values = new byte[3];
Array.Copy(CDATIPResponse, 28, decoded.S4Values, 0, 3);
decoded.Reserved10 = CDATIPResponse[31];
}
return decoded;
}
@@ -365,6 +369,7 @@ namespace DiscImageChef.Decoders.CD
sb.AppendFormat("A2 value: 0x{0:X6}", (response.A2Values[0] << 16) + (response.A2Values[1] << 8) + response.A2Values[2]).AppendLine();
if(response.A3Valid)
sb.AppendFormat("A3 value: 0x{0:X6}", (response.A3Values[0] << 16) + (response.A3Values[1] << 8) + response.A3Values[2]).AppendLine();
if(response.S4Values != null)
sb.AppendFormat("S4 value: 0x{0:X6}", (response.S4Values[0] << 16) + (response.S4Values[1] << 8) + response.S4Values[2]).AppendLine();
}

View File

@@ -158,11 +158,11 @@ namespace DiscImageChef.Decoders.CD
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
foreach (TrackDataDescriptor descriptor in response.TrackDescriptors)
{
sb.AppendFormat("First track number in last complete session: {0}", descriptor.TrackNumber);
sb.AppendFormat("First track number in last complete session: {0}", descriptor.TrackNumber).AppendLine();
sb.AppendFormat("Track starts at LBA {0}, or MSF {1:X2}:{2:X2}:{3:X2}", descriptor.TrackStartAddress,
(descriptor.TrackStartAddress & 0x0000FF00) >> 8,
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
(descriptor.TrackStartAddress & 0xFF000000) >> 24);
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
switch ((TOC_ADR)descriptor.ADR)
{

View File

@@ -158,11 +158,14 @@ namespace DiscImageChef.Decoders.CD
sb.AppendFormat("Last track number in last complete session: {0}", response.LastTrack).AppendLine();
foreach (CDTOCTrackDataDescriptor descriptor in response.TrackDescriptors)
{
sb.AppendFormat("Track number: {0}", descriptor.TrackNumber);
if (descriptor.TrackNumber == 0xAA)
sb.AppendLine("Track number: Lead-Out");
else
sb.AppendFormat("Track number: {0}", descriptor.TrackNumber).AppendLine();
sb.AppendFormat("Track starts at LBA {0}, or MSF {1:X2}:{2:X2}:{3:X2}", descriptor.TrackStartAddress,
(descriptor.TrackStartAddress & 0x0000FF00) >> 8,
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
(descriptor.TrackStartAddress & 0xFF000000) >> 24);
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
switch ((TOC_ADR)descriptor.ADR)
{

View File

@@ -1,3 +1,19 @@
2015-11-24 Natalia Portillo <claunia@claunia.com>
* CD/ATIP.cs:
ATIP not always contain S4.
Corrected typo.
* CD/Session.cs:
Added missing newlines.
* CD/TOC.cs:
Added missing newlines.
Recognize Lead-Out track.
* SCSI/MMC/DiscInformation.cs:
Added structures for Disc Informations 001b and 010b.
2015-11-23 Natalia Portillo <claunia@claunia.com>
* SCSI/Sense.cs:

View File

@@ -56,7 +56,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
/// </summary>
public static class DiscInformation
{
public struct DiscInformationResponse
public struct StandardDiscInformation
{
/// <summary>
/// Bytes 0 to 1
@@ -193,6 +193,89 @@ namespace DiscImageChef.Decoders.SCSI.MMC
/// </summary>
public byte[] OPCValues;
}
public struct TrackResourcesInformation
{
/// <summary>
/// Bytes 0 to 1
/// 10
/// </summary>
public UInt16 DataLength;
/// <summary>
/// Byte 2, bits 7 to 5
/// 001b
/// </summary>
public byte DataType;
/// <summary>
/// Byte 2, bits 4 to 0
/// Reserved
/// </summary>
public byte Reserved1;
/// <summary>
/// Byte 3
/// Reserved
/// </summary>
public byte Reserved2;
/// <summary>
/// Bytes 4 to 5
/// Maximum possible number of the tracks on the disc
/// </summary>
public UInt16 MaxTracks;
/// <summary>
/// Bytes 6 to 7
/// Number of the assigned tracks on the disc
/// </summary>
public UInt16 AssignedTracks;
/// <summary>
/// Bytes 8 to 9
/// Maximum possible number of appendable tracks on the disc
/// </summary>
public UInt16 MaxAppendableTracks;
/// <summary>
/// Bytes 10 to 11
/// Current number of appendable tracks on the disc
/// </summary>
public UInt16 AppendableTracks;
}
public struct POWResourcesInformation
{
/// <summary>
/// Bytes 0 to 1
/// 14
/// </summary>
public UInt16 DataLength;
/// <summary>
/// Byte 2, bits 7 to 5
/// 010b
/// </summary>
public byte DataType;
/// <summary>
/// Byte 2, bits 4 to 0
/// Reserved
/// </summary>
public byte Reserved1;
/// <summary>
/// Byte 3
/// Reserved
/// </summary>
public byte Reserved2;
/// <summary>
/// Bytes 4 to 7
/// Remaining POW replacements
/// </summary>
public UInt32 RemainingPOWReplacements;
/// <summary>
/// Bytes 8 to 11
/// Remaining POW reallocation map entries
/// </summary>
public UInt32 RemainingPOWReallocation;
/// <summary>
/// Bytes 12 to 15
/// Number of remaining POW updates
/// </summary>
public UInt32 RemainingPOWUpdates;
}
}
}