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 HeaderV5 : Header
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Which custom compressors are used?
|
|
|
|
|
|
/// </summary>
|
2025-09-30 10:59:44 -04:00
|
|
|
|
/// <remarks>There should be 4 entries</remarks>
|
2025-10-31 13:59:28 -04:00
|
|
|
|
public CodecType[] Compressors { get; set; } = [];
|
2025-09-26 11:57:18 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Logical size of the data (in bytes)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ulong LogicalBytes { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Offset to the map
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ulong MapOffset { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Offset to the first blob of metadata
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ulong MetaOffset { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Number of bytes per hunk (512k maximum)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public uint HunkBytes { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Number of bytes per unit within each hunk
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public uint UnitBytes { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raw data SHA1
|
|
|
|
|
|
/// </summary>
|
2025-10-30 20:44:16 -04:00
|
|
|
|
public byte[] RawSHA1 { get; set; } = new byte[20];
|
2025-09-26 11:57:18 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Combined raw+meta SHA1
|
|
|
|
|
|
/// </summary>
|
2025-10-30 20:44:16 -04:00
|
|
|
|
public byte[] SHA1 { get; set; } = new byte[20];
|
2025-09-26 11:57:18 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Combined raw+meta SHA1 of parent
|
|
|
|
|
|
/// </summary>
|
2025-10-30 20:44:16 -04:00
|
|
|
|
public byte[] ParentSHA1 { get; set; } = new byte[20];
|
2025-09-26 11:57:18 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|