diff --git a/SabreTools.Library/DatFiles/ClrMamePro.cs b/SabreTools.Library/DatFiles/ClrMamePro.cs
index 8df772f0..daec763e 100644
--- a/SabreTools.Library/DatFiles/ClrMamePro.cs
+++ b/SabreTools.Library/DatFiles/ClrMamePro.cs
@@ -616,12 +616,6 @@ namespace SabreTools.Library.DatFiles
cmpw.WriteEndElement();
break;
- case ItemType.DeviceReference:
- cmpw.WriteStartElement("device_ref");
- cmpw.WriteRequiredAttributeString("name", datItem.Name);
- cmpw.WriteEndElement();
- break;
-
case ItemType.Disk:
var disk = datItem as Disk;
cmpw.WriteStartElement("disk");
diff --git a/SabreTools.Library/DatFiles/ItemDictionary.cs b/SabreTools.Library/DatFiles/ItemDictionary.cs
index a1204992..c25ea657 100644
--- a/SabreTools.Library/DatFiles/ItemDictionary.cs
+++ b/SabreTools.Library/DatFiles/ItemDictionary.cs
@@ -77,6 +77,12 @@ namespace SabreTools.Library.DatFiles
[JsonIgnore]
public long TotalCount { get; private set; } = 0;
+ ///
+ /// Number of Adjuster items
+ ///
+ [JsonIgnore]
+ public long AdjusterCount { get; private set; } = 0;
+
///
/// Number of Archive items
///
@@ -113,6 +119,12 @@ namespace SabreTools.Library.DatFiles
[JsonIgnore]
public long MediaCount { get; private set; } = 0;
+ ///
+ /// Number of RamOption items
+ ///
+ [JsonIgnore]
+ public long RamOptionCount { get; private set; } = 0;
+
///
/// Number of Release items
///
@@ -464,6 +476,9 @@ namespace SabreTools.Library.DatFiles
// Now we do different things for each item type
switch (item.ItemType)
{
+ case ItemType.Adjuster:
+ AdjusterCount++;
+ break;
case ItemType.Archive:
ArchiveCount++;
break;
@@ -495,6 +510,9 @@ namespace SabreTools.Library.DatFiles
SHA1Count += (string.IsNullOrWhiteSpace((item as Media).SHA1) ? 0 : 1);
SHA256Count += (string.IsNullOrWhiteSpace((item as Media).SHA256) ? 0 : 1);
break;
+ case ItemType.RamOption:
+ RamOptionCount++;
+ break;
case ItemType.Release:
ReleaseCount++;
break;
@@ -599,6 +617,9 @@ namespace SabreTools.Library.DatFiles
// Now we do different things for each item type
switch (item.ItemType)
{
+ case ItemType.Adjuster:
+ AdjusterCount--;
+ break;
case ItemType.Archive:
ArchiveCount--;
break;
@@ -630,6 +651,9 @@ namespace SabreTools.Library.DatFiles
SHA1Count -= (string.IsNullOrWhiteSpace((item as Media).SHA1) ? 0 : 1);
SHA256Count -= (string.IsNullOrWhiteSpace((item as Media).SHA256) ? 0 : 1);
break;
+ case ItemType.RamOption:
+ RamOptionCount--;
+ break;
case ItemType.Release:
ReleaseCount--;
break;
diff --git a/SabreTools.Library/DatFiles/Json.cs b/SabreTools.Library/DatFiles/Json.cs
index 99ac0341..63eae6b6 100644
--- a/SabreTools.Library/DatFiles/Json.cs
+++ b/SabreTools.Library/DatFiles/Json.cs
@@ -208,6 +208,9 @@ namespace SabreTools.Library.DatFiles
JToken datItemObj = itemObj["datitem"];
switch (datItemObj.Value("type").AsItemType())
{
+ case ItemType.Adjuster:
+ datItem = datItemObj.ToObject();
+ break;
case ItemType.Archive:
datItem = datItemObj.ToObject();
break;
@@ -229,6 +232,9 @@ namespace SabreTools.Library.DatFiles
case ItemType.Media:
datItem = datItemObj.ToObject();
break;
+ case ItemType.RamOption:
+ datItem = datItemObj.ToObject();
+ break;
case ItemType.Release:
datItem = datItemObj.ToObject();
break;
diff --git a/SabreTools.Library/DatFiles/Listxml.cs b/SabreTools.Library/DatFiles/Listxml.cs
index 69cb3b78..75468f09 100644
--- a/SabreTools.Library/DatFiles/Listxml.cs
+++ b/SabreTools.Library/DatFiles/Listxml.cs
@@ -166,6 +166,23 @@ namespace SabreTools.Library.DatFiles
machine.Manufacturer = reader.ReadElementContentAsString();
break;
+ case "adjuster":
+ var adjuster = new Adjuster
+ {
+ Name = reader.GetAttribute("name"),
+ Default = reader.GetAttribute("default").AsYesNo(),
+ Conditions = new List(),
+ };
+
+ // Now read the internal tags
+ ReadAdjuster(reader.ReadSubtree(), adjuster);
+
+ datItems.Add(adjuster);
+
+ // Skip the adjuster now that we've processed it
+ reader.Skip();
+ break;
+
case "biosset":
datItems.Add(new BiosSet
{
@@ -183,84 +200,6 @@ namespace SabreTools.Library.DatFiles
reader.Read();
break;
- case "rom":
- datItems.Add(new Rom
- {
- Name = reader.GetAttribute("name"),
- Bios = reader.GetAttribute("bios"),
- Size = Sanitizer.CleanSize(reader.GetAttribute("size")),
- CRC = reader.GetAttribute("crc"),
- MD5 = reader.GetAttribute("md5"),
-#if NET_FRAMEWORK
- RIPEMD160 = reader.GetAttribute("ripemd160"),
-#endif
- SHA1 = reader.GetAttribute("sha1"),
- SHA256 = reader.GetAttribute("sha256"),
- SHA384 = reader.GetAttribute("sha384"),
- SHA512 = reader.GetAttribute("sha512"),
- MergeTag = reader.GetAttribute("merge"),
- Region = reader.GetAttribute("region"),
- Offset = reader.GetAttribute("offset"),
- ItemStatus = reader.GetAttribute("status").AsItemStatus(),
- Optional = reader.GetAttribute("optional").AsYesNo(),
-
- Source = new Source
- {
- Index = indexId,
- Name = filename,
- },
- });
-
- reader.Read();
- break;
-
- case "disk":
- datItems.Add(new Disk
- {
- Name = reader.GetAttribute("name"),
- MD5 = reader.GetAttribute("md5"),
- SHA1 = reader.GetAttribute("sha1"),
- MergeTag = reader.GetAttribute("merge"),
- Region = reader.GetAttribute("region"),
- Index = reader.GetAttribute("index"),
- Writable = reader.GetAttribute("writable").AsYesNo(),
- ItemStatus = reader.GetAttribute("status").AsItemStatus(),
- Optional = reader.GetAttribute("optional").AsYesNo(),
-
- Source = new Source
- {
- Index = indexId,
- Name = filename,
- },
- });
-
- reader.Read();
- break;
-
- case "device_ref":
- datItems.Add(new DeviceReference
- {
- Name = reader.GetAttribute("name"),
- });
-
- reader.Read();
- break;
-
- case "sample":
- datItems.Add(new Sample
- {
- Name = reader.GetAttribute("name"),
-
- Source = new Source
- {
- Index = indexId,
- Name = filename,
- },
- });
-
- reader.Read();
- break;
-
case "chip":
datItems.Add(new Chip
{
@@ -279,6 +218,104 @@ namespace SabreTools.Library.DatFiles
reader.Read();
break;
+ case "device_ref":
+ datItems.Add(new DeviceReference
+ {
+ Name = reader.GetAttribute("name"),
+ });
+
+ reader.Read();
+ break;
+
+ case "disk":
+ datItems.Add(new Disk
+ {
+ Name = reader.GetAttribute("name"),
+ SHA1 = reader.GetAttribute("sha1"),
+ MergeTag = reader.GetAttribute("merge"),
+ Region = reader.GetAttribute("region"),
+ Index = reader.GetAttribute("index"),
+ Writable = reader.GetAttribute("writable").AsYesNo(),
+ ItemStatus = reader.GetAttribute("status").AsItemStatus(),
+ Optional = reader.GetAttribute("optional").AsYesNo(),
+
+ Source = new Source
+ {
+ Index = indexId,
+ Name = filename,
+ },
+ });
+
+ reader.Read();
+ break;
+
+ case "rom":
+ datItems.Add(new Rom
+ {
+ Name = reader.GetAttribute("name"),
+ Bios = reader.GetAttribute("bios"),
+ Size = Sanitizer.CleanSize(reader.GetAttribute("size")),
+ CRC = reader.GetAttribute("crc"),
+ SHA1 = reader.GetAttribute("sha1"),
+ MergeTag = reader.GetAttribute("merge"),
+ Region = reader.GetAttribute("region"),
+ Offset = reader.GetAttribute("offset"),
+ ItemStatus = reader.GetAttribute("status").AsItemStatus(),
+ Optional = reader.GetAttribute("optional").AsYesNo(),
+
+ Source = new Source
+ {
+ Index = indexId,
+ Name = filename,
+ },
+ });
+
+ reader.Read();
+ break;
+
+ case "ramoption":
+ datItems.Add(new RamOption
+ {
+ Name = reader.GetAttribute("name"),
+ Default = reader.GetAttribute("default").AsYesNo(),
+ Content = reader.ReadElementContentAsString(),
+ });
+
+ break;
+
+ case "sample":
+ datItems.Add(new Sample
+ {
+ Name = reader.GetAttribute("name"),
+
+ Source = new Source
+ {
+ Index = indexId,
+ Name = filename,
+ },
+ });
+
+ reader.Read();
+ break;
+
+ case "softwarelist":
+ datItems.Add(new DatItems.SoftwareList
+ {
+ Name = reader.GetAttribute("name"),
+ Status = reader.GetAttribute("status").AsSoftwareListStatus(),
+ Filter = reader.GetAttribute("filter"),
+
+ Source = new Source
+ {
+ Index = indexId,
+ Name = filename,
+ },
+ });
+
+ reader.Read();
+
+ break;
+
case "display":
var display = new ListXmlDisplay();
display.Tag = reader.GetAttribute("tag");
@@ -409,24 +446,6 @@ namespace SabreTools.Library.DatFiles
reader.Skip();
break;
- case "adjuster":
- var adjuster = new ListXmlAdjuster();
- adjuster.Name = reader.GetAttribute("name");
- adjuster.Default = reader.GetAttribute("default").AsYesNo();
-
- // Now read the internal tags
- ReadAdjuster(reader.ReadSubtree(), adjuster);
-
- // Ensure the list exists
- if (machine.Adjusters == null)
- machine.Adjusters = new List();
-
- machine.Adjusters.Add(adjuster);
-
- // Skip the adjuster now that we've processed it
- reader.Skip();
- break;
-
case "driver":
var driver = new ListXmlDriver();
driver.Status = reader.GetAttribute("status");
@@ -496,37 +515,6 @@ namespace SabreTools.Library.DatFiles
reader.Skip();
break;
- case "softwarelist":
- datItems.Add(new DatItems.SoftwareList
- {
- Name = reader.GetAttribute("name"),
- Status = reader.GetAttribute("status").AsSoftwareListStatus(),
- Filter = reader.GetAttribute("filter"),
-
- Source = new Source
- {
- Index = indexId,
- Name = filename,
- },
- });
-
- reader.Read();
-
- break;
-
- case "ramoption":
- var ramOption = new ListXmlRamOption();
- ramOption.Default = reader.GetAttribute("default").AsYesNo();
-
- // Ensure the list exists
- if (machine.RamOptions == null)
- machine.RamOptions = new List();
-
- machine.RamOptions.Add(ramOption);
-
- reader.Read();
- break;
-
default:
reader.Read();
break;
@@ -677,6 +665,7 @@ namespace SabreTools.Library.DatFiles
return;
// Get lists ready
+ dipSwitch.Conditions = new List();
dipSwitch.Locations = new List();
dipSwitch.Values = new List();
@@ -695,6 +684,18 @@ namespace SabreTools.Library.DatFiles
// Get the information from the dipswitch
switch (reader.Name)
{
+ case "condition":
+ var condition = new ListXmlCondition();
+ condition.Tag = reader.GetAttribute("tag");
+ condition.Mask = reader.GetAttribute("mask");
+ condition.Relation = reader.GetAttribute("relation");
+ condition.Value = reader.GetAttribute("value");
+
+ dipSwitch.Conditions.Add(condition);
+
+ reader.Read();
+ break;
+
case "diplocation":
var dipLocation = new ListXmlDipLocation();
dipLocation.Name = reader.GetAttribute("name");
@@ -712,8 +713,60 @@ namespace SabreTools.Library.DatFiles
dipValue.Value = reader.GetAttribute("value");
dipValue.Default = reader.GetAttribute("default").AsYesNo();
+ // Now read the internal tags
+ ReadDipValue(reader, dipValue);
+
dipSwitch.Values.Add(dipValue);
+ // Skip the dipvalue now that we've processed it
+ reader.Read();
+ break;
+
+ default:
+ reader.Read();
+ break;
+ }
+ }
+ }
+
+ ///
+ /// Read DipValue information
+ ///
+ /// XmlReader representing a diskarea block
+ /// ListXmlDipValue to populate
+ private void ReadDipValue(XmlReader reader, ListXmlDipValue dipValue)
+ {
+ // If we have an empty dipvalue, skip it
+ if (reader == null)
+ return;
+
+ // Get list ready
+ dipValue.Conditions = new List();
+
+ // Otherwise, add what is possible
+ reader.MoveToContent();
+
+ while (!reader.EOF)
+ {
+ // We only want elements
+ if (reader.NodeType != XmlNodeType.Element)
+ {
+ reader.Read();
+ continue;
+ }
+
+ // Get the information from the dipvalue
+ switch (reader.Name)
+ {
+ case "condition":
+ var condition = new ListXmlCondition();
+ condition.Tag = reader.GetAttribute("tag");
+ condition.Mask = reader.GetAttribute("mask");
+ condition.Relation = reader.GetAttribute("relation");
+ condition.Value = reader.GetAttribute("value");
+
+ dipValue.Conditions.Add(condition);
+
reader.Read();
break;
@@ -736,6 +789,7 @@ namespace SabreTools.Library.DatFiles
return;
// Get lists ready
+ configuration.Conditions = new List();
configuration.Locations = new List();
configuration.Settings = new List();
@@ -754,6 +808,18 @@ namespace SabreTools.Library.DatFiles
// Get the information from the dipswitch
switch (reader.Name)
{
+ case "condition":
+ var condition = new ListXmlCondition();
+ condition.Tag = reader.GetAttribute("tag");
+ condition.Mask = reader.GetAttribute("mask");
+ condition.Relation = reader.GetAttribute("relation");
+ condition.Value = reader.GetAttribute("value");
+
+ configuration.Conditions.Add(condition);
+
+ reader.Read();
+ break;
+
case "conflocation":
var confLocation = new ListXmlConfLocation();
confLocation.Name = reader.GetAttribute("name");
@@ -771,8 +837,60 @@ namespace SabreTools.Library.DatFiles
confSetting.Value = reader.GetAttribute("value");
confSetting.Default = reader.GetAttribute("default").AsYesNo();
+ // Now read the internal tags
+ ReadConfSetting(reader, confSetting);
+
configuration.Settings.Add(confSetting);
+ // Skip the dipvalue now that we've processed it
+ reader.Read();
+ break;
+
+ default:
+ reader.Read();
+ break;
+ }
+ }
+ }
+
+ ///
+ /// Read ConfSetting information
+ ///
+ /// XmlReader representing a diskarea block
+ /// ListXmlConfSetting to populate
+ private void ReadConfSetting(XmlReader reader, ListXmlConfSetting confSetting)
+ {
+ // If we have an empty confsetting, skip it
+ if (reader == null)
+ return;
+
+ // Get list ready
+ confSetting.Conditions = new List();
+
+ // Otherwise, add what is possible
+ reader.MoveToContent();
+
+ while (!reader.EOF)
+ {
+ // We only want elements
+ if (reader.NodeType != XmlNodeType.Element)
+ {
+ reader.Read();
+ continue;
+ }
+
+ // Get the information from the confsetting
+ switch (reader.Name)
+ {
+ case "condition":
+ var condition = new ListXmlCondition();
+ condition.Tag = reader.GetAttribute("tag");
+ condition.Mask = reader.GetAttribute("mask");
+ condition.Relation = reader.GetAttribute("relation");
+ condition.Value = reader.GetAttribute("value");
+
+ confSetting.Conditions.Add(condition);
+
reader.Read();
break;
@@ -832,8 +950,8 @@ namespace SabreTools.Library.DatFiles
/// Read Adjuster information
///
/// XmlReader representing a diskarea block
- /// ListXmlAdjuster to populate
- private void ReadAdjuster(XmlReader reader, ListXmlAdjuster adjuster)
+ /// Adjuster to populate
+ private void ReadAdjuster(XmlReader reader, Adjuster adjuster)
{
// If we have an empty port, skip it
if (reader == null)
@@ -979,7 +1097,7 @@ namespace SabreTools.Library.DatFiles
// If we have a different game and we're not at the start of the list, output the end of last item
if (lastgame != null && lastgame.ToLowerInvariant() != datItem.Machine.Name.ToLowerInvariant())
- WriteEndGame(xtw, datItem);
+ WriteEndGame(xtw);
// If we have a new game, output the beginning of the new item
if (lastgame == null || lastgame.ToLowerInvariant() != datItem.Machine.Name.ToLowerInvariant())
@@ -1180,6 +1298,21 @@ namespace SabreTools.Library.DatFiles
xtw.WriteOptionalAttributeString("tag", dipSwitch.Tag);
xtw.WriteOptionalAttributeString("mask", dipSwitch.Mask);
+ if (dipSwitch.Conditions != null)
+ {
+ foreach (var condition in dipSwitch.Conditions)
+ {
+ xtw.WriteStartElement("condition");
+
+ xtw.WriteOptionalAttributeString("tag", condition.Tag);
+ xtw.WriteOptionalAttributeString("mask", condition.Mask);
+ xtw.WriteOptionalAttributeString("relation", condition.Relation);
+ xtw.WriteOptionalAttributeString("value", condition.Value);
+
+ // End condition
+ xtw.WriteEndElement();
+ }
+ }
if (dipSwitch.Locations != null)
{
foreach (var location in dipSwitch.Locations)
@@ -1204,6 +1337,22 @@ namespace SabreTools.Library.DatFiles
xtw.WriteOptionalAttributeString("value", value.Value);
xtw.WriteOptionalAttributeString("default", value.Default.FromYesNo());
+ if (value.Conditions != null)
+ {
+ foreach (var condition in value.Conditions)
+ {
+ xtw.WriteStartElement("condition");
+
+ xtw.WriteOptionalAttributeString("tag", condition.Tag);
+ xtw.WriteOptionalAttributeString("mask", condition.Mask);
+ xtw.WriteOptionalAttributeString("relation", condition.Relation);
+ xtw.WriteOptionalAttributeString("value", condition.Value);
+
+ // End condition
+ xtw.WriteEndElement();
+ }
+ }
+
// End dipvalue
xtw.WriteEndElement();
}
@@ -1223,6 +1372,21 @@ namespace SabreTools.Library.DatFiles
xtw.WriteOptionalAttributeString("tag", configuration.Tag);
xtw.WriteOptionalAttributeString("mask", configuration.Mask);
+ if (configuration.Conditions != null)
+ {
+ foreach (var condition in configuration.Conditions)
+ {
+ xtw.WriteStartElement("condition");
+
+ xtw.WriteOptionalAttributeString("tag", condition.Tag);
+ xtw.WriteOptionalAttributeString("mask", condition.Mask);
+ xtw.WriteOptionalAttributeString("relation", condition.Relation);
+ xtw.WriteOptionalAttributeString("value", condition.Value);
+
+ // End condition
+ xtw.WriteEndElement();
+ }
+ }
if (configuration.Locations != null)
{
foreach (var location in configuration.Locations)
@@ -1281,35 +1445,6 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
}
}
- if (datItem.Machine.Adjusters != null)
- {
- foreach (var adjuster in datItem.Machine.Adjusters)
- {
- xtw.WriteStartElement("adjuster");
-
- xtw.WriteOptionalAttributeString("name", adjuster.Name);
- xtw.WriteOptionalAttributeString("default", adjuster.Default.FromYesNo());
-
- if (adjuster.Conditions != null)
- {
- foreach (var condition in adjuster.Conditions)
- {
- xtw.WriteStartElement("condition");
-
- xtw.WriteOptionalAttributeString("tag", condition.Tag);
- xtw.WriteOptionalAttributeString("mask", condition.Mask);
- xtw.WriteOptionalAttributeString("relation", condition.Relation);
- xtw.WriteOptionalAttributeString("value", condition.Value);
-
- // End condition
- xtw.WriteEndElement();
- }
- }
-
- // End adjuster
- xtw.WriteEndElement();
- }
- }
if (datItem.Machine.Drivers != null)
{
foreach (var driver in datItem.Machine.Drivers)
@@ -1408,18 +1543,6 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
}
}
- if (datItem.Machine.RamOptions != null)
- {
- foreach (var ramOption in datItem.Machine.RamOptions)
- {
- xtw.WriteStartElement("ramoption");
-
- xtw.WriteOptionalAttributeString("default", ramOption.Default.FromYesNo());
-
- // End softwarelist
- xtw.WriteEndElement();
- }
- }
xtw.Flush();
}
@@ -1436,9 +1559,8 @@ namespace SabreTools.Library.DatFiles
/// Write out Game start using the supplied StreamWriter
///
/// XmlTextWriter to output to
- /// DatItem object to be output
/// True if the data was written, false on error
- private bool WriteEndGame(XmlTextWriter xtw, DatItem datItem)
+ private bool WriteEndGame(XmlTextWriter xtw)
{
try
{
@@ -1472,6 +1594,26 @@ namespace SabreTools.Library.DatFiles
// Build the state
switch (datItem.ItemType)
{
+ case ItemType.Adjuster:
+ var adjuster = datItem as Adjuster;
+ xtw.WriteStartElement("adjuster");
+ xtw.WriteRequiredAttributeString("name", datItem.Name);
+ xtw.WriteOptionalAttributeString("default", adjuster.Default.FromYesNo());
+ if (adjuster.Conditions != null)
+ {
+ foreach (var condition in adjuster.Conditions)
+ {
+ xtw.WriteStartElement("condition");
+ xtw.WriteOptionalAttributeString("tag", condition.Tag);
+ xtw.WriteOptionalAttributeString("mask", condition.Mask);
+ xtw.WriteOptionalAttributeString("relation", condition.Relation);
+ xtw.WriteOptionalAttributeString("value", condition.Value);
+ xtw.WriteEndElement();
+ }
+ }
+ xtw.WriteEndElement();
+ break;
+
case ItemType.BiosSet:
var biosSet = datItem as BiosSet;
xtw.WriteStartElement("biosset");
@@ -1501,7 +1643,6 @@ namespace SabreTools.Library.DatFiles
var disk = datItem as Disk;
xtw.WriteStartElement("disk");
xtw.WriteRequiredAttributeString("name", disk.Name);
- xtw.WriteOptionalAttributeString("md5", disk.MD5?.ToLowerInvariant());
xtw.WriteOptionalAttributeString("sha1", disk.SHA1?.ToLowerInvariant());
xtw.WriteOptionalAttributeString("merge", disk.MergeTag);
xtw.WriteOptionalAttributeString("region", disk.Region);
@@ -1512,20 +1653,22 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
break;
+ case ItemType.RamOption:
+ var ramOption = datItem as RamOption;
+ xtw.WriteStartElement("ramoption");
+ xtw.WriteRequiredAttributeString("name", ramOption.Name);
+ xtw.WriteOptionalAttributeString("default", ramOption.Default.FromYesNo());
+ xtw.WriteRaw(ramOption.Content ?? string.Empty);
+ xtw.WriteFullEndElement();
+ break;
+
case ItemType.Rom:
var rom = datItem as Rom;
xtw.WriteStartElement("rom");
xtw.WriteRequiredAttributeString("name", rom.Name);
if (rom.Size != -1) xtw.WriteAttributeString("size", rom.Size.ToString());
xtw.WriteOptionalAttributeString("crc", rom.CRC?.ToLowerInvariant());
- xtw.WriteOptionalAttributeString("md5", rom.MD5?.ToLowerInvariant());
-#if NET_FRAMEWORK
- xtw.WriteOptionalAttributeString("ripemd160", rom?.RIPEMD160?.ToLowerInvariant());
-#endif
xtw.WriteOptionalAttributeString("sha1", rom.SHA1?.ToLowerInvariant());
- xtw.WriteOptionalAttributeString("sha256", rom.SHA256?.ToLowerInvariant());
- xtw.WriteOptionalAttributeString("sha384", rom.SHA384?.ToLowerInvariant());
- xtw.WriteOptionalAttributeString("sha512", rom.SHA512?.ToLowerInvariant());
xtw.WriteOptionalAttributeString("bios", rom.Bios);
xtw.WriteOptionalAttributeString("merge", rom.MergeTag);
xtw.WriteOptionalAttributeString("region", rom.Region);
@@ -1546,7 +1689,7 @@ namespace SabreTools.Library.DatFiles
xtw.WriteStartElement("softwarelist");
xtw.WriteRequiredAttributeString("name", datItem.Name);
xtw.WriteOptionalAttributeString("status", softwareList.Status.FromSoftwareListStatus());
- xtw.WriteOptionalAttributeString("sha512", softwareList.Filter);
+ xtw.WriteOptionalAttributeString("filter", softwareList.Filter);
xtw.WriteEndElement();
break;
}
diff --git a/SabreTools.Library/DatFiles/Logiqx.cs b/SabreTools.Library/DatFiles/Logiqx.cs
index 09b3d780..08bfb524 100644
--- a/SabreTools.Library/DatFiles/Logiqx.cs
+++ b/SabreTools.Library/DatFiles/Logiqx.cs
@@ -953,12 +953,6 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
break;
- case ItemType.DeviceReference:
- xtw.WriteStartElement("device_ref");
- xtw.WriteRequiredAttributeString("name", datItem.Name);
- xtw.WriteEndElement();
- break;
-
case ItemType.Disk:
var disk = datItem as Disk;
xtw.WriteStartElement("disk");
diff --git a/SabreTools.Library/DatFiles/SabreDat.cs b/SabreTools.Library/DatFiles/SabreDat.cs
index 452a95a9..cc10d586 100644
--- a/SabreTools.Library/DatFiles/SabreDat.cs
+++ b/SabreTools.Library/DatFiles/SabreDat.cs
@@ -839,6 +839,27 @@ namespace SabreTools.Library.DatFiles
// Build the state
switch (datItem.ItemType)
{
+ case ItemType.Adjuster:
+ var adjuster = datItem as Adjuster;
+ xtw.WriteStartElement("file");
+ xtw.WriteAttributeString("type", "adjuster");
+ xtw.WriteRequiredAttributeString("name", datItem.Name);
+ xtw.WriteOptionalAttributeString("default", adjuster.Default.FromYesNo());
+ if (adjuster.Conditions != null)
+ {
+ foreach (var condition in adjuster.Conditions)
+ {
+ xtw.WriteStartElement("condition");
+ xtw.WriteOptionalAttributeString("tag", condition.Tag);
+ xtw.WriteOptionalAttributeString("mask", condition.Mask);
+ xtw.WriteOptionalAttributeString("relation", condition.Relation);
+ xtw.WriteOptionalAttributeString("value", condition.Value);
+ xtw.WriteEndElement();
+ }
+ }
+ xtw.WriteEndElement();
+ break;
+
case ItemType.Archive:
xtw.WriteStartElement("file");
xtw.WriteAttributeString("type", "archive");
@@ -907,6 +928,16 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
break;
+ case ItemType.RamOption:
+ var ramOption = datItem as RamOption;
+ xtw.WriteStartElement("file");
+ xtw.WriteAttributeString("type", "ramoption");
+ xtw.WriteRequiredAttributeString("name", ramOption.Name);
+ xtw.WriteOptionalAttributeString("default", ramOption.Default.FromYesNo());
+ xtw.WriteRaw(ramOption.Content ?? string.Empty);
+ xtw.WriteFullEndElement();
+ break;
+
case ItemType.Release:
var release = datItem as Release;
xtw.WriteStartElement("file");
diff --git a/SabreTools.Library/DatItems/Adjuster.cs b/SabreTools.Library/DatItems/Adjuster.cs
new file mode 100644
index 00000000..19ed3d0d
--- /dev/null
+++ b/SabreTools.Library/DatItems/Adjuster.cs
@@ -0,0 +1,195 @@
+using System.Collections.Generic;
+using System.Linq;
+
+using SabreTools.Library.Filtering;
+using SabreTools.Library.Tools;
+using Newtonsoft.Json;
+
+namespace SabreTools.Library.DatItems
+{
+ ///
+ /// Represents which Adjuster(s) is associated with a set
+ ///
+ [JsonObject("adjuster")]
+ public class Adjuster : DatItem
+ {
+ #region Fields
+
+ ///
+ /// Determine whether the value is default
+ ///
+ [JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public bool? Default { get; set; }
+
+ ///
+ /// Conditions associated with the adjustment
+ ///
+ [JsonProperty("conditions")]
+ public List Conditions { get; set; }
+
+ #endregion
+
+ #region Accessors
+
+ ///
+ /// Set fields with given values
+ ///
+ /// Mappings dictionary
+ public override void SetFields(Dictionary mappings)
+ {
+ // Set base fields
+ base.SetFields(mappings);
+
+ // Handle Adjuster-specific fields
+ if (mappings.Keys.Contains(Field.DatItem_Default))
+ Default = mappings[Field.DatItem_Default].AsYesNo();
+
+ // TODO: Handle DatItem_Condition*
+ }
+
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Create a default, empty Adjuster object
+ ///
+ public Adjuster()
+ {
+ Name = string.Empty;
+ ItemType = ItemType.Adjuster;
+ }
+
+ #endregion
+
+ #region Cloning Methods
+
+ public override object Clone()
+ {
+ return new Adjuster()
+ {
+ Name = this.Name,
+ ItemType = this.ItemType,
+ DupeType = this.DupeType,
+
+ AltName = this.AltName,
+ AltTitle = this.AltTitle,
+
+ Original = this.Original,
+ OpenMSXSubType = this.OpenMSXSubType,
+ OpenMSXType = this.OpenMSXType,
+ Remark = this.Remark,
+ Boot = this.Boot,
+
+ Part = this.Part,
+ Features = this.Features,
+ AreaName = this.AreaName,
+ AreaSize = this.AreaSize,
+ AreaWidth = this.AreaWidth,
+ AreaEndianness = this.AreaEndianness,
+ Value = this.Value,
+ LoadFlag = this.LoadFlag,
+
+ Machine = this.Machine.Clone() as Machine,
+ Source = this.Source.Clone() as Source,
+ Remove = this.Remove,
+
+ Default = this.Default,
+ Conditions = this.Conditions,
+ };
+ }
+
+ #endregion
+
+ #region Comparision Methods
+
+ public override bool Equals(DatItem other)
+ {
+ // If we don't have a BiosSet, return false
+ if (ItemType != other.ItemType)
+ return false;
+
+ // Otherwise, treat it as a Adjuster
+ Adjuster newOther = other as Adjuster;
+
+ // If the Adjuster information matches
+ return (Name == newOther.Name && Default == newOther.Default); // TODO: Handle DatItem_Condition*
+ }
+
+ #endregion
+
+ #region Filtering
+
+ ///
+ /// Check to see if a DatItem passes the filter
+ ///
+ /// Filter to check against
+ /// True if the item passed the filter, false otherwise
+ public override bool PassesFilter(Filter filter)
+ {
+ // Check common fields first
+ if (!base.PassesFilter(filter))
+ return false;
+
+ // Filter on default
+ if (filter.DatItem_Default.MatchesNeutral(null, Default) == false)
+ return false;
+
+ // TODO: Handle DatItem_Condition*
+
+ return true;
+ }
+
+ ///
+ /// Remove fields from the DatItem
+ ///
+ /// List of Fields to remove
+ public override void RemoveFields(List fields)
+ {
+ // Remove common fields first
+ base.RemoveFields(fields);
+
+ // Remove the fields
+ if (fields.Contains(Field.DatItem_Default))
+ Default = null;
+
+ if (fields.Contains(Field.DatItem_Conditions))
+ Conditions = null;
+
+ // TODO: Handle DatItem_Condition*
+ }
+
+ #endregion
+
+ #region Sorting and Merging
+
+ ///
+ /// Replace fields from another item
+ ///
+ /// DatItem to pull new information from
+ /// List of Fields representing what should be updated
+ public override void ReplaceFields(DatItem item, List fields)
+ {
+ // Replace common fields first
+ base.ReplaceFields(item, fields);
+
+ // If we don't have a Adjuster to replace from, ignore specific fields
+ if (item.ItemType != ItemType.Adjuster)
+ return;
+
+ // Cast for easier access
+ Adjuster newItem = item as Adjuster;
+
+ // Replace the fields
+ if (fields.Contains(Field.DatItem_Default))
+ Default = newItem.Default;
+
+ if (fields.Contains(Field.DatItem_Conditions))
+ Conditions = newItem.Conditions;
+
+ // TODO: Handle DatItem_Condition*
+ }
+
+ #endregion
+ }
+}
diff --git a/SabreTools.Library/DatItems/Auxiliary.cs b/SabreTools.Library/DatItems/Auxiliary.cs
index 2dbee1d0..a28bd8d6 100644
--- a/SabreTools.Library/DatItems/Auxiliary.cs
+++ b/SabreTools.Library/DatItems/Auxiliary.cs
@@ -11,23 +11,6 @@ namespace SabreTools.Library.DatItems
#region ListXML
- ///
- /// Represents one ListXML adjuster
- ///
- /// TODO: Promote to DatItem level
- [JsonObject("adjuster")]
- public class ListXmlAdjuster
- {
- [JsonProperty("name")]
- public string Name { get; set; }
-
- [JsonProperty("default")]
- public bool? Default { get; set; }
-
- [JsonProperty("conditions")]
- public List Conditions { get; set; }
- }
-
///
/// Represents one ListXML analog
///
@@ -41,6 +24,7 @@ namespace SabreTools.Library.DatItems
///
/// Represents one ListXML condition
///
+ /// TODO: Promote to DatItem level? (Both used at ListXML level AND under a lot of stuff)
[JsonObject("condition")]
public class ListXmlCondition
{
@@ -60,7 +44,7 @@ namespace SabreTools.Library.DatItems
///
/// Represents one ListXML configuration
///
- /// TODO: Promote to DatItem level
+ /// TODO: Promote to DatItem level (contains lists)
[JsonObject("configuration")]
public class ListXmlConfiguration
{
@@ -73,6 +57,9 @@ namespace SabreTools.Library.DatItems
[JsonProperty("mask")]
public string Mask { get; set; }
+ [JsonProperty("conditions")]
+ public List Conditions { get; set; }
+
[JsonProperty("locations")]
public List Locations { get; set; }
@@ -110,6 +97,9 @@ namespace SabreTools.Library.DatItems
[JsonProperty("default")]
public bool? Default { get; set; }
+
+ [JsonProperty("conditions")]
+ public List Conditions { get; set; }
}
///
@@ -158,7 +148,7 @@ namespace SabreTools.Library.DatItems
///
/// Represents one ListXML device
///
- /// TODO: Promote to DatItem level (doesn't have "name" field?)
+ /// TODO: Promote to DatItem level (doesn't have "name" field?) (contains list)
[JsonObject("device")]
public class ListXmlDevice
{
@@ -238,7 +228,7 @@ namespace SabreTools.Library.DatItems
/// Represents one ListXML dipswitch
///
/// Also used by SoftwareList
- /// TODO: Promote to DatItem level
+ /// TODO: Promote to DatItem level (contains list)
[JsonObject("dipswitch")]
public class ListXmlDipSwitch
{
@@ -251,6 +241,9 @@ namespace SabreTools.Library.DatItems
[JsonProperty("mask")]
public string Mask { get; set; }
+ [JsonProperty("conditions")]
+ public List Conditions { get; set; }
+
[JsonProperty("locations")]
public List Locations { get; set; }
@@ -289,6 +282,9 @@ namespace SabreTools.Library.DatItems
[JsonProperty("default")]
public bool? Default { get; set; }
+
+ [JsonProperty("conditions")]
+ public List Conditions { get; set; }
}
///
@@ -341,7 +337,7 @@ namespace SabreTools.Library.DatItems
///
/// Represents one ListXML input
///
- /// TODO: Promote to DatItem level (doesn't have "name" field?)
+ /// TODO: Promote to DatItem level (doesn't have "name" field?) (contains list)
[JsonObject("input")]
public class ListXmlInput
{
@@ -377,7 +373,7 @@ namespace SabreTools.Library.DatItems
///
/// Represents one ListXML port
///
- /// TODO: Promote to DatItem level (doesn't have "name" field?)
+ /// TODO: Promote to DatItem level (doesn't have "name" field?) (contains list)
[JsonObject("port")]
public class ListXmlPort
{
@@ -388,21 +384,10 @@ namespace SabreTools.Library.DatItems
public List Analogs { get; set; }
}
- ///
- /// Represents one ListXML ramoption
- ///
- /// TODO: Promote to DatItem level (doesn't have "name" field?)
- [JsonObject("ramoption")]
- public class ListXmlRamOption
- {
- [JsonProperty("default")]
- public bool? Default { get; set; }
- }
-
///
/// Represents one ListXML slot
///
- /// TODO: Promote to DatItem level
+ /// TODO: Promote to DatItem level (contains list)
[JsonObject("slot")]
public class ListXmlSlot
{
diff --git a/SabreTools.Library/DatItems/DatItem.cs b/SabreTools.Library/DatItems/DatItem.cs
index adaa2295..243fb1e9 100644
--- a/SabreTools.Library/DatItems/DatItem.cs
+++ b/SabreTools.Library/DatItems/DatItem.cs
@@ -264,15 +264,25 @@ namespace SabreTools.Library.DatItems
#region Auxiliary
+ // Adjuster
+ Field.DatItem_Default,
+ Field.DatItem_Conditions,
+ Field.DatItem_Condition_Tag,
+ Field.DatItem_Condition_Mask,
+ Field.DatItem_Condition_Relation,
+ Field.DatItem_Condition_Value,
+
// BiosSet
Field.DatItem_Description,
- Field.DatItem_Default,
// Chip
Field.DatItem_Tag,
Field.DatItem_ChipType,
Field.DatItem_Clock,
+ // Ram Option
+ Field.DatItem_Content,
+
// Release
Field.DatItem_Language,
@@ -440,6 +450,9 @@ namespace SabreTools.Library.DatItems
#if NET_FRAMEWORK
switch (itemType)
{
+ case ItemType.Adjuster:
+ return new Adjuster();
+
case ItemType.Archive:
return new Archive();
@@ -461,6 +474,9 @@ namespace SabreTools.Library.DatItems
case ItemType.Media:
return new Media();
+ case ItemType.RamOption:
+ return new RamOption();
+
case ItemType.Release:
return new Release();
diff --git a/SabreTools.Library/DatItems/Enums.cs b/SabreTools.Library/DatItems/Enums.cs
index 724a4bb1..181b9e1c 100644
--- a/SabreTools.Library/DatItems/Enums.cs
+++ b/SabreTools.Library/DatItems/Enums.cs
@@ -223,18 +223,6 @@ namespace SabreTools.Library.DatItems
Machine_Port_Analogs,
Machine_Port_Analog_Mask,
- // Adjusters
- Machine_Adjusters,
- Machine_Adjuster_Name,
- Machine_Adjuster_Default,
-
- // Adjusters.Conditions
- Machine_Adjuster_Conditions,
- Machine_Adjuster_Condition_Tag,
- Machine_Adjuster_Condition_Mask,
- Machine_Adjuster_Condition_Relation,
- Machine_Adjuster_Condition_Value,
-
// Drivers
Machine_Drivers,
Machine_Driver_Status,
@@ -275,10 +263,6 @@ namespace SabreTools.Library.DatItems
Machine_Slot_SlotOption_DeviceName,
Machine_Slot_SlotOption_Default,
- // RamOptions
- Machine_RamOptions,
- Machine_RamOption_Default,
-
#endregion
#region Logiqx
@@ -407,15 +391,25 @@ namespace SabreTools.Library.DatItems
#region Auxiliary
+ // Adjuster
+ DatItem_Default,
+ DatItem_Conditions,
+ DatItem_Condition_Tag,
+ DatItem_Condition_Mask,
+ DatItem_Condition_Relation,
+ DatItem_Condition_Value,
+
// BiosSet
DatItem_Description,
- DatItem_Default,
// Chip
DatItem_Tag,
DatItem_ChipType,
DatItem_Clock,
+ // Ram Option
+ DatItem_Content,
+
// Release
DatItem_Language,
@@ -459,10 +453,12 @@ namespace SabreTools.Library.DatItems
Media,
// "Auxiliary" item types
+ Adjuster,
Archive,
BiosSet,
Chip,
DeviceReference,
+ RamOption,
Release,
Sample,
SoftwareList,
diff --git a/SabreTools.Library/DatItems/Machine.cs b/SabreTools.Library/DatItems/Machine.cs
index f5d4bf21..21da3b78 100644
--- a/SabreTools.Library/DatItems/Machine.cs
+++ b/SabreTools.Library/DatItems/Machine.cs
@@ -196,12 +196,6 @@ namespace SabreTools.Library.DatItems
[JsonProperty("ports", DefaultValueHandling = DefaultValueHandling.Ignore)]
public List Ports { get; set; } = null;
- ///
- /// List of associated adjusters
- ///
- [JsonProperty("adjusters", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public List Adjusters { get; set; } = null;
-
///
/// List of associated drivers
///
@@ -226,12 +220,6 @@ namespace SabreTools.Library.DatItems
[JsonProperty("slots", DefaultValueHandling = DefaultValueHandling.Ignore)]
public List Slots { get; set; } = null;
- ///
- /// List of ramoptions
- ///
- [JsonProperty("ramoptions", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public List RamOptions { get; set; } = null;
-
#endregion
#region Logiqx Fields
@@ -591,12 +579,10 @@ namespace SabreTools.Library.DatItems
DipSwitches = this.DipSwitches,
Configurations = this.Configurations,
Ports = this.Ports,
- Adjusters = this.Adjusters,
Drivers = this.Drivers,
Features = this.Features,
Devices = this.Devices,
Slots = this.Slots,
- RamOptions = this.RamOptions,
#endregion
diff --git a/SabreTools.Library/DatItems/RamOption.cs b/SabreTools.Library/DatItems/RamOption.cs
new file mode 100644
index 00000000..5f844518
--- /dev/null
+++ b/SabreTools.Library/DatItems/RamOption.cs
@@ -0,0 +1,196 @@
+using System.Collections.Generic;
+using System.Linq;
+
+using SabreTools.Library.Filtering;
+using SabreTools.Library.Tools;
+using Newtonsoft.Json;
+
+namespace SabreTools.Library.DatItems
+{
+ ///
+ /// Represents which RAM option(s) is associated with a set
+ ///
+ [JsonObject("ramoption")]
+ public class RamOption : DatItem
+ {
+ #region Fields
+
+ ///
+ /// Determine whether the RamOption is default
+ ///
+ [JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public bool? Default { get; set; }
+
+ ///
+ /// Determines the content of the RamOption
+ ///
+ [JsonProperty("content", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string Content { get; set; }
+
+ #endregion
+
+ #region Accessors
+
+ ///
+ /// Set fields with given values
+ ///
+ /// Mappings dictionary
+ public override void SetFields(Dictionary mappings)
+ {
+ // Set base fields
+ base.SetFields(mappings);
+
+ // Handle BiosSet-specific fields
+ if (mappings.Keys.Contains(Field.DatItem_Default))
+ Default = mappings[Field.DatItem_Default].AsYesNo();
+
+ if (mappings.Keys.Contains(Field.DatItem_Content))
+ Content = mappings[Field.DatItem_Content];
+ }
+
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Create a default, empty RamOption object
+ ///
+ public RamOption()
+ {
+ Name = string.Empty;
+ ItemType = ItemType.RamOption;
+ }
+
+ #endregion
+
+ #region Cloning Methods
+
+ public override object Clone()
+ {
+ return new RamOption()
+ {
+ Name = this.Name,
+ ItemType = this.ItemType,
+ DupeType = this.DupeType,
+
+ AltName = this.AltName,
+ AltTitle = this.AltTitle,
+
+ Original = this.Original,
+ OpenMSXSubType = this.OpenMSXSubType,
+ OpenMSXType = this.OpenMSXType,
+ Remark = this.Remark,
+ Boot = this.Boot,
+
+ Part = this.Part,
+ Features = this.Features,
+ AreaName = this.AreaName,
+ AreaSize = this.AreaSize,
+ AreaWidth = this.AreaWidth,
+ AreaEndianness = this.AreaEndianness,
+ Value = this.Value,
+ LoadFlag = this.LoadFlag,
+
+ Machine = this.Machine.Clone() as Machine,
+ Source = this.Source.Clone() as Source,
+ Remove = this.Remove,
+
+ Default = this.Default,
+ Content = this.Content,
+ };
+ }
+
+ #endregion
+
+ #region Comparision Methods
+
+ public override bool Equals(DatItem other)
+ {
+ // If we don't have a RamOption, return false
+ if (ItemType != other.ItemType)
+ return false;
+
+ // Otherwise, treat it as a RamOption
+ RamOption newOther = other as RamOption;
+
+ // If the BiosSet information matches
+ return (Name == newOther.Name && Default == newOther.Default && Content == newOther.Content);
+ }
+
+ #endregion
+
+ #region Filtering
+
+ ///
+ /// Check to see if a DatItem passes the filter
+ ///
+ /// Filter to check against
+ /// True if the item passed the filter, false otherwise
+ public override bool PassesFilter(Filter filter)
+ {
+ // Check common fields first
+ if (!base.PassesFilter(filter))
+ return false;
+
+ // Filter on default
+ if (filter.DatItem_Default.MatchesNeutral(null, Default) == false)
+ return false;
+
+ // Filter on content
+ if (filter.DatItem_Content.MatchesPositiveSet(Content) == false)
+ return false;
+ if (filter.DatItem_Content.MatchesNegativeSet(Content) == true)
+ return false;
+
+ return true;
+ }
+
+ ///
+ /// Remove fields from the DatItem
+ ///
+ /// List of Fields to remove
+ public override void RemoveFields(List fields)
+ {
+ // Remove common fields first
+ base.RemoveFields(fields);
+
+ // Remove the fields
+ if (fields.Contains(Field.DatItem_Default))
+ Default = null;
+
+ if (fields.Contains(Field.DatItem_Content))
+ Content = null;
+ }
+
+ #endregion
+
+ #region Sorting and Merging
+
+ ///
+ /// Replace fields from another item
+ ///
+ /// DatItem to pull new information from
+ /// List of Fields representing what should be updated
+ public override void ReplaceFields(DatItem item, List fields)
+ {
+ // Replace common fields first
+ base.ReplaceFields(item, fields);
+
+ // If we don't have a BiosSet to replace from, ignore specific fields
+ if (item.ItemType != ItemType.RamOption)
+ return;
+
+ // Cast for easier access
+ RamOption newItem = item as RamOption;
+
+ // Replace the fields
+ if (fields.Contains(Field.DatItem_Default))
+ Default = newItem.Default;
+
+ if (fields.Contains(Field.DatItem_Content))
+ Content = newItem.Content;
+ }
+
+ #endregion
+ }
+}
diff --git a/SabreTools.Library/Filtering/Filter.cs b/SabreTools.Library/Filtering/Filter.cs
index f42ec09e..124a7402 100644
--- a/SabreTools.Library/Filtering/Filter.cs
+++ b/SabreTools.Library/Filtering/Filter.cs
@@ -145,18 +145,6 @@ namespace SabreTools.Library.Filtering
public FilterItem Machine_Port_Analogs { get; private set; } = new FilterItem() { Neutral = null };
public FilterItem Machine_Port_Analog_Mask { get; private set; } = new FilterItem();
- // Adjusters
- public FilterItem Machine_Adjusters { get; private set; } = new FilterItem() { Neutral = null };
- public FilterItem Machine_Adjuster_Name { get; private set; } = new FilterItem();
- public FilterItem Machine_Adjuster_Default { get; private set; } = new FilterItem() { Neutral = null };
-
- // Adjusters.Conditions
- public FilterItem Machine_Adjuster_Conditions { get; private set; } = new FilterItem() { Neutral = null };
- public FilterItem Machine_Adjuster_Condition_Tag { get; private set; } = new FilterItem();
- public FilterItem Machine_Adjuster_Condition_Mask { get; private set; } = new FilterItem();
- public FilterItem Machine_Adjuster_Condition_Relation { get; private set; } = new FilterItem();
- public FilterItem Machine_Adjuster_Condition_Value { get; private set; } = new FilterItem();
-
// Drivers
public FilterItem Machine_Drivers { get; private set; } = new FilterItem() { Neutral = null };
public FilterItem Machine_Driver_Status { get; private set; } = new FilterItem();
@@ -197,10 +185,6 @@ namespace SabreTools.Library.Filtering
public FilterItem Machine_Slot_SlotOption_DeviceName { get; private set; } = new FilterItem();
public FilterItem Machine_Slot_SlotOption_Default { get; private set; } = new FilterItem() { Neutral = null };
- // RamOptions
- public FilterItem Machine_RamOptions { get; private set; } = new FilterItem() { Neutral = null };
- public FilterItem Machine_RamOption_Default { get; private set; } = new FilterItem() { Neutral = null };
-
#endregion
#region Logiqx
@@ -329,6 +313,13 @@ namespace SabreTools.Library.Filtering
#region Auxiliary
+ // Adjuster
+ public FilterItem DatItem_Conditions { get; private set; } = new FilterItem() { Neutral = null };
+ public FilterItem DatItem_Condition_Tag { get; private set; } = new FilterItem();
+ public FilterItem DatItem_Condition_Mask { get; private set; } = new FilterItem();
+ public FilterItem DatItem_Condition_Relation { get; private set; } = new FilterItem();
+ public FilterItem DatItem_Condition_Value { get; private set; } = new FilterItem();
+
// BiosSet
public FilterItem DatItem_Description { get; private set; } = new FilterItem();
public FilterItem DatItem_Default { get; private set; } = new FilterItem() { Neutral = null };
@@ -338,6 +329,9 @@ namespace SabreTools.Library.Filtering
public FilterItem DatItem_ChipType { get; private set; } = new FilterItem();
public FilterItem DatItem_Clock { get; private set; } = new FilterItem();
+ // Ram Option
+ public FilterItem DatItem_Content { get; private set; } = new FilterItem();
+
// Release
public FilterItem DatItem_Language { get; private set; } = new FilterItem();
@@ -1061,64 +1055,6 @@ namespace SabreTools.Library.Filtering
Machine_Port_Analog_Mask.PositiveSet.Add(value);
break;
- // Adjusters
- case Field.Machine_Adjusters:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- Machine_Adjusters.Neutral = false;
- else
- Machine_Adjusters.Neutral = true;
- break;
-
- case Field.Machine_Adjuster_Name:
- if (negate)
- Machine_Adjuster_Name.NegativeSet.Add(value);
- else
- Machine_Adjuster_Name.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Adjuster_Default:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- Machine_Adjuster_Default.Neutral = false;
- else
- Machine_Adjuster_Default.Neutral = true;
- break;
-
- // Adjusters.Conditions
- case Field.Machine_Adjuster_Conditions:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- Machine_Adjuster_Conditions.Neutral = false;
- else
- Machine_Adjuster_Conditions.Neutral = true;
- break;
-
- case Field.Machine_Adjuster_Condition_Tag:
- if (negate)
- Machine_Adjuster_Condition_Tag.NegativeSet.Add(value);
- else
- Machine_Adjuster_Condition_Tag.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Adjuster_Condition_Mask:
- if (negate)
- Machine_Adjuster_Condition_Mask.NegativeSet.Add(value);
- else
- Machine_Adjuster_Condition_Mask.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Adjuster_Condition_Relation:
- if (negate)
- Machine_Adjuster_Condition_Relation.NegativeSet.Add(value);
- else
- Machine_Adjuster_Condition_Relation.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Adjuster_Condition_Value:
- if (negate)
- Machine_Adjuster_Condition_Value.NegativeSet.Add(value);
- else
- Machine_Adjuster_Condition_Value.PositiveSet.Add(value);
- break;
-
// Drivers
case Field.Machine_Drivers:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
@@ -1308,21 +1244,6 @@ namespace SabreTools.Library.Filtering
Machine_Slot_SlotOption_Default.Neutral = true;
break;
- // RamOptions
- case Field.Machine_RamOptions:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- Machine_RamOptions.Neutral = false;
- else
- Machine_RamOptions.Neutral = true;
- break;
-
- case Field.Machine_RamOption_Default:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- Machine_RamOption_Default.Neutral = false;
- else
- Machine_RamOption_Default.Neutral = true;
- break;
-
#endregion
#region Logiqx
@@ -1890,6 +1811,49 @@ namespace SabreTools.Library.Filtering
#region Auxiliary
+ // Adjuster
+ case Field.DatItem_Default:
+ if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
+ DatItem_Default.Neutral = false;
+ else
+ DatItem_Default.Neutral = true;
+ break;
+
+ case Field.DatItem_Conditions:
+ if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
+ DatItem_Conditions.Neutral = false;
+ else
+ DatItem_Conditions.Neutral = true;
+ break;
+
+ case Field.DatItem_Condition_Tag:
+ if (negate)
+ DatItem_Condition_Tag.NegativeSet.Add(value);
+ else
+ DatItem_Condition_Tag.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_Condition_Mask:
+ if (negate)
+ DatItem_Condition_Mask.NegativeSet.Add(value);
+ else
+ DatItem_Condition_Mask.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_Condition_Relation:
+ if (negate)
+ DatItem_Condition_Relation.NegativeSet.Add(value);
+ else
+ DatItem_Condition_Relation.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_Condition_Value:
+ if (negate)
+ DatItem_Condition_Value.NegativeSet.Add(value);
+ else
+ DatItem_Condition_Value.PositiveSet.Add(value);
+ break;
+
// BiosSet
case Field.DatItem_Description:
if (negate)
@@ -1898,13 +1862,6 @@ namespace SabreTools.Library.Filtering
DatItem_Description.PositiveSet.Add(value);
break;
- case Field.DatItem_Default:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- DatItem_Default.Neutral = false;
- else
- DatItem_Default.Neutral = true;
- break;
-
// Chip
case Field.DatItem_Tag:
if (negate)
@@ -1927,6 +1884,14 @@ namespace SabreTools.Library.Filtering
DatItem_Clock.PositiveSet.Add(value);
break;
+ // Ram Option
+ case Field.DatItem_Content:
+ if (negate)
+ DatItem_Content.NegativeSet.Add(value);
+ else
+ DatItem_Content.PositiveSet.Add(value);
+ break;
+
// Release
case Field.DatItem_Language:
if (negate)
@@ -1950,11 +1915,11 @@ namespace SabreTools.Library.Filtering
DatItem_Filter.PositiveSet.Add(value);
break;
- #endregion
+ #endregion
- #endregion // Item-Specific
+ #endregion // Item-Specifics
- #endregion // DatItem Filters
+ #endregion // DatItem Filters
}
}
diff --git a/SabreTools.Library/Tools/Converters.cs b/SabreTools.Library/Tools/Converters.cs
index 16a13062..2171d951 100644
--- a/SabreTools.Library/Tools/Converters.cs
+++ b/SabreTools.Library/Tools/Converters.cs
@@ -660,30 +660,6 @@ namespace SabreTools.Library.Tools
case "port_analog_mask":
return Field.Machine_Port_Analog_Mask;
- case "adjusters":
- return Field.Machine_Adjusters;
-
- case "adjuster_name":
- return Field.Machine_Adjuster_Name;
-
- case "adjuster_default":
- return Field.Machine_Adjuster_Default;
-
- case "adjuster_conditions":
- return Field.Machine_Adjuster_Conditions;
-
- case "adjuster_condition_tag":
- return Field.Machine_Adjuster_Condition_Tag;
-
- case "adjuster_condition_mask":
- return Field.Machine_Adjuster_Condition_Mask;
-
- case "adjuster_condition_relation":
- return Field.Machine_Adjuster_Condition_Relation;
-
- case "adjuster_condition_value":
- return Field.Machine_Adjuster_Condition_Value;
-
case "drivers":
return Field.Machine_Drivers;
@@ -762,12 +738,6 @@ namespace SabreTools.Library.Tools
case "slot_slotoption_default":
return Field.Machine_Slot_SlotOption_Default;
- case "ramoptions":
- return Field.Machine_RamOptions;
-
- case "ramoption_default":
- return Field.Machine_RamOption_Default;
-
#endregion
#region Logiqx
@@ -1064,15 +1034,31 @@ namespace SabreTools.Library.Tools
#region Auxiliary
+ // Adjuster
+ case "default":
+ return Field.DatItem_Default;
+
+ case "conditions":
+ return Field.DatItem_Conditions;
+
+ case "condition_tag":
+ return Field.DatItem_Condition_Tag;
+
+ case "condition_mask":
+ return Field.DatItem_Condition_Mask;
+
+ case "condition_relation":
+ return Field.DatItem_Condition_Relation;
+
+ case "condition_value":
+ return Field.DatItem_Condition_Value;
+
// BiosSet
case "description":
case "biosdescription":
case "bios_description":
return Field.DatItem_Description;
- case "default":
- return Field.DatItem_Default;
-
// Chip
case "tag":
return Field.DatItem_Tag;
@@ -1084,6 +1070,10 @@ namespace SabreTools.Library.Tools
case "clock":
return Field.DatItem_Clock;
+ // Ram Option
+ case "content":
+ return Field.DatItem_Content;
+
// Release
case "language":
return Field.DatItem_Language;
@@ -1504,6 +1494,25 @@ namespace SabreTools.Library.Tools
#region Auxiliary
+ // Adjuster
+ case "default":
+ return Field.DatItem_Default;
+
+ case "conditions":
+ return Field.DatItem_Conditions;
+
+ case "condition_tag":
+ return Field.DatItem_Condition_Tag;
+
+ case "condition_mask":
+ return Field.DatItem_Condition_Mask;
+
+ case "condition_relation":
+ return Field.DatItem_Condition_Relation;
+
+ case "condition_value":
+ return Field.DatItem_Condition_Value;
+
// BiosSet
case "biosdescription":
case "bios-description":
@@ -1512,9 +1521,6 @@ namespace SabreTools.Library.Tools
case "bios-set-description":
return Field.DatItem_Description;
- case "default":
- return Field.DatItem_Default;
-
// Chip
case "tag":
return Field.DatItem_Tag;
@@ -1525,6 +1531,10 @@ namespace SabreTools.Library.Tools
case "clock":
return Field.DatItem_Clock;
+
+ // Ram Option
+ case "content":
+ return Field.DatItem_Content;
// Release
case "language":
@@ -1590,6 +1600,8 @@ namespace SabreTools.Library.Tools
#if NET_FRAMEWORK
switch (itemType?.ToLowerInvariant())
{
+ case "adjuster":
+ return ItemType.Adjuster;
case "archive":
return ItemType.Archive;
case "biosset":
@@ -1604,6 +1616,8 @@ namespace SabreTools.Library.Tools
return ItemType.Disk;
case "media":
return ItemType.Media;
+ case "ramoption":
+ return ItemType.RamOption;
case "release":
return ItemType.Release;
case "rom":
@@ -1618,6 +1632,7 @@ namespace SabreTools.Library.Tools
#else
return itemType?.ToLowerInvariant() switch
{
+ "adjuster" => ItemType.Adjuster,
"archive" => ItemType.Archive,
"biosset" => ItemType.BiosSet,
"blank" => ItemType.Blank,
@@ -1625,6 +1640,7 @@ namespace SabreTools.Library.Tools
"device_ref" => ItemType.DeviceReference,
"disk" => ItemType.Disk,
"media" => ItemType.Media,
+ "ramoption" => ItemType.RamOption,
"release" => ItemType.Release,
"rom" => ItemType.Rom,
"sample" => ItemType.Sample,
@@ -2020,6 +2036,8 @@ namespace SabreTools.Library.Tools
#if NET_FRAMEWORK
switch (itemType)
{
+ case ItemType.Adjuster:
+ return "adjuster";
case ItemType.Archive:
return "archive";
case ItemType.BiosSet:
@@ -2034,6 +2052,8 @@ namespace SabreTools.Library.Tools
return "disk";
case ItemType.Media:
return "media";
+ case ItemType.RamOption:
+ return "ramoption";
case ItemType.Release:
return "release";
case ItemType.Rom:
@@ -2048,6 +2068,7 @@ namespace SabreTools.Library.Tools
#else
return itemType switch
{
+ ItemType.Adjuster => "adjuster",
ItemType.Archive => "archive",
ItemType.BiosSet => "biosset",
ItemType.Blank => "blank",
@@ -2055,6 +2076,7 @@ namespace SabreTools.Library.Tools
ItemType.DeviceReference => "device_ref",
ItemType.Disk => "disk",
ItemType.Media => "media",
+ ItemType.RamOption => "ramoption",
ItemType.Release => "release",
ItemType.Rom => "rom",
ItemType.Sample => "sample",