2025-09-26 11:57:18 -04:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
2025-09-26 13:06:18 -04:00
|
|
|
|
namespace SabreTools.Data.Models.CHD
|
2025-09-26 11:57:18 -04:00
|
|
|
|
{
|
2025-10-30 20:44:16 -04:00
|
|
|
|
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
2025-09-26 11:57:18 -04:00
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
|
|
|
|
|
public class HeaderV4 : Header
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Flags
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[MarshalAs(UnmanagedType.U4)]
|
|
|
|
|
|
public Flags Flags;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Compression type
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[MarshalAs(UnmanagedType.U4)]
|
|
|
|
|
|
public CompressionType Compression;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Total # of hunks represented
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public uint TotalHunks;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Logical size of the data (in bytes)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ulong LogicalBytes;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Offset to the first blob of metadata
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ulong MetaOffset;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Number of bytes per hunk
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public uint HunkBytes;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Combined raw+meta SHA1
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
2025-10-30 20:44:16 -04:00
|
|
|
|
public byte[] SHA1 = new byte[20];
|
2025-09-26 11:57:18 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Combined raw+meta SHA1 of parent
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
2025-10-30 20:44:16 -04:00
|
|
|
|
public byte[] ParentSHA1 = new byte[20];
|
2025-09-26 11:57:18 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raw data SHA1
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
2025-10-30 20:44:16 -04:00
|
|
|
|
public byte[] RawSHA1 = new byte[20];
|
2025-09-26 11:57:18 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|