[ALL] Fix device merging, add new parsing prototypes

This commit is contained in:
Matt Nadareski
2018-01-13 22:42:42 -08:00
parent 1484e318aa
commit 5e303cde49
12 changed files with 2200 additions and 86 deletions

View File

@@ -23,7 +23,6 @@ namespace SabreTools.Library.DatItems
// Standard item information
protected string _name;
protected string _merge;
protected ItemType _itemType;
protected DupeType _dupeType;
@@ -32,8 +31,6 @@ namespace SabreTools.Library.DatItems
// Software list information
protected bool? _supported;
protected string _publisher;
protected List<Tuple<string, string>> _infos;
protected string _partName;
protected string _partInterface;
protected List<Tuple<string, string>> _features;
@@ -57,11 +54,6 @@ namespace SabreTools.Library.DatItems
get { return _name; }
set { _name = value; }
}
public string MergeTag
{
get { return _merge; }
set { _merge = value; }
}
public ItemType Type
{
get { return _itemType; }
@@ -370,20 +362,20 @@ namespace SabreTools.Library.DatItems
}
// Software list information
public bool? Supported
public bool? Supported // yes = true, partial = null, no = false
{
get { return _supported; }
set { _supported = value; }
get { return _machine.Supported; }
set { _machine.Supported = value; }
}
public string Publisher
{
get { return _publisher; }
set { _publisher = value; }
get { return _machine.Publisher; }
set { _machine.Publisher = value; }
}
public List<Tuple<string, string>> Infos
{
get { return _infos; }
set { _infos = value; }
get { return _machine.Infos; }
set { _machine.Infos = value; }
}
public string PartName
{

View File

@@ -18,7 +18,12 @@ namespace SabreTools.Library.DatItems
private byte[] _sha256; // 32 bytes
private byte[] _sha384; // 48 bytes
private byte[] _sha512; // 64 bytes
private string _merge;
private string _region;
private string _index;
private bool? _writable;
private ItemStatus _itemStatus;
private bool? _optional;
#endregion
@@ -50,11 +55,36 @@ namespace SabreTools.Library.DatItems
get { return _sha512.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_sha512); }
set { _sha512 = Utilities.StringToByteArray(value); }
}
public string MergeTag
{
get { return _merge; }
set { _merge = value; }
}
public string Region
{
get { return _region; }
set { _region = value; }
}
public string Index
{
get { return _index; }
set { _index = value; }
}
public bool? Writable
{
get { return _writable; }
set { _writable = value; }
}
public ItemStatus ItemStatus
{
get { return _itemStatus; }
set { _itemStatus = value; }
}
public bool? Optional
{
get { return _optional; }
set { _optional = value; }
}
#endregion

View File

@@ -18,14 +18,17 @@ namespace SabreTools.Library.DatItems
public string Description;
public string Year;
public string Manufacturer;
public string Publisher;
public string RomOf;
public string CloneOf;
public string SampleOf;
public bool? Supported;
public string SourceFile;
public bool? Runnable;
public string Board;
public string RebuildTo;
public List<string> Devices;
public List<Tuple<string, string>> Infos;
public MachineType MachineType;
#endregion
@@ -42,9 +45,11 @@ namespace SabreTools.Library.DatItems
Description = null;
Year = null;
Manufacturer = null;
Publisher = null;
RomOf = null;
CloneOf = null;
SampleOf = null;
Supported = true;
SourceFile = null;
Runnable = null;
Board = null;
@@ -65,9 +70,11 @@ namespace SabreTools.Library.DatItems
Description = description;
Year = null;
Manufacturer = null;
Publisher = null;
RomOf = null;
CloneOf = null;
SampleOf = null;
Supported = true;
SourceFile = null;
Runnable = null;
Board = null;
@@ -93,9 +100,11 @@ namespace SabreTools.Library.DatItems
Description = this.Description,
Year = this.Year,
Manufacturer = this.Manufacturer,
Publisher = this.Publisher,
RomOf = this.RomOf,
CloneOf = this.CloneOf,
SampleOf = this.SampleOf,
Supported = this.Supported,
SourceFile = this.SourceFile,
Runnable = this.Runnable,
Board = this.Board,

View File

@@ -13,6 +13,7 @@ namespace SabreTools.Library.DatItems
#region Private instance variables
// Rom information
private string _bios;
private long _size;
private byte[] _crc; // 8 bytes
private byte[] _md5; // 16 bytes
@@ -20,14 +21,23 @@ namespace SabreTools.Library.DatItems
private byte[] _sha256; // 32 bytes
private byte[] _sha384; // 48 bytes
private byte[] _sha512; // 64 bytes
private string _merge;
private string _region;
private string _offset;
private string _date;
private ItemStatus _itemStatus;
private bool? _optional;
#endregion
#region Publicly facing variables
// Rom information
public string Bios
{
get { return _bios; }
set { _bios = value; }
}
public long Size
{
get { return _size; }
@@ -63,6 +73,21 @@ namespace SabreTools.Library.DatItems
get { return _sha512.IsNullOrWhiteSpace() ? null : Utilities.ByteArrayToString(_sha512); }
set { _sha512 = Utilities.StringToByteArray(value); }
}
public string MergeTag
{
get { return _merge; }
set { _merge = value; }
}
public string Region
{
get { return _region; }
set { _region = value; }
}
public string Offset
{
get { return _offset; }
set { _offset = value; }
}
public string Date
{
get { return _date; }
@@ -73,6 +98,11 @@ namespace SabreTools.Library.DatItems
get { return _itemStatus; }
set { _itemStatus = value; }
}
public bool? Optional
{
get { return _optional; }
set { _optional = value; }
}
#endregion