[ALL] Start work on restructuring based on hashes (will not compile)

This set of changes is the start of turning over to a Hash based system instead of a Rom/Dat based system. It's a long process but it will be worth it in the end.
This commit is contained in:
Matt Nadareski
2016-08-29 16:33:07 -07:00
parent a5dae7e693
commit 0b97b046c8
18 changed files with 2094 additions and 226 deletions

View File

@@ -14,16 +14,22 @@ namespace SabreTools.Helper
public static long SizeZero = 0;
public static string CRCZero = "00000000";
public static byte[] CRCZeroBytes = new byte[] { 0x00, 0x00, 0x00, 0x00 };
public static string MD5Zero = "d41d8cd98f00b204e9800998ecf8427e";
public static byte[] MD5ZeroBytes = new byte[] { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e };
public static string SHA1Zero = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
public static byte[] SHA1ZeroBytes = new byte[] { 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, 0x09 };
#endregion
#region Hash string length constants
public static int CRCLength = 8;
public static int CRCBytesLength = 4;
public static int MD5Length = 32;
public static int MD5BytesLength = 16;
public static int SHA1Length = 40;
public static int SHA1BytesLength = 20;
#endregion

View File

@@ -28,9 +28,9 @@ namespace SabreTools.Helper
public struct HashData
{
public long Size;
public string CRC;
public string MD5;
public string SHA1;
public byte[] CRC;
public byte[] MD5;
public byte[] SHA1;
public List<RomData> Roms;
}
@@ -43,7 +43,8 @@ namespace SabreTools.Helper
public ItemType Type;
public bool Nodump;
public string Date;
public List<MachineData> Machines;
public DupeType DupeType;
public MachineData Machine;
}
/// <summary>
@@ -51,6 +52,7 @@ namespace SabreTools.Helper
/// </summary>
public struct MachineData
{
// Data specific to Machine/Game
public string Name;
public string Comment;
public string Description;
@@ -64,6 +66,12 @@ namespace SabreTools.Helper
public string Board;
public string RebuildTo;
public bool TorrentZipped;
// Data specific to the source of the Machine/Game
public int SystemID;
public string System;
public int SourceID;
public string Source;
}
/// <summary>
@@ -91,6 +99,7 @@ namespace SabreTools.Helper
public ForcePacking ForcePacking;
public OutputFormat OutputFormat;
public bool MergeRoms;
public List<HashData> Hashes;
// Data specific to the Miss DAT type
public bool UseGame;