diff --git a/PIC/Constants.cs b/PIC/Constants.cs new file mode 100644 index 0000000..d5746b5 --- /dev/null +++ b/PIC/Constants.cs @@ -0,0 +1,15 @@ +namespace SabreTools.Models.PIC +{ + /// + /// + public class Constants + { + public const string DiscTypeIdentifierROM = "BDO"; + + public const string DiscTypeIdentifierROMUltra = "BDU"; + + public const string DiscTypeIdentifierReWritable = "BDW"; + + public const string DiscTypeIdentifierRecordable = "BDR"; + } +} diff --git a/PIC/DiscInformation.cs b/PIC/DiscInformation.cs new file mode 100644 index 0000000..4e82280 --- /dev/null +++ b/PIC/DiscInformation.cs @@ -0,0 +1,38 @@ +namespace SabreTools.Models.PIC +{ + /// + /// Disc Information and Emergency Brake data shall be read from the PIC zone. DI units that + /// contain physical information shall be returned.Emergency Brake data shall be returned.The + /// information shall be collected from the layer specified in the Layer field of the CDB. If any data + /// can be returned, 4 100 bytes shall be returned. + /// + /// + /// + public class DiscInformation + { + /// + /// 2048 bytes for BD-ROM, 3584 bytes for BD-R/RE + /// + /// Big-endian format + public ushort DataStructureLength { get; set; } + + /// + /// Should be 0x00 + /// + public byte Reserved0 { get; set; } + + /// + /// Should be 0x00 + /// + public byte Reserved1 { get; set; } + + /// + /// Disc information and emergency brake units + /// +#if NET48 + public DiscInformationUnit[] Units { get; set; } +#else + public DiscInformationUnit?[]? Units { get; set; } +#endif + } +} diff --git a/PIC/DiscInformationUnit.cs b/PIC/DiscInformationUnit.cs new file mode 100644 index 0000000..d59c545 --- /dev/null +++ b/PIC/DiscInformationUnit.cs @@ -0,0 +1,34 @@ +namespace SabreTools.Models.PIC +{ + /// + /// + public class DiscInformationUnit + { + /// + /// Unit header + /// +#if NET48 + public DiscInformationUnitHeader Header { get; set; } +#else + public DiscInformationUnitHeader? Header { get; set; } +#endif + + /// + /// Unit body + /// +#if NET48 + public DiscInformationUnitBody Body { get; set; } +#else + public DiscInformationUnitBody? Body { get; set; } +#endif + + /// + /// Unit trailer (BD-R/RE only) + /// +#if NET48 + public DiscInformationUnitTrailer Trailer { get; set; } +#else + public DiscInformationUnitTrailer? Trailer { get; set; } +#endif + } +} diff --git a/PIC/DiscInformationUnitBody.cs b/PIC/DiscInformationUnitBody.cs new file mode 100644 index 0000000..1ad475a --- /dev/null +++ b/PIC/DiscInformationUnitBody.cs @@ -0,0 +1,36 @@ +namespace SabreTools.Models.PIC +{ + /// + /// + /// TODO: Write models for the dependent contents, if possible + public class DiscInformationUnitBody + { + /// + /// Disc Type Identifier + /// = "BDO" for BD-ROM + /// = "BDU" for BD-ROM Ultra + /// = "BDW" for BD-RE + /// = "BDR" for BD-R + /// +#if NET48 + public string DiscTypeIdentifier { get; set; } +#else + public string? DiscTypeIdentifier { get; set; } +#endif + + /// + /// Disc Size/Class/Version + /// + public byte DiscSizeClassVersion { get; set; } + + /// + /// DI Unit Format dependent contents + /// + /// 52 bytes for BD-ROM, 100 bytes for BD-R/RE +#if NET48 + public byte[] FormatDependentContents { get; set; } +#else + public byte[]? FormatDependentContents { get; set; } +#endif + } +} diff --git a/PIC/DiscInformationUnitHeader.cs b/PIC/DiscInformationUnitHeader.cs new file mode 100644 index 0000000..1946e8b --- /dev/null +++ b/PIC/DiscInformationUnitHeader.cs @@ -0,0 +1,47 @@ +namespace SabreTools.Models.PIC +{ + /// + /// + public class DiscInformationUnitHeader + { + /// + /// Disc Information Identifier "DI" + /// Emergency Brake Identifier "EB" + /// +#if NET48 + public string DiscInformationIdentifier { get; set; } +#else + public string? DiscInformationIdentifier { get; set; } +#endif + + /// + /// Disc Information Format + /// + public byte DiscInformationFormat { get; set; } + + /// + /// Number of DI units in each DI block + /// + public byte NumberOfUnitsInBlock { get; set; } + + /// + /// Should be 0x00 + /// + public byte Reserved0 { get; set; } + + /// + /// DI unit Sequence Number + /// + public byte SequenceNumber { get; set; } + + /// + /// Number of bytes in use in this DI unit + /// + public byte BytesInUse { get; set; } + + /// + /// Should be 0x00 + /// + public byte Reserved1 { get; set; } + } +} diff --git a/PIC/DiscInformationUnitTrailer.cs b/PIC/DiscInformationUnitTrailer.cs new file mode 100644 index 0000000..bc2a762 --- /dev/null +++ b/PIC/DiscInformationUnitTrailer.cs @@ -0,0 +1,40 @@ +namespace SabreTools.Models.PIC +{ + /// + /// BD-R/RE only + /// + /// + /// + public class DiscInformationUnitTrailer + { + /// + /// Disc Manufacturer ID + /// + /// 6 bytes +#if NET48 + public byte[] DiscManufacturerID { get; set; } = new byte[6]; +#else + public byte[]? DiscManufacturerID { get; set; } = new byte[6]; +#endif + + /// + /// Media Type ID + /// + /// 3 bytes +#if NET48 + public byte[] MediaTypeID { get; set; } = new byte[3]; +#else + public byte[]? MediaTypeID { get; set; } = new byte[3]; +#endif + + /// + /// Time Stamp + /// + public ushort TimeStamp { get; set; } + + /// + /// Product Revision Number + /// + public byte ProductRevisionNumber { get; set; } + } +} diff --git a/Xbox/XMID.cs b/Xbox/XMID.cs index 63799ef..81eda57 100644 --- a/Xbox/XMID.cs +++ b/Xbox/XMID.cs @@ -20,7 +20,7 @@ namespace SabreTools.Models.Xbox #if NET48 public string PublisherIdentifier { get; set; } #else - public string PublisherIdentifier { get; set; } + public string? PublisherIdentifier { get; set; } #endif /// diff --git a/Xbox/XeMID.cs b/Xbox/XeMID.cs index 3da8a63..6b2695b 100644 --- a/Xbox/XeMID.cs +++ b/Xbox/XeMID.cs @@ -25,7 +25,7 @@ namespace SabreTools.Models.Xbox #if NET48 public string PublisherIdentifier { get; set; } #else - public string PublisherIdentifier { get; set; } + public string? PublisherIdentifier { get; set; } #endif ///