[Enums, CHDFile] Enum readability cleanup

This commit is contained in:
Matt Nadareski
2019-01-08 11:10:04 -08:00
parent e2b65b7acd
commit b0d91d11c3
2 changed files with 477 additions and 467 deletions

View File

@@ -1,507 +1,517 @@
namespace SabreTools.Library.Data namespace SabreTools.Library.Data
{ {
#region Archival #region Archival
/// <summary> /// <summary>
/// Version of tool archive made by /// Version of tool archive made by
/// </summary> /// </summary>
public enum ArchiveVersion : ushort public enum ArchiveVersion : ushort
{ {
MSDOSandOS2 = 0, MSDOSandOS2 = 0,
Amiga = 1, Amiga = 1,
OpenVMS = 2, OpenVMS = 2,
UNIX = 3, UNIX = 3,
VMCMS = 4, VMCMS = 4,
AtariST = 5, AtariST = 5,
OS2HPFS = 6, OS2HPFS = 6,
Macintosh = 7, Macintosh = 7,
ZSystem = 8, ZSystem = 8,
CPM = 9, CPM = 9,
WindowsNTFS = 10, WindowsNTFS = 10,
MVS = 11, MVS = 11,
VSE = 12, VSE = 12,
AcornRisc = 13, AcornRisc = 13,
VFAT = 14, VFAT = 14,
AlternateMVS = 15, AlternateMVS = 15,
BeOS = 16, BeOS = 16,
Tandem = 17, Tandem = 17,
OS400 = 18, OS400 = 18,
OSXDarwin = 19, OSXDarwin = 19,
TorrentZip = 20, TorrentZip = 20,
TorrentZip64 = 45, TorrentZip64 = 45,
} }
/// <summary> /// <summary>
/// Availible CHD codec formats /// Availible CHD codec formats
/// </summary> /// </summary>
public enum CHDCodecType : uint public enum CHD_CODEC : uint
{ {
CHD_CODEC_NONE = 0, NONE = 0,
// general codecs #region General Codecs
CHD_CODEC_ZLIB = 0x7a6c6962, // zlib
CHD_CODEC_LZMA = 0x6c7a6d61, // lzma
CHD_CODEC_HUFFMAN = 0x68756666, // huff
CHD_CODEC_FLAC = 0x666c6163, // flac
// general codecs with CD frontend ZLIB = 0x7a6c6962, // zlib
CHD_CODEC_CD_ZLIB = 0x63647a6c, // cdzl LZMA = 0x6c7a6d61, // lzma
CHD_CODEC_CD_LZMA = 0x63646c7a, // cdlz HUFFMAN = 0x68756666, // huff
CHD_CODEC_CD_FLAC = 0x6364666c, // cdfl FLAC = 0x666c6163, // flac
// A/V codecs #endregion
CHD_CODEC_AVHUFF = 0x61766875, // avhu
// pseudo-codecs returned by hunk_info #region General Codecs with CD Frontend
CHD_CODEC_SELF = 1, // copy of another hunk
CHD_CODEC_PARENT = 2, // copy of a parent's hunk
CHD_CODEC_MINI = 3, // legacy "mini" 8-byte repeat
}
/// <summary> CD_ZLIB = 0x63647a6c, // cdzl
/// Compression method based on flag CD_LZMA = 0x63646c7a, // cdlz
/// </summary> CD_FLAC = 0x6364666c, // cdfl
public enum CompressionMethod : ushort
{
Stored = 0,
Shrunk = 1,
ReducedCompressionFactor1 = 2,
ReducedCompressionFactor2 = 3,
ReducedCompressionFactor3 = 4,
ReducedCompressionFactor4 = 5,
Imploded = 6,
Tokenizing = 7,
Deflated = 8,
Delfate64 = 9,
PKWAREDataCompressionLibrary = 10,
BZIP2 = 12,
LZMA = 14,
IBMTERSE = 18,
IBMLZ77 = 19,
WavPak = 97,
PPMdVersionIRev1 = 98,
// Reserved and unused (SHOULD NOT BE USED) #endregion
Type11 = 11,
Type13 = 13,
Type15 = 15,
Type16 = 16,
Type17 = 17,
}
/// <summary> #region A/V Codecs
/// Type of file that is being looked at
/// </summary>
public enum FileType
{
// Singleton
None = 0,
CHD,
// Can contain children AVHUFF = 0x61766875, // avhu
Folder,
SevenZipArchive,
GZipArchive,
LRZipArchive,
LZ4Archive,
RarArchive,
TapeArchive,
XZArchive,
ZipArchive,
ZPAQArchive,
ZstdArchive,
}
/// <summary> #endregion
/// Output format for rebuilt files
/// </summary>
public enum OutputFormat
{
// Currently implemented
Folder = 0,
TorrentZip = 1,
TorrentGzip = 2,
TapeArchive = 5,
// Currently unimplemented fully #region Pseudo-Codecs Returned by hunk_info
Torrent7Zip = 3,
TorrentRar = 4,
TorrentXZ = 6,
TorrentLRZip = 7,
TorrentLZ4 = 8,
TorrentZstd = 9,
TorrentZPAQ = 10,
}
/// <summary> SELF = 1, // copy of another hunk
/// RAR extra area flag PARENT = 2, // copy of a parent's hunk
/// </summary> MINI = 3, // legacy "mini" 8-byte repeat
public enum RarExtraAreaFlag : uint
{
FileEncryption = 0x01,
FileHash = 0x02,
FileTime = 0x03,
FileVersion = 0x04,
Redirection = 0x05,
UnixOwner = 0x06,
ServiceData = 0x07,
}
/// <summary> #endregion
/// RAR header types }
/// </summary>
public enum RarHeaderType : uint
{
MainArchiveHeader = 1,
File = 2,
Service = 3,
ArchiveEncryption = 4,
EndOfArchive = 5,
}
/// <summary> /// <summary>
/// RAR entry redirection type /// Compression method based on flag
/// </summary> /// </summary>
public enum RarRedirectionType : uint public enum CompressionMethod : ushort
{ {
UnixSymlink = 0x0001, Stored = 0,
WindowsSymlink = 0x0002, Shrunk = 1,
WindowsJunction = 0x0003, ReducedCompressionFactor1 = 2,
HardLink = 0x0004, ReducedCompressionFactor2 = 3,
FileCopy = 0x0005, ReducedCompressionFactor3 = 4,
} ReducedCompressionFactor4 = 5,
Imploded = 6,
Tokenizing = 7,
Deflated = 8,
Delfate64 = 9,
PKWAREDataCompressionLibrary = 10,
Type11 = 11, // Reserved and unused (SHOULD NOT BE USED)
BZIP2 = 12,
Type13 = 13, // Reserved and unused (SHOULD NOT BE USED)
LZMA = 14,
Type15 = 15, // Reserved and unused (SHOULD NOT BE USED)
Type16 = 16, // Reserved and unused (SHOULD NOT BE USED)
Type17 = 17, // Reserved and unused (SHOULD NOT BE USED)
IBMTERSE = 18,
IBMLZ77 = 19,
WavPak = 97,
PPMdVersionIRev1 = 98,
}
/// <summary> /// <summary>
/// 7zip Properties /// Type of file that is being looked at
/// </summary> /// </summary>
public enum SevenZipProperties : uint public enum FileType
{ {
kEnd = 0x00, // Singleton
None = 0,
CHD,
kHeader = 0x01, // Can contain children
Folder,
SevenZipArchive,
GZipArchive,
LRZipArchive,
LZ4Archive,
RarArchive,
TapeArchive,
XZArchive,
ZipArchive,
ZPAQArchive,
ZstdArchive,
}
kArchiveProperties = 0x02, /// <summary>
/// Output format for rebuilt files
/// </summary>
public enum OutputFormat
{
// Currently implemented
Folder = 0,
TorrentZip = 1,
TorrentGzip = 2,
TapeArchive = 5,
kAdditionalStreamsInfo = 0x03, // Currently unimplemented fully
kMainStreamsInfo = 0x04, Torrent7Zip = 3,
kFilesInfo = 0x05, TorrentRar = 4,
TorrentXZ = 6,
TorrentLRZip = 7,
TorrentLZ4 = 8,
TorrentZstd = 9,
TorrentZPAQ = 10,
}
kPackInfo = 0x06, /// <summary>
kUnPackInfo = 0x07, /// RAR extra area flag
kSubStreamsInfo = 0x08, /// </summary>
public enum RarExtraAreaFlag : uint
{
FileEncryption = 0x01,
FileHash = 0x02,
FileTime = 0x03,
FileVersion = 0x04,
Redirection = 0x05,
UnixOwner = 0x06,
ServiceData = 0x07,
}
kSize = 0x09, /// <summary>
kCRC = 0x0A, /// RAR header types
/// </summary>
public enum RarHeaderType : uint
{
MainArchiveHeader = 1,
File = 2,
Service = 3,
ArchiveEncryption = 4,
EndOfArchive = 5,
}
kFolder = 0x0B, /// <summary>
/// RAR entry redirection type
/// </summary>
public enum RarRedirectionType : uint
{
UnixSymlink = 0x0001,
WindowsSymlink = 0x0002,
WindowsJunction = 0x0003,
HardLink = 0x0004,
FileCopy = 0x0005,
}
kCodersUnPackSize = 0x0C, /// <summary>
kNumUnPackStream = 0x0D, /// 7zip Properties
/// </summary>
public enum SevenZipProperties : uint
{
kEnd = 0x00,
kEmptyStream = 0x0E, kHeader = 0x01,
kEmptyFile = 0x0F,
kAnti = 0x10,
kName = 0x11, kArchiveProperties = 0x02,
kCTime = 0x12,
kATime = 0x13,
kMTime = 0x14,
kWinAttributes = 0x15,
kComment = 0x16,
kEncodedHeader = 0x17, kAdditionalStreamsInfo = 0x03,
kMainStreamsInfo = 0x04,
kFilesInfo = 0x05,
kStartPos = 0x18, kPackInfo = 0x06,
kDummy = 0x19, kUnPackInfo = 0x07,
} kSubStreamsInfo = 0x08,
/// <summary> kSize = 0x09,
/// Zip open type kCRC = 0x0A,
/// </summary>
/// <remarks>https://raw.githubusercontent.com/gjefferyes/RomVault/5a93500001f0d068f32cf77a048950717507f733/ROMVault2/SupportedFiles/ZipEnums.cs</remarks>
public enum ZipOpenType
{
Closed,
OpenRead,
OpenWrite
}
/// <summary> kFolder = 0x0B,
/// Zip testing type
/// </summary>
/// <remarks>https://raw.githubusercontent.com/gjefferyes/RomVault/5a93500001f0d068f32cf77a048950717507f733/ROMVault2/SupportedFiles/ZipEnums.cs</remarks>
public enum ZipReturn
{
ZipGood,
ZipFileLocked,
ZipFileCountError,
ZipSignatureError,
ZipExtraDataOnEndOfZip,
ZipUnsupportedCompression,
ZipLocalFileHeaderError,
ZipCentralDirError,
ZipEndOfCentralDirectoryError,
Zip64EndOfCentralDirError,
Zip64EndOfCentralDirectoryLocatorError,
ZipReadingFromOutputFile,
ZipWritingToInputFile,
ZipErrorGettingDataStream,
ZipCRCDecodeError,
ZipDecodeError,
ZipFileNameToLong,
ZipFileAlreadyOpen,
ZipCannotFastOpen,
ZipErrorOpeningFile,
ZipErrorFileNotFound,
ZipErrorReadingFile,
ZipErrorTimeStamp,
ZipErrorRollBackFile,
ZipUntested
}
#endregion kCodersUnPackSize = 0x0C,
kNumUnPackStream = 0x0D,
#region DatFile related kEmptyStream = 0x0E,
kEmptyFile = 0x0F,
kAnti = 0x10,
/// <summary> kName = 0x11,
/// Determines the DAT deduplication type kCTime = 0x12,
/// </summary> kATime = 0x13,
public enum DedupeType kMTime = 0x14,
{ kWinAttributes = 0x15,
None = 0, kComment = 0x16,
Full,
// Force only deduping with certain types kEncodedHeader = 0x17,
Game,
CRC,
MD5,
SHA1,
SHA256,
SHA384,
SHA512,
}
/// <summary> kStartPos = 0x18,
/// Determines forcemerging tag for DAT output kDummy = 0x19,
/// </summary> }
public enum ForceMerging
{
None = 0,
Split,
Merged,
NonMerged,
Full,
}
/// <summary> /// <summary>
/// Determines forcenodump tag for DAT output /// Zip open type
/// </summary> /// </summary>
public enum ForceNodump /// <remarks>https://raw.githubusercontent.com/gjefferyes/RomVault/5a93500001f0d068f32cf77a048950717507f733/ROMVault2/SupportedFiles/ZipEnums.cs</remarks>
{ public enum ZipOpenType
None = 0, {
Obsolete, Closed,
Required, OpenRead,
Ignore, OpenWrite
} }
/// <summary> /// <summary>
/// Determines forcepacking tag for DAT output /// Zip testing type
/// </summary> /// </summary>
public enum ForcePacking /// <remarks>https://raw.githubusercontent.com/gjefferyes/RomVault/5a93500001f0d068f32cf77a048950717507f733/ROMVault2/SupportedFiles/ZipEnums.cs</remarks>
{ public enum ZipReturn
None = 0, {
Zip, ZipGood,
Unzip, ZipFileLocked,
} ZipFileCountError,
ZipSignatureError,
ZipExtraDataOnEndOfZip,
ZipUnsupportedCompression,
ZipLocalFileHeaderError,
ZipCentralDirError,
ZipEndOfCentralDirectoryError,
Zip64EndOfCentralDirError,
Zip64EndOfCentralDirectoryLocatorError,
ZipReadingFromOutputFile,
ZipWritingToInputFile,
ZipErrorGettingDataStream,
ZipCRCDecodeError,
ZipDecodeError,
ZipFileNameToLong,
ZipFileAlreadyOpen,
ZipCannotFastOpen,
ZipErrorOpeningFile,
ZipErrorFileNotFound,
ZipErrorReadingFile,
ZipErrorTimeStamp,
ZipErrorRollBackFile,
ZipUntested
}
/// <summary> #endregion
/// Determines which files should be skipped in DFD
/// </summary>
public enum SkipFileType
{
None = 0,
Archive,
File,
}
/// <summary> #region DatFile related
/// Determines how the current dictionary is sorted by
/// </summary>
public enum SortedBy
{
Default = 0,
Size,
CRC,
MD5,
SHA1,
SHA256,
SHA384,
SHA512,
Game,
}
/// <summary> /// <summary>
/// Determines how a DAT will be split internally /// Determines the DAT deduplication type
/// </summary> /// </summary>
public enum SplitType public enum DedupeType
{ {
None = 0, None = 0,
NonMerged, Full,
Merged,
FullNonMerged,
Split,
DeviceNonMerged
}
#endregion // Force only deduping with certain types
Game,
CRC,
MD5,
SHA1,
SHA256,
SHA384,
SHA512,
}
#region DatItem related /// <summary>
/// Determines forcemerging tag for DAT output
/// </summary>
public enum ForceMerging
{
None = 0,
Split,
Merged,
NonMerged,
Full,
}
/// <summary> /// <summary>
/// List of valid field types within a DatItem/Machine /// Determines forcenodump tag for DAT output
/// </summary> /// </summary>
public enum Field : int public enum ForceNodump
{ {
NULL = 0, None = 0,
Obsolete,
Required,
Ignore,
}
// Generic DatItem /// <summary>
Name, /// Determines forcepacking tag for DAT output
PartName, /// </summary>
PartInterface, public enum ForcePacking
Features, {
AreaName, None = 0,
AreaSize, Zip,
Unzip,
}
// Machine /// <summary>
MachineName, /// Determines which files should be skipped in DFD
Comment, /// </summary>
Description, public enum SkipFileType
Year, {
Manufacturer, None = 0,
Publisher, Archive,
RomOf, File,
CloneOf, }
SampleOf,
Supported,
SourceFile,
Runnable,
Board,
RebuildTo,
Devices,
SlotOptions,
Infos,
MachineType,
// BiosSet /// <summary>
Default, /// Determines how the current dictionary is sorted by
/// </summary>
public enum SortedBy
{
Default = 0,
Size,
CRC,
MD5,
SHA1,
SHA256,
SHA384,
SHA512,
Game,
}
// Disk /// <summary>
MD5, /// Determines how a DAT will be split internally
SHA1, /// </summary>
SHA256, public enum SplitType
SHA384, {
SHA512, None = 0,
Merge, NonMerged,
Region, Merged,
Index, FullNonMerged,
Writable, Split,
Optional, DeviceNonMerged
Status, }
// Release #endregion
Language,
Date,
// Rom #region DatItem related
Bios,
Size,
CRC,
Offset,
}
/// <summary> /// <summary>
/// Determine what type of file an item is /// List of valid field types within a DatItem/Machine
/// </summary> /// </summary>
public enum ItemType public enum Field : int
{ {
Rom = 0, NULL = 0,
Disk = 1,
Sample = 2,
Release = 3,
BiosSet = 4,
Archive = 5,
Blank = 99, // This is not a real type, only used internally // Generic DatItem
} Name,
PartName,
PartInterface,
Features,
AreaName,
AreaSize,
#endregion // Machine
MachineName,
Comment,
Description,
Year,
Manufacturer,
Publisher,
RomOf,
CloneOf,
SampleOf,
Supported,
SourceFile,
Runnable,
Board,
RebuildTo,
Devices,
SlotOptions,
Infos,
MachineType,
#region Help related // BiosSet
Default,
/// <summary> // Disk
/// Determines the feature type to check for MD5,
/// </summary> SHA1,
public enum FeatureType SHA256,
{ SHA384,
Flag = 0, SHA512,
String, Merge,
Int32, Region,
Int64, Index,
List, Writable,
} Optional,
Status,
#endregion // Release
Language,
Date,
#region Logging related // Rom
Bios,
Size,
CRC,
Offset,
}
/// <summary> /// <summary>
/// Severity of the logging statement /// Determine what type of file an item is
/// </summary> /// </summary>
public enum LogLevel public enum ItemType
{ {
VERBOSE = 0, Rom = 0,
USER, Disk = 1,
WARNING, Sample = 2,
ERROR, Release = 3,
} BiosSet = 4,
Archive = 5,
#endregion Blank = 99, // This is not a real type, only used internally
}
#region Skippers and Mappers #endregion
/// <summary> #region Help related
/// Determines the header skip operation
/// </summary>
public enum HeaderSkipOperation
{
None = 0,
Bitswap,
Byteswap,
Wordswap,
WordByteswap,
}
/// <summary> /// <summary>
/// Determines the type of test to be done /// Determines the feature type to check for
/// </summary> /// </summary>
public enum HeaderSkipTest public enum FeatureType
{ {
Data = 0, Flag = 0,
Or, String,
Xor, Int32,
And, Int64,
File, List,
} }
/// <summary> #endregion
/// Determines the operator to be used in a file test
/// </summary>
public enum HeaderSkipTestFileOperator
{
Equal = 0,
Less,
Greater,
}
#endregion #region Logging related
/// <summary>
/// Severity of the logging statement
/// </summary>
public enum LogLevel
{
VERBOSE = 0,
USER,
WARNING,
ERROR,
}
#endregion
#region Skippers and Mappers
/// <summary>
/// Determines the header skip operation
/// </summary>
public enum HeaderSkipOperation
{
None = 0,
Bitswap,
Byteswap,
Wordswap,
WordByteswap,
}
/// <summary>
/// Determines the type of test to be done
/// </summary>
public enum HeaderSkipTest
{
Data = 0,
Or,
Xor,
And,
File,
}
/// <summary>
/// Determines the operator to be used in a file test
/// </summary>
public enum HeaderSkipTestFileOperator
{
Equal = 0,
Less,
Greater,
}
#endregion
} }

View File

@@ -101,7 +101,7 @@ namespace SabreTools.Library.FileTypes
private ulong m_hunkcount; // number of hunks represented private ulong m_hunkcount; // number of hunks represented
private uint m_unitbytes; // size of each unit in bytes private uint m_unitbytes; // size of each unit in bytes
private ulong m_unitcount; // number of units represented private ulong m_unitcount; // number of units represented
private CHDCodecType[] m_compression = new CHDCodecType[4]; // array of compression types used private CHD_CODEC[] m_compression = new CHD_CODEC[4]; // array of compression types used
// map information // map information
private uint m_mapentrybytes; // length of each entry in a map private uint m_mapentrybytes; // length of each entry in a map
@@ -300,14 +300,14 @@ namespace SabreTools.Library.FileTypes
// Determine compression // Determine compression
switch (m_br.ReadUInt32()) switch (m_br.ReadUInt32())
{ {
case 0: m_compression[0] = CHDCodecType.CHD_CODEC_NONE; break; case 0: m_compression[0] = CHD_CODEC.NONE; break;
case 1: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 1: m_compression[0] = CHD_CODEC.ZLIB; break;
case 2: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 2: m_compression[0] = CHD_CODEC.ZLIB; break;
case 3: m_compression[0] = CHDCodecType.CHD_CODEC_AVHUFF; break; case 3: m_compression[0] = CHD_CODEC.AVHUFF; break;
default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null; default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null;
} }
m_compression[1] = m_compression[2] = m_compression[3] = CHDCodecType.CHD_CODEC_NONE; m_compression[1] = m_compression[2] = m_compression[3] = CHD_CODEC.NONE;
m_sectorsperhunk = m_br.ReadUInt32Reverse(); m_sectorsperhunk = m_br.ReadUInt32Reverse();
m_hunkcount = m_br.ReadUInt32Reverse(); m_hunkcount = m_br.ReadUInt32Reverse();
@@ -343,14 +343,14 @@ namespace SabreTools.Library.FileTypes
// Determine compression // Determine compression
switch (m_br.ReadUInt32()) switch (m_br.ReadUInt32())
{ {
case 0: m_compression[0] = CHDCodecType.CHD_CODEC_NONE; break; case 0: m_compression[0] = CHD_CODEC.NONE; break;
case 1: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 1: m_compression[0] = CHD_CODEC.ZLIB; break;
case 2: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 2: m_compression[0] = CHD_CODEC.ZLIB; break;
case 3: m_compression[0] = CHDCodecType.CHD_CODEC_AVHUFF; break; case 3: m_compression[0] = CHD_CODEC.AVHUFF; break;
default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null; default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null;
} }
m_compression[1] = m_compression[2] = m_compression[3] = CHDCodecType.CHD_CODEC_NONE; m_compression[1] = m_compression[2] = m_compression[3] = CHD_CODEC.NONE;
m_sectorsperhunk = m_br.ReadUInt32Reverse(); m_sectorsperhunk = m_br.ReadUInt32Reverse();
m_hunkcount = m_br.ReadUInt32Reverse(); m_hunkcount = m_br.ReadUInt32Reverse();
@@ -387,14 +387,14 @@ namespace SabreTools.Library.FileTypes
// Determine compression // Determine compression
switch (m_br.ReadUInt32()) switch (m_br.ReadUInt32())
{ {
case 0: m_compression[0] = CHDCodecType.CHD_CODEC_NONE; break; case 0: m_compression[0] = CHD_CODEC.NONE; break;
case 1: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 1: m_compression[0] = CHD_CODEC.ZLIB; break;
case 2: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 2: m_compression[0] = CHD_CODEC.ZLIB; break;
case 3: m_compression[0] = CHDCodecType.CHD_CODEC_AVHUFF; break; case 3: m_compression[0] = CHD_CODEC.AVHUFF; break;
default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null; default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null;
} }
m_compression[1] = m_compression[2] = m_compression[3] = CHDCodecType.CHD_CODEC_NONE; m_compression[1] = m_compression[2] = m_compression[3] = CHD_CODEC.NONE;
m_hunkcount = m_br.ReadUInt32Reverse(); m_hunkcount = m_br.ReadUInt32Reverse();
m_logicalbytes = m_br.ReadUInt64Reverse(); m_logicalbytes = m_br.ReadUInt64Reverse();
@@ -435,14 +435,14 @@ namespace SabreTools.Library.FileTypes
// Determine compression // Determine compression
switch (m_br.ReadUInt32()) switch (m_br.ReadUInt32())
{ {
case 0: m_compression[0] = CHDCodecType.CHD_CODEC_NONE; break; case 0: m_compression[0] = CHD_CODEC.NONE; break;
case 1: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 1: m_compression[0] = CHD_CODEC.ZLIB; break;
case 2: m_compression[0] = CHDCodecType.CHD_CODEC_ZLIB; break; case 2: m_compression[0] = CHD_CODEC.ZLIB; break;
case 3: m_compression[0] = CHDCodecType.CHD_CODEC_AVHUFF; break; case 3: m_compression[0] = CHD_CODEC.AVHUFF; break;
default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null; default: /* throw CHDERR_UNKNOWN_COMPRESSION; */ return null;
} }
m_compression[1] = m_compression[2] = m_compression[3] = CHDCodecType.CHD_CODEC_NONE; m_compression[1] = m_compression[2] = m_compression[3] = CHD_CODEC.NONE;
m_hunkcount = m_br.ReadUInt32Reverse(); m_hunkcount = m_br.ReadUInt32Reverse();
m_logicalbytes = m_br.ReadUInt64Reverse(); m_logicalbytes = m_br.ReadUInt64Reverse();
@@ -473,10 +473,10 @@ namespace SabreTools.Library.FileTypes
byte[] sha1 = new byte[20]; byte[] sha1 = new byte[20];
// Determine compression // Determine compression
m_compression[0] = (CHDCodecType)m_br.ReadUInt32Reverse(); m_compression[0] = (CHD_CODEC)m_br.ReadUInt32Reverse();
m_compression[1] = (CHDCodecType)m_br.ReadUInt32Reverse(); m_compression[1] = (CHD_CODEC)m_br.ReadUInt32Reverse();
m_compression[2] = (CHDCodecType)m_br.ReadUInt32Reverse(); m_compression[2] = (CHD_CODEC)m_br.ReadUInt32Reverse();
m_compression[3] = (CHDCodecType)m_br.ReadUInt32Reverse(); m_compression[3] = (CHD_CODEC)m_br.ReadUInt32Reverse();
m_logicalbytes = m_br.ReadUInt64Reverse(); m_logicalbytes = m_br.ReadUInt64Reverse();
m_mapoffset = m_br.ReadUInt64Reverse(); m_mapoffset = m_br.ReadUInt64Reverse();