From 99caf6d9b5897fb6c30367e2cf62f3da50799ded Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 31 Oct 2015 06:07:07 +0000 Subject: [PATCH] Added information from MMC-2. --- ChangeLog | 5 +++++ SCSI/Modes.cs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0119ee3..1e07605 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-31 Natalia Portillo + + * SCSI/Modes.cs: + Added information from MMC-2. + 2015-10-31 Natalia Portillo * SCSI/Modes.cs: diff --git a/SCSI/Modes.cs b/SCSI/Modes.cs index 4dfbe88..7212c98 100644 --- a/SCSI/Modes.cs +++ b/SCSI/Modes.cs @@ -3967,6 +3967,7 @@ namespace DiscImageChef.Decoders.SCSI /// 16 bytes in OB-U0077C /// 20 bytes in SFF-8020i /// 22 bytes in MMC-1 + /// 26 bytes in MMC-2 /// public struct ModePage_2A { @@ -4083,6 +4084,15 @@ namespace DiscImageChef.Decoders.SCSI public ushort CurrentWriteSpeed; public bool ReadBarcode; + + public bool ReadDVDRAM; + public bool ReadDVDR; + public bool ReadDVDROM; + public bool WriteDVDRAM; + public bool WriteDVDR; + public bool LeadInPW; + public bool SCC; + public ushort CMRSupported; } public static ModePage_2A? DecodeModePage_2A(byte[] pageResponse) @@ -4164,6 +4174,21 @@ namespace DiscImageChef.Decoders.SCSI decoded.ReadBarcode |= (pageResponse[5] & 0x80) == 0x80; + if (pageResponse.Length < 26) + return decoded; + + decoded.ReadDVDRAM |= (pageResponse[2] & 0x20) == 0x20; + decoded.ReadDVDR |= (pageResponse[2] & 0x10) == 0x10; + decoded.ReadDVDROM |= (pageResponse[2] & 0x08) == 0x08; + + decoded.WriteDVDRAM |= (pageResponse[3] & 0x20) == 0x20; + decoded.WriteDVDR |= (pageResponse[3] & 0x10) == 0x10; + + decoded.LeadInPW |= (pageResponse[3] & 0x20) == 0x20; + decoded.SCC |= (pageResponse[3] & 0x10) == 0x10; + + decoded.CMRSupported = (ushort)((pageResponse[22] << 8) + pageResponse[23]); + return decoded; } @@ -4284,6 +4309,23 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("\tDrive can read CD-RW"); } + if (page.ReadDVDROM) + sb.AppendLine("\tDrive can read DVD-ROM"); + if (page.ReadDVDR) + { + if (page.WriteDVDR) + sb.AppendLine("\tDrive can read and write DVD-R"); + else + sb.AppendLine("\tDrive can read DVD-R"); + } + if (page.ReadDVDRAM) + { + if (page.WriteDVDRAM) + sb.AppendLine("\tDrive can read and write DVD-RAM"); + else + sb.AppendLine("\tDrive can read DVD-RAM"); + } + if (page.Composite) sb.AppendLine("\tDrive can deliver a compositve audio and video data stream"); if (page.DigitalPort1) @@ -4304,6 +4346,14 @@ namespace DiscImageChef.Decoders.SCSI if (page.ReadBarcode) sb.AppendLine("\tDrive can read barcode"); + if (page.SCC) + sb.AppendLine("\tDrive can read both sides of a disc"); + if (page.LeadInPW) + sb.AppendLine("\tDrive an read raw R-W subchannel from the Lead-In"); + + if (page.CMRSupported == 1) + sb.AppendLine("\tDrive supports DVD CSS"); + return sb.ToString(); } #endregion Mode Page 0x2A: CD-ROM capabilities page