diff --git a/CHD/CompressedMapEntryV5.cs b/CHD/CompressedMapEntryV5.cs index d5437b8..0b21665 100644 --- a/CHD/CompressedMapEntryV5.cs +++ b/CHD/CompressedMapEntryV5.cs @@ -1,28 +1,31 @@ +using System.Runtime.InteropServices; + namespace SabreTools.Models.CHD { /// - public class CompressedMapEntryV5 + [StructLayout(LayoutKind.Sequential)] + public sealed class CompressedMapEntryV5 { /// /// Compression type /// - public byte Compression { get; set; } + public byte Compression; /// /// Compressed length /// /// Actually UInt24 - public uint CompLength { get; set; } + public uint CompLength; /// /// Offset /// /// Actually UInt48 - public ulong Offset { get; set; } + public ulong Offset; /// /// CRC-16 of the data /// - public ushort CRC { get; set; } + public ushort CRC; } } diff --git a/CHD/CompressedMapHeaderV5.cs b/CHD/CompressedMapHeaderV5.cs index 19f4447..1ec0e35 100644 --- a/CHD/CompressedMapHeaderV5.cs +++ b/CHD/CompressedMapHeaderV5.cs @@ -1,42 +1,45 @@ +using System.Runtime.InteropServices; + namespace SabreTools.Models.CHD { /// - public class CompressedMapHeaderV5 + [StructLayout(LayoutKind.Sequential)] + public sealed class CompressedMapHeaderV5 { /// /// Length of compressed map /// - public uint Length { get; set; } + public uint Length; /// /// Offset of first block /// /// Actually UInt48 - public ulong DataStart { get; set; } + public ulong DataStart; /// /// CRC-16 of the map /// - public ushort CRC { get; set; } + public ushort CRC; /// /// Bits used to encode complength /// - public byte LengthBits { get; set; } + public byte LengthBits; /// /// Bits used to encode self-refs /// - public byte HunkBits { get; set; } + public byte HunkBits; /// /// Bits used to encode parent unit refs /// - public byte ParentUnitBits { get; set; } + public byte ParentUnitBits; /// /// Future use /// - public byte Reserved { get; set; } + public byte Reserved; } } diff --git a/CHD/MapV1.cs b/CHD/MapV1.cs index bdb8451..e7efc23 100644 --- a/CHD/MapV1.cs +++ b/CHD/MapV1.cs @@ -1,16 +1,19 @@ +using System.Runtime.InteropServices; + namespace SabreTools.Models.CHD { /// - public class MapV1 + [StructLayout(LayoutKind.Sequential)] + public sealed class MapV1 { /// /// Starting offset within the file /// - public ulong StartingOffset { get; set; } + public ulong StartingOffset; /// /// Length of data; If == hunksize, data is uncompressed /// - public ulong Length { get; set; } + public ulong Length; } } diff --git a/CHD/MapV3.cs b/CHD/MapV3.cs index 9953ac6..1ed611d 100644 --- a/CHD/MapV3.cs +++ b/CHD/MapV3.cs @@ -1,31 +1,34 @@ +using System.Runtime.InteropServices; + namespace SabreTools.Models.CHD { /// - public class MapV3 + [StructLayout(LayoutKind.Sequential)] + public sealed class MapV3 { /// /// Starting offset within the file /// - public ulong StartingOffset { get; set; } + public ulong StartingOffset; /// /// 32-bit CRC of the uncompressed data /// - public uint CRC32 { get; set; } + public uint CRC32; /// /// Lower 16 bits of length /// - public ushort LengthLo { get; set; } + public ushort LengthLo; /// /// Upper 8 bits of length /// - public byte LengthHi { get; set; } + public byte LengthHi; /// /// Flags, indicating compression info /// - public byte Flags { get; set; } + public byte Flags; } } diff --git a/CHD/UncompressedMapV5.cs b/CHD/UncompressedMapV5.cs index 4fcb346..e9b20b2 100644 --- a/CHD/UncompressedMapV5.cs +++ b/CHD/UncompressedMapV5.cs @@ -1,11 +1,14 @@ +using System.Runtime.InteropServices; + namespace SabreTools.Models.CHD { /// + [StructLayout(LayoutKind.Sequential)] public class UncompressedMapV5 { /// /// Starting offset / hunk size /// - public uint StartingOffset { get; set; } + public uint StartingOffset; } }