mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Promote DataArea, DiskArea, and Part
This commit is contained in:
@@ -119,6 +119,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public long ConfigurationCount { get; private set; } = 0;
|
public long ConfigurationCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of DataArea items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public long DataAreaCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of Device items
|
/// Number of Device items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -143,6 +149,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public long DiskCount { get; private set; } = 0;
|
public long DiskCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of DiskArea items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public long DiskAreaCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of Display items
|
/// Number of Display items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -179,6 +191,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public long MediaCount { get; private set; } = 0;
|
public long MediaCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of Part items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public long PartCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of PartFeature items
|
/// Number of PartFeature items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -586,6 +604,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Configuration:
|
case ItemType.Configuration:
|
||||||
ConfigurationCount++;
|
ConfigurationCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.DataArea:
|
||||||
|
DataAreaCount++;
|
||||||
|
break;
|
||||||
case ItemType.Device:
|
case ItemType.Device:
|
||||||
DeviceCount++;
|
DeviceCount++;
|
||||||
break;
|
break;
|
||||||
@@ -608,6 +629,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
NodumpCount += ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
NodumpCount += ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
||||||
VerifiedCount += ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
VerifiedCount += ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
||||||
break;
|
break;
|
||||||
|
case ItemType.DiskArea:
|
||||||
|
DiskAreaCount++;
|
||||||
|
break;
|
||||||
case ItemType.Display:
|
case ItemType.Display:
|
||||||
DisplayCount++;
|
DisplayCount++;
|
||||||
break;
|
break;
|
||||||
@@ -629,6 +653,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
SHA1Count += (string.IsNullOrWhiteSpace((item as Media).SHA1) ? 0 : 1);
|
SHA1Count += (string.IsNullOrWhiteSpace((item as Media).SHA1) ? 0 : 1);
|
||||||
SHA256Count += (string.IsNullOrWhiteSpace((item as Media).SHA256) ? 0 : 1);
|
SHA256Count += (string.IsNullOrWhiteSpace((item as Media).SHA256) ? 0 : 1);
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Part:
|
||||||
|
PartCount++;
|
||||||
|
break;
|
||||||
case ItemType.PartFeature:
|
case ItemType.PartFeature:
|
||||||
PartFeatureCount++;
|
PartFeatureCount++;
|
||||||
break;
|
break;
|
||||||
@@ -772,6 +799,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Configuration:
|
case ItemType.Configuration:
|
||||||
ConfigurationCount--;
|
ConfigurationCount--;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.DataArea:
|
||||||
|
DataAreaCount--;
|
||||||
|
break;
|
||||||
case ItemType.Device:
|
case ItemType.Device:
|
||||||
DeviceCount--;
|
DeviceCount--;
|
||||||
break;
|
break;
|
||||||
@@ -794,6 +824,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
NodumpCount -= ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
NodumpCount -= ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
||||||
VerifiedCount -= ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
VerifiedCount -= ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
||||||
break;
|
break;
|
||||||
|
case ItemType.DiskArea:
|
||||||
|
DiskAreaCount--;
|
||||||
|
break;
|
||||||
case ItemType.Display:
|
case ItemType.Display:
|
||||||
DisplayCount--;
|
DisplayCount--;
|
||||||
break;
|
break;
|
||||||
@@ -815,6 +848,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
SHA1Count -= (string.IsNullOrWhiteSpace((item as Media).SHA1) ? 0 : 1);
|
SHA1Count -= (string.IsNullOrWhiteSpace((item as Media).SHA1) ? 0 : 1);
|
||||||
SHA256Count -= (string.IsNullOrWhiteSpace((item as Media).SHA256) ? 0 : 1);
|
SHA256Count -= (string.IsNullOrWhiteSpace((item as Media).SHA256) ? 0 : 1);
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Part:
|
||||||
|
PartCount--;
|
||||||
|
break;
|
||||||
case ItemType.PartFeature:
|
case ItemType.PartFeature:
|
||||||
PartFeatureCount--;
|
PartFeatureCount--;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -235,6 +235,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Control:
|
case ItemType.Control:
|
||||||
datItem = datItemObj.ToObject<Control>();
|
datItem = datItemObj.ToObject<Control>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.DataArea:
|
||||||
|
datItem = datItemObj.ToObject<DataArea>();
|
||||||
|
break;
|
||||||
case ItemType.Device:
|
case ItemType.Device:
|
||||||
datItem = datItemObj.ToObject<Device>();
|
datItem = datItemObj.ToObject<Device>();
|
||||||
break;
|
break;
|
||||||
@@ -247,6 +250,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
datItem = datItemObj.ToObject<Disk>();
|
datItem = datItemObj.ToObject<Disk>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.DiskArea:
|
||||||
|
datItem = datItemObj.ToObject<DiskArea>();
|
||||||
|
break;
|
||||||
case ItemType.Display:
|
case ItemType.Display:
|
||||||
datItem = datItemObj.ToObject<Display>();
|
datItem = datItemObj.ToObject<Display>();
|
||||||
break;
|
break;
|
||||||
@@ -274,6 +280,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
datItem = datItemObj.ToObject<Media>();
|
datItem = datItemObj.ToObject<Media>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Part:
|
||||||
|
datItem = datItemObj.ToObject<Part>();
|
||||||
|
break;
|
||||||
case ItemType.PartFeature:
|
case ItemType.PartFeature:
|
||||||
datItem = datItemObj.ToObject<PartFeature>();
|
datItem = datItemObj.ToObject<PartFeature>();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -32,78 +33,5 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SoftwareList
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents one SoftwareList dataarea object
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// One DataArea can contain multiple Rom items
|
|
||||||
/// </remarks>
|
|
||||||
[JsonObject("dataarea")]
|
|
||||||
public class DataArea
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Name of the item
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Total size of the area
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("size", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public long? Size { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Word width for the area
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("width", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public long? Width { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Byte endianness of the area
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("endianness", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public Endianness Endianness { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents one SoftwareList diskarea object
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// One DiskArea can contain multiple Disk items
|
|
||||||
/// </remarks>
|
|
||||||
[JsonObject("diskarea")]
|
|
||||||
public class DiskArea
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Name of the item
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents one SoftwareList part object
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// One Part can contain multiple PartFeature, DataArea, DiskArea, and DipSwitch items
|
|
||||||
/// </remarks>
|
|
||||||
[JsonObject("part")]
|
|
||||||
public class Part
|
|
||||||
{
|
|
||||||
[JsonProperty("name")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("interface")]
|
|
||||||
public string Interface { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("features", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public List<PartFeature> Features { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion //DatItem
|
#endregion //DatItem
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,15 +114,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
Field.DatItem_Boot,
|
Field.DatItem_Boot,
|
||||||
|
|
||||||
// Rom (SoftwareList)
|
// Rom (SoftwareList)
|
||||||
Field.DatItem_AreaName,
|
|
||||||
Field.DatItem_AreaSize,
|
|
||||||
Field.DatItem_AreaWidth,
|
|
||||||
Field.DatItem_AreaEndianness,
|
|
||||||
Field.DatItem_LoadFlag,
|
Field.DatItem_LoadFlag,
|
||||||
Field.DatItem_Part_Name,
|
|
||||||
Field.DatItem_Part_Interface,
|
|
||||||
Field.DatItem_Part_Feature_Name,
|
|
||||||
Field.DatItem_Part_Feature_Value,
|
|
||||||
Field.DatItem_Value,
|
Field.DatItem_Value,
|
||||||
|
|
||||||
// Disk
|
// Disk
|
||||||
@@ -169,6 +161,12 @@ namespace SabreTools.Library.DatItems
|
|||||||
Field.DatItem_Control_Ways2,
|
Field.DatItem_Control_Ways2,
|
||||||
Field.DatItem_Control_Ways3,
|
Field.DatItem_Control_Ways3,
|
||||||
|
|
||||||
|
// DataArea
|
||||||
|
Field.DatItem_AreaName,
|
||||||
|
Field.DatItem_AreaSize,
|
||||||
|
Field.DatItem_AreaWidth,
|
||||||
|
Field.DatItem_AreaEndianness,
|
||||||
|
|
||||||
// Device
|
// Device
|
||||||
Field.DatItem_DeviceType,
|
Field.DatItem_DeviceType,
|
||||||
Field.DatItem_FixedImage,
|
Field.DatItem_FixedImage,
|
||||||
@@ -219,6 +217,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
Field.DatItem_Location_Number,
|
Field.DatItem_Location_Number,
|
||||||
Field.DatItem_Location_Inverted,
|
Field.DatItem_Location_Inverted,
|
||||||
|
|
||||||
|
// Part
|
||||||
|
Field.DatItem_Part_Name,
|
||||||
|
Field.DatItem_Part_Interface,
|
||||||
|
|
||||||
|
// PartFeature
|
||||||
|
Field.DatItem_Part_Feature_Name,
|
||||||
|
Field.DatItem_Part_Feature_Value,
|
||||||
|
|
||||||
// RamOption
|
// RamOption
|
||||||
Field.DatItem_Content,
|
Field.DatItem_Content,
|
||||||
|
|
||||||
@@ -394,6 +400,9 @@ namespace SabreTools.Library.DatItems
|
|||||||
case ItemType.Control:
|
case ItemType.Control:
|
||||||
return new Control();
|
return new Control();
|
||||||
|
|
||||||
|
case ItemType.DataArea:
|
||||||
|
return new DataArea();
|
||||||
|
|
||||||
case ItemType.Device:
|
case ItemType.Device:
|
||||||
return new Device();
|
return new Device();
|
||||||
|
|
||||||
@@ -406,6 +415,9 @@ namespace SabreTools.Library.DatItems
|
|||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
return new Disk();
|
return new Disk();
|
||||||
|
|
||||||
|
case ItemType.DiskArea:
|
||||||
|
return new DiskArea();
|
||||||
|
|
||||||
case ItemType.Display:
|
case ItemType.Display:
|
||||||
return new Display();
|
return new Display();
|
||||||
|
|
||||||
@@ -433,6 +445,9 @@ namespace SabreTools.Library.DatItems
|
|||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
return new Media();
|
return new Media();
|
||||||
|
|
||||||
|
case ItemType.Part:
|
||||||
|
return new Part();
|
||||||
|
|
||||||
case ItemType.PartFeature:
|
case ItemType.PartFeature:
|
||||||
return new PartFeature();
|
return new PartFeature();
|
||||||
|
|
||||||
|
|||||||
283
SabreTools.Library/DatItems/DataArea.cs
Normal file
283
SabreTools.Library/DatItems/DataArea.cs
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using SabreTools.Library.Filtering;
|
||||||
|
using SabreTools.Library.Tools;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace SabreTools.Library.DatItems
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SoftwareList dataarea information
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>One DataArea can contain multiple Rom items</remarks>
|
||||||
|
[JsonObject("dataarea")]
|
||||||
|
public class DataArea : DatItem
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the item
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Total size of the area
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("size", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public long? Size { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Word width for the area
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("width", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public long? Width { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Byte endianness of the area
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("endianness", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public Endianness Endianness { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Accessors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name to use for a DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Name if available, null otherwise</returns>
|
||||||
|
public override string GetName()
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set fields with given values
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mappings">Mappings dictionary</param>
|
||||||
|
public override void SetFields(Dictionary<Field, string> mappings)
|
||||||
|
{
|
||||||
|
// Set base fields
|
||||||
|
base.SetFields(mappings);
|
||||||
|
|
||||||
|
// Handle DataArea-specific fields
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_AreaName))
|
||||||
|
Name = mappings[Field.DatItem_AreaName];
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_AreaSize))
|
||||||
|
{
|
||||||
|
if (Int64.TryParse(mappings[Field.DatItem_AreaSize], out long areaSize))
|
||||||
|
Size = areaSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_AreaWidth))
|
||||||
|
{
|
||||||
|
if (Int64.TryParse(mappings[Field.DatItem_AreaWidth], out long areaWidth))
|
||||||
|
Width = areaWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_AreaEndianness))
|
||||||
|
Endianness = mappings[Field.DatItem_AreaEndianness].AsEndianness();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a default, empty DataArea object
|
||||||
|
/// </summary>
|
||||||
|
public DataArea()
|
||||||
|
{
|
||||||
|
Name = string.Empty;
|
||||||
|
ItemType = ItemType.DataArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Cloning Methods
|
||||||
|
|
||||||
|
public override object Clone()
|
||||||
|
{
|
||||||
|
return new DataArea()
|
||||||
|
{
|
||||||
|
ItemType = this.ItemType,
|
||||||
|
DupeType = this.DupeType,
|
||||||
|
|
||||||
|
Machine = this.Machine.Clone() as Machine,
|
||||||
|
Source = this.Source.Clone() as Source,
|
||||||
|
Remove = this.Remove,
|
||||||
|
|
||||||
|
Name = this.Name,
|
||||||
|
Size = this.Size,
|
||||||
|
Width = this.Width,
|
||||||
|
Endianness = this.Endianness,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Comparision Methods
|
||||||
|
|
||||||
|
public override bool Equals(DatItem other)
|
||||||
|
{
|
||||||
|
// If we don't have a DataArea, return false
|
||||||
|
if (ItemType != other.ItemType)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Otherwise, treat it as a DataArea
|
||||||
|
DataArea newOther = other as DataArea;
|
||||||
|
|
||||||
|
// If the DataArea information matches
|
||||||
|
return (Name == newOther.Name
|
||||||
|
&& Size == newOther.Size
|
||||||
|
&& Width == newOther.Width
|
||||||
|
&& Endianness == newOther.Endianness);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Filtering
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean a DatItem according to the cleaner
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cleaner">Cleaner to implement</param>
|
||||||
|
public override void Clean(Cleaner cleaner)
|
||||||
|
{
|
||||||
|
// Clean common items first
|
||||||
|
base.Clean(cleaner);
|
||||||
|
|
||||||
|
// If we're stripping unicode characters, strip item name
|
||||||
|
if (cleaner?.RemoveUnicode == true)
|
||||||
|
Name = Sanitizer.RemoveUnicodeCharacters(Name);
|
||||||
|
|
||||||
|
// If we are in NTFS trim mode, trim the game name
|
||||||
|
if (cleaner?.Trim == true)
|
||||||
|
{
|
||||||
|
// Windows max name length is 260
|
||||||
|
int usableLength = 260 - Machine.Name.Length - (cleaner.Root?.Length ?? 0);
|
||||||
|
if (Name.Length > usableLength)
|
||||||
|
{
|
||||||
|
string ext = Path.GetExtension(Name);
|
||||||
|
Name = Name.Substring(0, usableLength - ext.Length);
|
||||||
|
Name += ext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check to see if a DatItem passes the filter
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">Filter to check against</param>
|
||||||
|
/// <returns>True if the item passed the filter, false otherwise</returns>
|
||||||
|
public override bool PassesFilter(Filter filter)
|
||||||
|
{
|
||||||
|
// Check common fields first
|
||||||
|
if (!base.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on area name
|
||||||
|
if (filter.DatItem_AreaName.MatchesPositiveSet(Name) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_AreaName.MatchesNegativeSet(Name) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on area size
|
||||||
|
if (filter.DatItem_AreaSize.MatchesNeutral(null, Size) == false)
|
||||||
|
return false;
|
||||||
|
else if (filter.DatItem_AreaSize.MatchesPositive(null, Size) == false)
|
||||||
|
return false;
|
||||||
|
else if (filter.DatItem_AreaSize.MatchesNegative(null, Size) == false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on area byte width
|
||||||
|
if (filter.DatItem_AreaWidth.MatchesPositive(null, Width) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_AreaWidth.MatchesNegative(null, Width) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on area endianness
|
||||||
|
if (filter.DatItem_AreaEndianness.MatchesPositive(Endianness.NULL, Endianness) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_AreaEndianness.MatchesNegative(Endianness.NULL, Endianness) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove fields from the DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fields">List of Fields to remove</param>
|
||||||
|
public override void RemoveFields(List<Field> fields)
|
||||||
|
{
|
||||||
|
// Remove common fields first
|
||||||
|
base.RemoveFields(fields);
|
||||||
|
|
||||||
|
// Remove the fields
|
||||||
|
if (fields.Contains(Field.DatItem_AreaName))
|
||||||
|
Name = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_AreaSize))
|
||||||
|
Size = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_AreaWidth))
|
||||||
|
Width = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_AreaEndianness))
|
||||||
|
Endianness = Endianness.NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set internal names to match One Rom Per Game (ORPG) logic
|
||||||
|
/// </summary>
|
||||||
|
public override void SetOneRomPerGame()
|
||||||
|
{
|
||||||
|
string[] splitname = Name.Split('.');
|
||||||
|
Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}";
|
||||||
|
Name = Path.GetFileName(Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sorting and Merging
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replace fields from another item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">DatItem to pull new information from</param>
|
||||||
|
/// <param name="fields">List of Fields representing what should be updated</param>
|
||||||
|
public override void ReplaceFields(DatItem item, List<Field> fields)
|
||||||
|
{
|
||||||
|
// Replace common fields first
|
||||||
|
base.ReplaceFields(item, fields);
|
||||||
|
|
||||||
|
// If we don't have a DataArea to replace from, ignore specific fields
|
||||||
|
if (item.ItemType != ItemType.DataArea)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Cast for easier access
|
||||||
|
DataArea newItem = item as DataArea;
|
||||||
|
|
||||||
|
// Replace the fields
|
||||||
|
if (fields.Contains(Field.DatItem_AreaName))
|
||||||
|
Name = newItem.Name;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_AreaSize))
|
||||||
|
Size = newItem.Size;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_AreaWidth))
|
||||||
|
Width = newItem.Width;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_AreaEndianness))
|
||||||
|
Endianness = newItem.Endianness;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -129,23 +129,11 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Part_Name))
|
// Handle Part-specific fields
|
||||||
{
|
if (Part == null)
|
||||||
if (Part == null)
|
Part = new Part();
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Name = mappings[Field.DatItem_Part_Name];
|
Part.SetFields(mappings);
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Part_Interface))
|
|
||||||
{
|
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Interface = mappings[Field.DatItem_Part_Interface];
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -209,7 +197,9 @@ namespace SabreTools.Library.DatItems
|
|||||||
if (!match)
|
if (!match)
|
||||||
return match;
|
return match;
|
||||||
|
|
||||||
// TODO: Handle Part*
|
// If the part matches
|
||||||
|
if (Part != null)
|
||||||
|
match &= (Part == newOther.Part);
|
||||||
|
|
||||||
// If the conditions match
|
// If the conditions match
|
||||||
if (Conditions != null)
|
if (Conditions != null)
|
||||||
@@ -337,19 +327,12 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
// Filter on part name
|
// Filter on Part
|
||||||
if (filter.DatItem_Part_Name.MatchesPositiveSet(Part?.Name) == false)
|
if (Part != null)
|
||||||
return false;
|
{
|
||||||
if (filter.DatItem_Part_Name.MatchesNegativeSet(Part?.Name) == true)
|
if (!Part.PassesFilter(filter))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
// Filter on part interface
|
|
||||||
if (filter.DatItem_Part_Interface.MatchesPositiveSet(Part?.Interface) == false)
|
|
||||||
return false;
|
|
||||||
if (filter.DatItem_Part_Interface.MatchesNegativeSet(Part?.Interface) == true)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -406,13 +389,8 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Name) && Part != null)
|
if (Part != null)
|
||||||
Part.Name = null;
|
Part.RemoveFields(fields);
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Interface) && Part != null)
|
|
||||||
Part.Interface = null;
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -477,23 +455,8 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Name))
|
if (Part != null && newItem.Part != null)
|
||||||
{
|
Part.ReplaceFields(newItem.Part, fields);
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Name = newItem.Part?.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Interface))
|
|
||||||
{
|
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Interface = newItem.Part?.Interface;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,31 +158,17 @@ namespace SabreTools.Library.DatItems
|
|||||||
if (mappings.Keys.Contains(Field.DatItem_Optional))
|
if (mappings.Keys.Contains(Field.DatItem_Optional))
|
||||||
Optional = mappings[Field.DatItem_Optional].AsYesNo();
|
Optional = mappings[Field.DatItem_Optional].AsYesNo();
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_AreaName))
|
// Handle DiskArea-specific fields
|
||||||
{
|
if (DiskArea == null)
|
||||||
if (DiskArea == null)
|
DiskArea = new DiskArea();
|
||||||
DiskArea = new DiskArea();
|
|
||||||
|
|
||||||
DiskArea.Name = mappings[Field.DatItem_AreaName];
|
DiskArea.SetFields(mappings);
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Part_Name))
|
// Handle Part-specific fields
|
||||||
{
|
if (Part == null)
|
||||||
if (Part == null)
|
Part = new Part();
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Name = mappings[Field.DatItem_Part_Name];
|
Part.SetFields(mappings);
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Part_Interface))
|
|
||||||
{
|
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Interface = mappings[Field.DatItem_Part_Interface];
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -474,25 +460,19 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
// Filter on area name
|
// Filter on DiskArea
|
||||||
if (filter.DatItem_AreaName.MatchesPositiveSet(DiskArea?.Name) == false)
|
if (DiskArea != null)
|
||||||
return false;
|
{
|
||||||
if (filter.DatItem_AreaName.MatchesNegativeSet(DiskArea?.Name) == true)
|
if (!DiskArea.PassesFilter(filter))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Filter on part name
|
// Filter on Part
|
||||||
if (filter.DatItem_Part_Name.MatchesPositiveSet(Part?.Name) == false)
|
if (Part != null)
|
||||||
return false;
|
{
|
||||||
if (filter.DatItem_Part_Name.MatchesNegativeSet(Part?.Name) == true)
|
if (!Part.PassesFilter(filter))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
// Filter on part interface
|
|
||||||
if (filter.DatItem_Part_Interface.MatchesPositiveSet(Part?.Interface) == false)
|
|
||||||
return false;
|
|
||||||
if (filter.DatItem_Part_Interface.MatchesNegativeSet(Part?.Interface) == true)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -543,19 +523,11 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaName))
|
if (DiskArea != null)
|
||||||
{
|
DiskArea.RemoveFields(fields);
|
||||||
if (DiskArea != null)
|
|
||||||
DiskArea.Name = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Name) && Part != null)
|
if (Part != null)
|
||||||
Part.Name = null;
|
Part.RemoveFields(fields);
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Interface) && Part != null)
|
|
||||||
Part.Interface = null;
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -667,31 +639,11 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaName))
|
if (DiskArea != null && newItem.DiskArea != null)
|
||||||
{
|
DiskArea.ReplaceFields(newItem.DiskArea, fields);
|
||||||
if (DiskArea == null)
|
|
||||||
DiskArea = new DiskArea();
|
|
||||||
|
|
||||||
DiskArea.Name = newItem.DiskArea?.Name;
|
if (Part != null && newItem.Part != null)
|
||||||
}
|
Part.ReplaceFields(newItem.Part, fields);
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Name))
|
|
||||||
{
|
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Name = newItem.Part?.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Interface))
|
|
||||||
{
|
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Interface = newItem.Part?.Interface;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
206
SabreTools.Library/DatItems/DiskArea.cs
Normal file
206
SabreTools.Library/DatItems/DiskArea.cs
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using SabreTools.Library.Filtering;
|
||||||
|
using SabreTools.Library.Tools;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace SabreTools.Library.DatItems
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SoftwareList diskarea information
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>One DiskArea can contain multiple Disk items</remarks>
|
||||||
|
[JsonObject("diskarea")]
|
||||||
|
public class DiskArea : DatItem
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the item
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Accessors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name to use for a DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Name if available, null otherwise</returns>
|
||||||
|
public override string GetName()
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set fields with given values
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mappings">Mappings dictionary</param>
|
||||||
|
public override void SetFields(Dictionary<Field, string> mappings)
|
||||||
|
{
|
||||||
|
// Set base fields
|
||||||
|
base.SetFields(mappings);
|
||||||
|
|
||||||
|
// Handle DiskArea-specific fields
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_AreaName))
|
||||||
|
Name = mappings[Field.DatItem_AreaName];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a default, empty DiskArea object
|
||||||
|
/// </summary>
|
||||||
|
public DiskArea()
|
||||||
|
{
|
||||||
|
Name = string.Empty;
|
||||||
|
ItemType = ItemType.DiskArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Cloning Methods
|
||||||
|
|
||||||
|
public override object Clone()
|
||||||
|
{
|
||||||
|
return new DiskArea()
|
||||||
|
{
|
||||||
|
ItemType = this.ItemType,
|
||||||
|
DupeType = this.DupeType,
|
||||||
|
|
||||||
|
Machine = this.Machine.Clone() as Machine,
|
||||||
|
Source = this.Source.Clone() as Source,
|
||||||
|
Remove = this.Remove,
|
||||||
|
|
||||||
|
Name = this.Name,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Comparision Methods
|
||||||
|
|
||||||
|
public override bool Equals(DatItem other)
|
||||||
|
{
|
||||||
|
// If we don't have a DiskArea, return false
|
||||||
|
if (ItemType != other.ItemType)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Otherwise, treat it as a DiskArea
|
||||||
|
DiskArea newOther = other as DiskArea;
|
||||||
|
|
||||||
|
// If the DiskArea information matches
|
||||||
|
return (Name == newOther.Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Filtering
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean a DatItem according to the cleaner
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cleaner">Cleaner to implement</param>
|
||||||
|
public override void Clean(Cleaner cleaner)
|
||||||
|
{
|
||||||
|
// Clean common items first
|
||||||
|
base.Clean(cleaner);
|
||||||
|
|
||||||
|
// If we're stripping unicode characters, strip item name
|
||||||
|
if (cleaner?.RemoveUnicode == true)
|
||||||
|
Name = Sanitizer.RemoveUnicodeCharacters(Name);
|
||||||
|
|
||||||
|
// If we are in NTFS trim mode, trim the game name
|
||||||
|
if (cleaner?.Trim == true)
|
||||||
|
{
|
||||||
|
// Windows max name length is 260
|
||||||
|
int usableLength = 260 - Machine.Name.Length - (cleaner.Root?.Length ?? 0);
|
||||||
|
if (Name.Length > usableLength)
|
||||||
|
{
|
||||||
|
string ext = Path.GetExtension(Name);
|
||||||
|
Name = Name.Substring(0, usableLength - ext.Length);
|
||||||
|
Name += ext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check to see if a DatItem passes the filter
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">Filter to check against</param>
|
||||||
|
/// <returns>True if the item passed the filter, false otherwise</returns>
|
||||||
|
public override bool PassesFilter(Filter filter)
|
||||||
|
{
|
||||||
|
// Check common fields first
|
||||||
|
if (!base.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on area name
|
||||||
|
if (filter.DatItem_AreaName.MatchesPositiveSet(Name) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_AreaName.MatchesNegativeSet(Name) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove fields from the DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fields">List of Fields to remove</param>
|
||||||
|
public override void RemoveFields(List<Field> fields)
|
||||||
|
{
|
||||||
|
// Remove common fields first
|
||||||
|
base.RemoveFields(fields);
|
||||||
|
|
||||||
|
// Remove the fields
|
||||||
|
if (fields.Contains(Field.DatItem_AreaName))
|
||||||
|
Name = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set internal names to match One Rom Per Game (ORPG) logic
|
||||||
|
/// </summary>
|
||||||
|
public override void SetOneRomPerGame()
|
||||||
|
{
|
||||||
|
string[] splitname = Name.Split('.');
|
||||||
|
Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}";
|
||||||
|
Name = Path.GetFileName(Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sorting and Merging
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replace fields from another item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">DatItem to pull new information from</param>
|
||||||
|
/// <param name="fields">List of Fields representing what should be updated</param>
|
||||||
|
public override void ReplaceFields(DatItem item, List<Field> fields)
|
||||||
|
{
|
||||||
|
// Replace common fields first
|
||||||
|
base.ReplaceFields(item, fields);
|
||||||
|
|
||||||
|
// If we don't have a DiskArea to replace from, ignore specific fields
|
||||||
|
if (item.ItemType != ItemType.DiskArea)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Cast for easier access
|
||||||
|
DiskArea newItem = item as DiskArea;
|
||||||
|
|
||||||
|
// Replace the fields
|
||||||
|
if (fields.Contains(Field.DatItem_AreaName))
|
||||||
|
Name = newItem.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -302,15 +302,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
DatItem_Boot,
|
DatItem_Boot,
|
||||||
|
|
||||||
// Rom (SoftwareList)
|
// Rom (SoftwareList)
|
||||||
DatItem_AreaName, // TODO: DataArea/DiskArea?
|
|
||||||
DatItem_AreaSize, // TODO: DataArea?
|
|
||||||
DatItem_AreaWidth, // TODO: DataArea?
|
|
||||||
DatItem_AreaEndianness, // TODO: DataArea?
|
|
||||||
DatItem_LoadFlag,
|
DatItem_LoadFlag,
|
||||||
DatItem_Part_Name, // TODO: Part?
|
|
||||||
DatItem_Part_Interface, // TODO: Part?
|
|
||||||
DatItem_Part_Feature_Name, // TODO: PartFeature?
|
|
||||||
DatItem_Part_Feature_Value, // TODO: PartFeature?
|
|
||||||
DatItem_Value,
|
DatItem_Value,
|
||||||
|
|
||||||
// Disk
|
// Disk
|
||||||
@@ -357,6 +349,12 @@ namespace SabreTools.Library.DatItems
|
|||||||
DatItem_Control_Ways2,
|
DatItem_Control_Ways2,
|
||||||
DatItem_Control_Ways3,
|
DatItem_Control_Ways3,
|
||||||
|
|
||||||
|
// DataArea
|
||||||
|
DatItem_AreaName,
|
||||||
|
DatItem_AreaSize,
|
||||||
|
DatItem_AreaWidth,
|
||||||
|
DatItem_AreaEndianness,
|
||||||
|
|
||||||
// Device
|
// Device
|
||||||
DatItem_DeviceType,
|
DatItem_DeviceType,
|
||||||
DatItem_FixedImage,
|
DatItem_FixedImage,
|
||||||
@@ -407,6 +405,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
DatItem_Location_Number,
|
DatItem_Location_Number,
|
||||||
DatItem_Location_Inverted,
|
DatItem_Location_Inverted,
|
||||||
|
|
||||||
|
// Part
|
||||||
|
DatItem_Part_Name,
|
||||||
|
DatItem_Part_Interface,
|
||||||
|
|
||||||
|
// PartFeature
|
||||||
|
DatItem_Part_Feature_Name,
|
||||||
|
DatItem_Part_Feature_Value,
|
||||||
|
|
||||||
// RamOption
|
// RamOption
|
||||||
DatItem_Content,
|
DatItem_Content,
|
||||||
|
|
||||||
@@ -474,9 +480,11 @@ namespace SabreTools.Library.DatItems
|
|||||||
Condition,
|
Condition,
|
||||||
Configuration,
|
Configuration,
|
||||||
Control,
|
Control,
|
||||||
|
DataArea,
|
||||||
Device,
|
Device,
|
||||||
DeviceReference,
|
DeviceReference,
|
||||||
DipSwitch,
|
DipSwitch,
|
||||||
|
DiskArea,
|
||||||
Display,
|
Display,
|
||||||
Driver,
|
Driver,
|
||||||
Extension,
|
Extension,
|
||||||
@@ -485,6 +493,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
Input,
|
Input,
|
||||||
Instance,
|
Instance,
|
||||||
Location,
|
Location,
|
||||||
|
Part,
|
||||||
PartFeature,
|
PartFeature,
|
||||||
Port,
|
Port,
|
||||||
RamOption,
|
RamOption,
|
||||||
|
|||||||
271
SabreTools.Library/DatItems/Part.cs
Normal file
271
SabreTools.Library/DatItems/Part.cs
Normal file
@@ -0,0 +1,271 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using SabreTools.Library.Filtering;
|
||||||
|
using SabreTools.Library.Tools;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace SabreTools.Library.DatItems
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SoftwareList part information
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>One Part can contain multiple PartFeature, DataArea, DiskArea, and DipSwitch items</remarks>
|
||||||
|
[JsonObject("part")]
|
||||||
|
public class Part : DatItem
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("interface")]
|
||||||
|
public string Interface { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("features", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
public List<PartFeature> Features { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Accessors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name to use for a DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Name if available, null otherwise</returns>
|
||||||
|
public override string GetName()
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set fields with given values
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mappings">Mappings dictionary</param>
|
||||||
|
public override void SetFields(Dictionary<Field, string> mappings)
|
||||||
|
{
|
||||||
|
// Set base fields
|
||||||
|
base.SetFields(mappings);
|
||||||
|
|
||||||
|
// Handle Part-specific fields
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Part_Name))
|
||||||
|
Name = mappings[Field.DatItem_Part_Name];
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_Part_Interface))
|
||||||
|
Interface = mappings[Field.DatItem_Part_Interface];
|
||||||
|
|
||||||
|
// Handle Feature-specific fields
|
||||||
|
if (Features != null)
|
||||||
|
{
|
||||||
|
foreach (PartFeature partFeature in Features)
|
||||||
|
{
|
||||||
|
partFeature.SetFields(mappings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a default, empty Part object
|
||||||
|
/// </summary>
|
||||||
|
public Part()
|
||||||
|
{
|
||||||
|
Name = string.Empty;
|
||||||
|
ItemType = ItemType.Part;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Cloning Methods
|
||||||
|
|
||||||
|
public override object Clone()
|
||||||
|
{
|
||||||
|
return new Part()
|
||||||
|
{
|
||||||
|
ItemType = this.ItemType,
|
||||||
|
DupeType = this.DupeType,
|
||||||
|
|
||||||
|
Machine = this.Machine.Clone() as Machine,
|
||||||
|
Source = this.Source.Clone() as Source,
|
||||||
|
Remove = this.Remove,
|
||||||
|
|
||||||
|
Name = this.Name,
|
||||||
|
Interface = this.Interface,
|
||||||
|
Features = this.Features,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Comparision Methods
|
||||||
|
|
||||||
|
public override bool Equals(DatItem other)
|
||||||
|
{
|
||||||
|
// If we don't have a Part, return false
|
||||||
|
if (ItemType != other.ItemType)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Otherwise, treat it as a Part
|
||||||
|
Part newOther = other as Part;
|
||||||
|
|
||||||
|
// If the Part information matches
|
||||||
|
bool match = (Name == newOther.Name
|
||||||
|
&& Interface == newOther.Interface);
|
||||||
|
if (!match)
|
||||||
|
return match;
|
||||||
|
|
||||||
|
// If the features match
|
||||||
|
if (Features != null)
|
||||||
|
{
|
||||||
|
foreach (PartFeature partFeature in Features)
|
||||||
|
{
|
||||||
|
match &= newOther.Features.Contains(partFeature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Filtering
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean a DatItem according to the cleaner
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cleaner">Cleaner to implement</param>
|
||||||
|
public override void Clean(Cleaner cleaner)
|
||||||
|
{
|
||||||
|
// Clean common items first
|
||||||
|
base.Clean(cleaner);
|
||||||
|
|
||||||
|
// If we're stripping unicode characters, strip item name
|
||||||
|
if (cleaner?.RemoveUnicode == true)
|
||||||
|
Name = Sanitizer.RemoveUnicodeCharacters(Name);
|
||||||
|
|
||||||
|
// If we are in NTFS trim mode, trim the game name
|
||||||
|
if (cleaner?.Trim == true)
|
||||||
|
{
|
||||||
|
// Windows max name length is 260
|
||||||
|
int usableLength = 260 - Machine.Name.Length - (cleaner.Root?.Length ?? 0);
|
||||||
|
if (Name.Length > usableLength)
|
||||||
|
{
|
||||||
|
string ext = Path.GetExtension(Name);
|
||||||
|
Name = Name.Substring(0, usableLength - ext.Length);
|
||||||
|
Name += ext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check to see if a DatItem passes the filter
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">Filter to check against</param>
|
||||||
|
/// <returns>True if the item passed the filter, false otherwise</returns>
|
||||||
|
public override bool PassesFilter(Filter filter)
|
||||||
|
{
|
||||||
|
// Check common fields first
|
||||||
|
if (!base.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on part name
|
||||||
|
if (filter.DatItem_Part_Name.MatchesPositiveSet(Name) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_Part_Name.MatchesNegativeSet(Name) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on part interface
|
||||||
|
if (filter.DatItem_Part_Interface.MatchesPositiveSet(Interface) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_Part_Interface.MatchesNegativeSet(Interface) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on features
|
||||||
|
if (Features != null)
|
||||||
|
{
|
||||||
|
foreach (PartFeature partFeature in Features)
|
||||||
|
{
|
||||||
|
if (!partFeature.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove fields from the DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fields">List of Fields to remove</param>
|
||||||
|
public override void RemoveFields(List<Field> fields)
|
||||||
|
{
|
||||||
|
// Remove common fields first
|
||||||
|
base.RemoveFields(fields);
|
||||||
|
|
||||||
|
// Remove the fields
|
||||||
|
if (fields.Contains(Field.DatItem_Part_Name))
|
||||||
|
Name = null;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Part_Interface))
|
||||||
|
Interface = null;
|
||||||
|
|
||||||
|
if (Features != null)
|
||||||
|
{
|
||||||
|
foreach (PartFeature partFeature in Features)
|
||||||
|
{
|
||||||
|
partFeature.RemoveFields(fields);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set internal names to match One Rom Per Game (ORPG) logic
|
||||||
|
/// </summary>
|
||||||
|
public override void SetOneRomPerGame()
|
||||||
|
{
|
||||||
|
string[] splitname = Name.Split('.');
|
||||||
|
Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}";
|
||||||
|
Name = Path.GetFileName(Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sorting and Merging
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replace fields from another item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">DatItem to pull new information from</param>
|
||||||
|
/// <param name="fields">List of Fields representing what should be updated</param>
|
||||||
|
public override void ReplaceFields(DatItem item, List<Field> fields)
|
||||||
|
{
|
||||||
|
// Replace common fields first
|
||||||
|
base.ReplaceFields(item, fields);
|
||||||
|
|
||||||
|
// If we don't have a Part to replace from, ignore specific fields
|
||||||
|
if (item.ItemType != ItemType.Part)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Cast for easier access
|
||||||
|
Part newItem = item as Part;
|
||||||
|
|
||||||
|
// Replace the fields
|
||||||
|
if (fields.Contains(Field.DatItem_Part_Name))
|
||||||
|
Name = newItem.Name;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_Part_Interface))
|
||||||
|
Interface = newItem.Interface;
|
||||||
|
|
||||||
|
// DatItem_Part_Feature_* doesn't make sense here
|
||||||
|
// since not every part feature under the other item
|
||||||
|
// can replace every part feature under this item
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,11 +51,11 @@ namespace SabreTools.Library.DatItems
|
|||||||
base.SetFields(mappings);
|
base.SetFields(mappings);
|
||||||
|
|
||||||
// Handle PartFeature-specific fields
|
// Handle PartFeature-specific fields
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Name))
|
if (mappings.Keys.Contains(Field.DatItem_Part_Feature_Name))
|
||||||
Name = mappings[Field.DatItem_Name];
|
Name = mappings[Field.DatItem_Part_Feature_Name];
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Value))
|
if (mappings.Keys.Contains(Field.DatItem_Part_Feature_Value))
|
||||||
Value = mappings[Field.DatItem_Value];
|
Value = mappings[Field.DatItem_Part_Feature_Value];
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -151,15 +151,15 @@ namespace SabreTools.Library.DatItems
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Filter on item name
|
// Filter on item name
|
||||||
if (filter.DatItem_Name.MatchesPositiveSet(Name) == false)
|
if (filter.DatItem_Part_Feature_Name.MatchesPositiveSet(Name) == false)
|
||||||
return false;
|
return false;
|
||||||
if (filter.DatItem_Name.MatchesNegativeSet(Name) == true)
|
if (filter.DatItem_Part_Feature_Name.MatchesNegativeSet(Name) == true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Filter on info value
|
// Filter on info value
|
||||||
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
|
if (filter.DatItem_Part_Feature_Value.MatchesPositiveSet(Value) == false)
|
||||||
return false;
|
return false;
|
||||||
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
|
if (filter.DatItem_Part_Feature_Value.MatchesNegativeSet(Value) == true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -175,10 +175,10 @@ namespace SabreTools.Library.DatItems
|
|||||||
base.RemoveFields(fields);
|
base.RemoveFields(fields);
|
||||||
|
|
||||||
// Remove the fields
|
// Remove the fields
|
||||||
if (fields.Contains(Field.DatItem_Name))
|
if (fields.Contains(Field.DatItem_Part_Feature_Name))
|
||||||
Name = null;
|
Name = null;
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Value))
|
if (fields.Contains(Field.DatItem_Part_Feature_Value))
|
||||||
Value = null;
|
Value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,10 +214,10 @@ namespace SabreTools.Library.DatItems
|
|||||||
PartFeature newItem = item as PartFeature;
|
PartFeature newItem = item as PartFeature;
|
||||||
|
|
||||||
// Replace the fields
|
// Replace the fields
|
||||||
if (fields.Contains(Field.DatItem_Name))
|
if (fields.Contains(Field.DatItem_Part_Feature_Name))
|
||||||
Name = newItem.Name;
|
Name = newItem.Name;
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Value))
|
if (fields.Contains(Field.DatItem_Part_Feature_Value))
|
||||||
Value = newItem.Value;
|
Value = newItem.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -368,64 +368,24 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_AreaName))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
DataArea.Name = mappings[Field.DatItem_AreaName];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_AreaSize))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
if (Int64.TryParse(mappings[Field.DatItem_AreaSize], out long areaSize))
|
|
||||||
DataArea.Size = areaSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_AreaWidth))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
if (Int64.TryParse(mappings[Field.DatItem_AreaWidth], out long areaWidth))
|
|
||||||
DataArea.Width = areaWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_AreaEndianness))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
DataArea.Endianness = mappings[Field.DatItem_AreaEndianness].AsEndianness();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_LoadFlag))
|
if (mappings.Keys.Contains(Field.DatItem_LoadFlag))
|
||||||
LoadFlag = mappings[Field.DatItem_LoadFlag].AsLoadFlag();
|
LoadFlag = mappings[Field.DatItem_LoadFlag].AsLoadFlag();
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Part_Name))
|
|
||||||
{
|
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Name = mappings[Field.DatItem_Part_Name];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Part_Interface))
|
|
||||||
{
|
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Interface = mappings[Field.DatItem_Part_Interface];
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
if (mappings.Keys.Contains(Field.DatItem_Value))
|
if (mappings.Keys.Contains(Field.DatItem_Value))
|
||||||
Value = mappings[Field.DatItem_Value];
|
Value = mappings[Field.DatItem_Value];
|
||||||
|
|
||||||
|
// Handle DataArea-specific fields
|
||||||
|
if (DataArea == null)
|
||||||
|
DataArea = new DataArea();
|
||||||
|
|
||||||
|
DataArea.SetFields(mappings);
|
||||||
|
|
||||||
|
// Handle Part-specific fields
|
||||||
|
if (Part == null)
|
||||||
|
Part = new Part();
|
||||||
|
|
||||||
|
Part.SetFields(mappings);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -894,57 +854,31 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
// Filter on area name
|
|
||||||
if (filter.DatItem_AreaName.MatchesPositiveSet(DataArea?.Name) == false)
|
|
||||||
return false;
|
|
||||||
if (filter.DatItem_AreaName.MatchesNegativeSet(DataArea?.Name) == true)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Filter on area size
|
|
||||||
if (filter.DatItem_AreaSize.MatchesNeutral(null, DataArea?.Size) == false)
|
|
||||||
return false;
|
|
||||||
else if (filter.DatItem_AreaSize.MatchesPositive(null, DataArea?.Size) == false)
|
|
||||||
return false;
|
|
||||||
else if (filter.DatItem_AreaSize.MatchesNegative(null, DataArea?.Size) == false)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Filter on area byte width
|
|
||||||
if (filter.DatItem_AreaWidth.MatchesPositive(null, DataArea?.Width) == false)
|
|
||||||
return false;
|
|
||||||
if (filter.DatItem_AreaWidth.MatchesNegative(null, DataArea?.Width) == true)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Filter on area endianness
|
|
||||||
if (filter.DatItem_AreaEndianness.MatchesPositive(Endianness.NULL, DataArea?.Endianness ?? Endianness.NULL) == false)
|
|
||||||
return false;
|
|
||||||
if (filter.DatItem_AreaEndianness.MatchesNegative(Endianness.NULL, DataArea?.Endianness ?? Endianness.NULL) == true)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Filter on load flag
|
// Filter on load flag
|
||||||
if (filter.DatItem_LoadFlag.MatchesPositive(LoadFlag.NULL, LoadFlag) == false)
|
if (filter.DatItem_LoadFlag.MatchesPositive(LoadFlag.NULL, LoadFlag) == false)
|
||||||
return false;
|
return false;
|
||||||
if (filter.DatItem_LoadFlag.MatchesNegative(LoadFlag.NULL, LoadFlag) == true)
|
if (filter.DatItem_LoadFlag.MatchesNegative(LoadFlag.NULL, LoadFlag) == true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Filter on part name
|
|
||||||
if (filter.DatItem_Part_Name.MatchesPositiveSet(Part?.Name) == false)
|
|
||||||
return false;
|
|
||||||
if (filter.DatItem_Part_Name.MatchesNegativeSet(Part?.Name) == true)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Filter on part interface
|
|
||||||
if (filter.DatItem_Part_Interface.MatchesPositiveSet(Part?.Interface) == false)
|
|
||||||
return false;
|
|
||||||
if (filter.DatItem_Part_Interface.MatchesNegativeSet(Part?.Interface) == true)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Filter on value
|
// Filter on value
|
||||||
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
|
if (filter.DatItem_Value.MatchesPositiveSet(Value) == false)
|
||||||
return false;
|
return false;
|
||||||
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
|
if (filter.DatItem_Value.MatchesNegativeSet(Value) == true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
// Filter on DataArea
|
||||||
|
if (DataArea != null)
|
||||||
|
{
|
||||||
|
if (!DataArea.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter on Part
|
||||||
|
if (Part != null)
|
||||||
|
{
|
||||||
|
if (!Part.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -1050,44 +984,18 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaName))
|
|
||||||
{
|
|
||||||
if (DataArea != null)
|
|
||||||
DataArea.Name = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaSize))
|
|
||||||
{
|
|
||||||
if (DataArea != null)
|
|
||||||
DataArea.Size = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaWidth))
|
|
||||||
{
|
|
||||||
if (DataArea != null)
|
|
||||||
DataArea.Width = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaEndianness))
|
|
||||||
{
|
|
||||||
if (DataArea != null)
|
|
||||||
DataArea.Endianness = Endianness.NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_LoadFlag))
|
if (fields.Contains(Field.DatItem_LoadFlag))
|
||||||
LoadFlag = LoadFlag.NULL;
|
LoadFlag = LoadFlag.NULL;
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Name) && Part != null)
|
|
||||||
Part.Name = null;
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Interface) && Part != null)
|
|
||||||
Part.Interface = null;
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Value))
|
if (fields.Contains(Field.DatItem_Value))
|
||||||
Value = null;
|
Value = null;
|
||||||
|
|
||||||
|
if (DataArea != null)
|
||||||
|
DataArea.RemoveFields(fields);
|
||||||
|
|
||||||
|
if (Part != null)
|
||||||
|
Part.RemoveFields(fields);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1290,58 +1198,17 @@ namespace SabreTools.Library.DatItems
|
|||||||
|
|
||||||
#region SoftwareList
|
#region SoftwareList
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaName))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
DataArea.Name = newItem.DataArea?.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaSize))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
DataArea.Size = newItem.DataArea?.Size;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaWidth))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
DataArea.Width = newItem.DataArea?.Width;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_AreaEndianness))
|
|
||||||
{
|
|
||||||
if (DataArea == null)
|
|
||||||
DataArea = new DataArea();
|
|
||||||
|
|
||||||
DataArea.Endianness = newItem.DataArea?.Endianness ?? Endianness.NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_LoadFlag))
|
if (fields.Contains(Field.DatItem_LoadFlag))
|
||||||
LoadFlag = newItem.LoadFlag;
|
LoadFlag = newItem.LoadFlag;
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Name))
|
if (fields.Contains(Field.DatItem_Value))
|
||||||
{
|
Value = newItem.Value;
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Name = newItem.Part?.Name;
|
if (DataArea != null && newItem.DataArea != null)
|
||||||
}
|
DataArea.ReplaceFields(newItem.DataArea, fields);
|
||||||
|
|
||||||
if (fields.Contains(Field.DatItem_Part_Interface))
|
if (Part != null && newItem.Part != null)
|
||||||
{
|
Part.ReplaceFields(newItem.Part, fields);
|
||||||
if (Part == null)
|
|
||||||
Part = new Part();
|
|
||||||
|
|
||||||
Part.Interface = newItem.Part?.Interface;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Handle DatItem_Part_Feature*
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,15 +134,7 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<string> DatItem_Boot { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Boot { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
// Rom (SoftwareList)
|
// Rom (SoftwareList)
|
||||||
public FilterItem<string> DatItem_AreaName { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<long?> DatItem_AreaSize { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
|
||||||
public FilterItem<long?> DatItem_AreaWidth { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
|
||||||
public FilterItem<Endianness> DatItem_AreaEndianness { get; private set; } = new FilterItem<Endianness>() { Positive = Endianness.NULL, Negative = Endianness.NULL };
|
|
||||||
public FilterItem<LoadFlag> DatItem_LoadFlag { get; private set; } = new FilterItem<LoadFlag>() { Positive = LoadFlag.NULL, Negative = LoadFlag.NULL };
|
public FilterItem<LoadFlag> DatItem_LoadFlag { get; private set; } = new FilterItem<LoadFlag>() { Positive = LoadFlag.NULL, Negative = LoadFlag.NULL };
|
||||||
public FilterItem<string> DatItem_Part_Name { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> DatItem_Part_Interface { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> DatItem_Part_Feature_Name { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> DatItem_Part_Feature_Value { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> DatItem_Value { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Value { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
// Disk
|
// Disk
|
||||||
@@ -189,6 +181,12 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<string> DatItem_Control_Ways2 { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Control_Ways2 { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<string> DatItem_Control_Ways3 { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Control_Ways3 { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
|
// DataArea
|
||||||
|
public FilterItem<string> DatItem_AreaName { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<long?> DatItem_AreaSize { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||||
|
public FilterItem<long?> DatItem_AreaWidth { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||||
|
public FilterItem<Endianness> DatItem_AreaEndianness { get; private set; } = new FilterItem<Endianness>() { Positive = Endianness.NULL, Negative = Endianness.NULL };
|
||||||
|
|
||||||
// Device
|
// Device
|
||||||
public FilterItem<string> DatItem_DeviceType { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_DeviceType { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<string> DatItem_FixedImage { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_FixedImage { get; private set; } = new FilterItem<string>();
|
||||||
@@ -239,6 +237,14 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<string> DatItem_Location_Number { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Location_Number { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<bool?> DatItem_Location_Inverted { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
public FilterItem<bool?> DatItem_Location_Inverted { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
|
||||||
|
// Part
|
||||||
|
public FilterItem<string> DatItem_Part_Name { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Part_Interface { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
|
// PartFeature
|
||||||
|
public FilterItem<string> DatItem_Part_Feature_Name { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> DatItem_Part_Feature_Value { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
// RamOption
|
// RamOption
|
||||||
public FilterItem<string> DatItem_Content { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Content { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
@@ -643,25 +649,6 @@ namespace SabreTools.Library.Filtering
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// Rom (SoftwareList)
|
// Rom (SoftwareList)
|
||||||
case Field.DatItem_AreaName:
|
|
||||||
SetStringFilter(DatItem_AreaName, value, negate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_AreaSize:
|
|
||||||
SetOptionalLongFilter(DatItem_AreaSize, value, negate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_AreaWidth:
|
|
||||||
SetOptionalLongFilter(DatItem_AreaWidth, value, negate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_AreaEndianness:
|
|
||||||
if (negate)
|
|
||||||
DatItem_AreaEndianness.Negative |= value.AsEndianness();
|
|
||||||
else
|
|
||||||
DatItem_AreaEndianness.Positive |= value.AsEndianness();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_LoadFlag:
|
case Field.DatItem_LoadFlag:
|
||||||
if (negate)
|
if (negate)
|
||||||
DatItem_LoadFlag.Negative |= value.AsLoadFlag();
|
DatItem_LoadFlag.Negative |= value.AsLoadFlag();
|
||||||
@@ -669,22 +656,6 @@ namespace SabreTools.Library.Filtering
|
|||||||
DatItem_LoadFlag.Positive |= value.AsLoadFlag();
|
DatItem_LoadFlag.Positive |= value.AsLoadFlag();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Field.DatItem_Part_Name:
|
|
||||||
SetStringFilter(DatItem_Part_Name, value, negate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_Part_Interface:
|
|
||||||
SetStringFilter(DatItem_Part_Interface, value, negate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_Part_Feature_Name:
|
|
||||||
SetStringFilter(DatItem_Part_Feature_Name, value, negate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_Part_Feature_Value:
|
|
||||||
SetStringFilter(DatItem_Part_Feature_Value, value, negate);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.DatItem_Value:
|
case Field.DatItem_Value:
|
||||||
SetStringFilter(DatItem_Value, value, negate);
|
SetStringFilter(DatItem_Value, value, negate);
|
||||||
break;
|
break;
|
||||||
@@ -813,6 +784,26 @@ namespace SabreTools.Library.Filtering
|
|||||||
SetStringFilter(DatItem_Control_Ways3, value, negate);
|
SetStringFilter(DatItem_Control_Ways3, value, negate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// DataArea
|
||||||
|
case Field.DatItem_AreaName:
|
||||||
|
SetStringFilter(DatItem_AreaName, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_AreaSize:
|
||||||
|
SetOptionalLongFilter(DatItem_AreaSize, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_AreaWidth:
|
||||||
|
SetOptionalLongFilter(DatItem_AreaWidth, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_AreaEndianness:
|
||||||
|
if (negate)
|
||||||
|
DatItem_AreaEndianness.Negative |= value.AsEndianness();
|
||||||
|
else
|
||||||
|
DatItem_AreaEndianness.Positive |= value.AsEndianness();
|
||||||
|
break;
|
||||||
|
|
||||||
// Device
|
// Device
|
||||||
case Field.DatItem_DeviceType:
|
case Field.DatItem_DeviceType:
|
||||||
SetStringFilter(DatItem_DeviceType, value, negate);
|
SetStringFilter(DatItem_DeviceType, value, negate);
|
||||||
@@ -981,6 +972,24 @@ namespace SabreTools.Library.Filtering
|
|||||||
SetBooleanFilter(DatItem_Location_Inverted, value, negate);
|
SetBooleanFilter(DatItem_Location_Inverted, value, negate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Part
|
||||||
|
case Field.DatItem_Part_Name:
|
||||||
|
SetStringFilter(DatItem_Part_Name, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Part_Interface:
|
||||||
|
SetStringFilter(DatItem_Part_Interface, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
// PartFeature
|
||||||
|
case Field.DatItem_Part_Feature_Name:
|
||||||
|
SetStringFilter(DatItem_Part_Feature_Name, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_Part_Feature_Value:
|
||||||
|
SetStringFilter(DatItem_Part_Feature_Value, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
// RamOption
|
// RamOption
|
||||||
case Field.DatItem_Content:
|
case Field.DatItem_Content:
|
||||||
SetStringFilter(DatItem_Content, value, negate);
|
SetStringFilter(DatItem_Content, value, negate);
|
||||||
|
|||||||
@@ -1635,6 +1635,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return ItemType.Configuration;
|
return ItemType.Configuration;
|
||||||
case "control":
|
case "control":
|
||||||
return ItemType.Control;
|
return ItemType.Control;
|
||||||
|
case "dataarea":
|
||||||
|
return ItemType.DataArea;
|
||||||
case "device":
|
case "device":
|
||||||
return ItemType.Device;
|
return ItemType.Device;
|
||||||
case "device_ref":
|
case "device_ref":
|
||||||
@@ -1643,6 +1645,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return ItemType.DipSwitch;
|
return ItemType.DipSwitch;
|
||||||
case "disk":
|
case "disk":
|
||||||
return ItemType.Disk;
|
return ItemType.Disk;
|
||||||
|
case "diskarea":
|
||||||
|
return ItemType.DiskArea;
|
||||||
case "display":
|
case "display":
|
||||||
return ItemType.Display;
|
return ItemType.Display;
|
||||||
case "driver":
|
case "driver":
|
||||||
@@ -1661,6 +1665,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return ItemType.Location;
|
return ItemType.Location;
|
||||||
case "media":
|
case "media":
|
||||||
return ItemType.Media;
|
return ItemType.Media;
|
||||||
|
case "part":
|
||||||
|
return ItemType.Part;
|
||||||
case "partfeature":
|
case "partfeature":
|
||||||
case "part_feature":
|
case "part_feature":
|
||||||
return ItemType.PartFeature;
|
return ItemType.PartFeature;
|
||||||
@@ -1701,10 +1707,12 @@ namespace SabreTools.Library.Tools
|
|||||||
"condition" => ItemType.Condition,
|
"condition" => ItemType.Condition,
|
||||||
"configuration" => ItemType.Configuration,
|
"configuration" => ItemType.Configuration,
|
||||||
"control" => ItemType.Control,
|
"control" => ItemType.Control,
|
||||||
|
"dataarea" => ItemType.DataArea,
|
||||||
"device" => ItemType.Device,
|
"device" => ItemType.Device,
|
||||||
"device_ref" => ItemType.DeviceReference,
|
"device_ref" => ItemType.DeviceReference,
|
||||||
"dipswitch" => ItemType.DipSwitch,
|
"dipswitch" => ItemType.DipSwitch,
|
||||||
"disk" => ItemType.Disk,
|
"disk" => ItemType.Disk,
|
||||||
|
"diskarea" => ItemType.DiskArea,
|
||||||
"display" => ItemType.Display,
|
"display" => ItemType.Display,
|
||||||
"driver" => ItemType.Driver,
|
"driver" => ItemType.Driver,
|
||||||
"extension" => ItemType.Extension,
|
"extension" => ItemType.Extension,
|
||||||
@@ -1714,6 +1722,7 @@ namespace SabreTools.Library.Tools
|
|||||||
"instance" => ItemType.Instance,
|
"instance" => ItemType.Instance,
|
||||||
"location" => ItemType.Location,
|
"location" => ItemType.Location,
|
||||||
"media" => ItemType.Media,
|
"media" => ItemType.Media,
|
||||||
|
"part" => ItemType.Part,
|
||||||
"partfeature" => ItemType.PartFeature,
|
"partfeature" => ItemType.PartFeature,
|
||||||
"part_feature" => ItemType.PartFeature,
|
"part_feature" => ItemType.PartFeature,
|
||||||
"port" => ItemType.Port,
|
"port" => ItemType.Port,
|
||||||
@@ -2515,6 +2524,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return "configuration";
|
return "configuration";
|
||||||
case ItemType.Control:
|
case ItemType.Control:
|
||||||
return "control";
|
return "control";
|
||||||
|
case ItemType.DataArea:
|
||||||
|
return "dataarea";
|
||||||
case ItemType.Device:
|
case ItemType.Device:
|
||||||
return "device";
|
return "device";
|
||||||
case ItemType.DeviceReference:
|
case ItemType.DeviceReference:
|
||||||
@@ -2523,6 +2534,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return "dipswitch";
|
return "dipswitch";
|
||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
return "disk";
|
return "disk";
|
||||||
|
case ItemType.DiskArea:
|
||||||
|
return "diskarea";
|
||||||
case ItemType.Display:
|
case ItemType.Display:
|
||||||
return "display";
|
return "display";
|
||||||
case ItemType.Driver:
|
case ItemType.Driver:
|
||||||
@@ -2541,6 +2554,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return "location";
|
return "location";
|
||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
return "media";
|
return "media";
|
||||||
|
case ItemType.Part:
|
||||||
|
return "part";
|
||||||
case ItemType.PartFeature:
|
case ItemType.PartFeature:
|
||||||
return "part_feature";
|
return "part_feature";
|
||||||
case ItemType.Port:
|
case ItemType.Port:
|
||||||
@@ -2580,10 +2595,12 @@ namespace SabreTools.Library.Tools
|
|||||||
ItemType.Condition => "condition",
|
ItemType.Condition => "condition",
|
||||||
ItemType.Configuration => "configuration",
|
ItemType.Configuration => "configuration",
|
||||||
ItemType.Control => "control",
|
ItemType.Control => "control",
|
||||||
|
ItemType.DataArea => "dataarea",
|
||||||
ItemType.Device => "device",
|
ItemType.Device => "device",
|
||||||
ItemType.DeviceReference => "device_ref",
|
ItemType.DeviceReference => "device_ref",
|
||||||
ItemType.DipSwitch => "dipswitch",
|
ItemType.DipSwitch => "dipswitch",
|
||||||
ItemType.Disk => "disk",
|
ItemType.Disk => "disk",
|
||||||
|
ItemType.DiskArea => "diskarea",
|
||||||
ItemType.Display => "display",
|
ItemType.Display => "display",
|
||||||
ItemType.Driver => "driver",
|
ItemType.Driver => "driver",
|
||||||
ItemType.Extension => "extension",
|
ItemType.Extension => "extension",
|
||||||
@@ -2593,6 +2610,7 @@ namespace SabreTools.Library.Tools
|
|||||||
ItemType.Instance => "instance",
|
ItemType.Instance => "instance",
|
||||||
ItemType.Location => "location",
|
ItemType.Location => "location",
|
||||||
ItemType.Media => "media",
|
ItemType.Media => "media",
|
||||||
|
ItemType.Part => "part",
|
||||||
ItemType.PartFeature => "part_feature",
|
ItemType.PartFeature => "part_feature",
|
||||||
ItemType.Port => "port",
|
ItemType.Port => "port",
|
||||||
ItemType.RamOption => "ramoption",
|
ItemType.RamOption => "ramoption",
|
||||||
|
|||||||
Reference in New Issue
Block a user