diff --git a/SabreTools.Library/DatFiles/ItemDictionary.cs b/SabreTools.Library/DatFiles/ItemDictionary.cs
index f2ad9346..74431f5f 100644
--- a/SabreTools.Library/DatFiles/ItemDictionary.cs
+++ b/SabreTools.Library/DatFiles/ItemDictionary.cs
@@ -143,6 +143,12 @@ namespace SabreTools.Library.DatFiles
[JsonIgnore]
public long DiskCount { get; private set; } = 0;
+ ///
+ /// Number of Display items
+ ///
+ [JsonIgnore]
+ public long DisplayCount { get; private set; } = 0;
+
///
/// Number of Driver items
///
@@ -578,6 +584,9 @@ namespace SabreTools.Library.DatFiles
NodumpCount += ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
VerifiedCount += ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
break;
+ case ItemType.Display:
+ DisplayCount++;
+ break;
case ItemType.Driver:
DriverCount++;
break;
@@ -749,6 +758,9 @@ namespace SabreTools.Library.DatFiles
NodumpCount -= ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
VerifiedCount -= ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
break;
+ case ItemType.Display:
+ DisplayCount--;
+ break;
case ItemType.Driver:
DriverCount--;
break;
diff --git a/SabreTools.Library/DatFiles/Json.cs b/SabreTools.Library/DatFiles/Json.cs
index d1e9511e..ae1b3983 100644
--- a/SabreTools.Library/DatFiles/Json.cs
+++ b/SabreTools.Library/DatFiles/Json.cs
@@ -244,6 +244,9 @@ namespace SabreTools.Library.DatFiles
case ItemType.Disk:
datItem = datItemObj.ToObject();
break;
+ case ItemType.Display:
+ datItem = datItemObj.ToObject();
+ break;
case ItemType.Driver:
datItem = datItemObj.ToObject();
break;
diff --git a/SabreTools.Library/DatFiles/Listxml.cs b/SabreTools.Library/DatFiles/Listxml.cs
index 05633164..4a456476 100644
--- a/SabreTools.Library/DatFiles/Listxml.cs
+++ b/SabreTools.Library/DatFiles/Listxml.cs
@@ -356,6 +356,34 @@ namespace SabreTools.Library.DatFiles
reader.Read();
break;
+ case "display":
+ datItems.Add(new Display
+ {
+ Tag = reader.GetAttribute("tag"),
+ DisplayType = reader.GetAttribute("type"),
+ Rotate = reader.GetAttribute("rotate"),
+ FlipX = reader.GetAttribute("flipx").AsYesNo(),
+ Width = reader.GetAttribute("width"),
+ Height = reader.GetAttribute("height"),
+ Refresh = reader.GetAttribute("refresh"),
+ PixClock = reader.GetAttribute("pixclock"),
+ HTotal = reader.GetAttribute("htotal"),
+ HBEnd = reader.GetAttribute("hbend"),
+ HBStart = reader.GetAttribute("hbstart"),
+ VTotal = reader.GetAttribute("vtotal"),
+ VBEnd = reader.GetAttribute("vbend"),
+ VBStart = reader.GetAttribute("vbstart"),
+
+ Source = new Source
+ {
+ Index = indexId,
+ Name = filename,
+ },
+ });
+
+ reader.Read();
+ break;
+
case "driver":
datItems.Add(new Driver
{
@@ -521,32 +549,6 @@ namespace SabreTools.Library.DatFiles
reader.Read();
break;
- case "display":
- var display = new Display();
- display.Tag = reader.GetAttribute("tag");
- display.Type = reader.GetAttribute("type");
- display.Rotate = reader.GetAttribute("rotate");
- display.FlipX = reader.GetAttribute("flipx").AsYesNo();
- display.Width = reader.GetAttribute("width");
- display.Height = reader.GetAttribute("height");
- display.Refresh = reader.GetAttribute("refresh");
- display.PixClock = reader.GetAttribute("pixclock");
- display.HTotal = reader.GetAttribute("htotal");
- display.HBEnd = reader.GetAttribute("hbend");
- display.HBStart = reader.GetAttribute("hbstart");
- display.VTotal = reader.GetAttribute("vtotal");
- display.VBEnd = reader.GetAttribute("vbend");
- display.VBStart = reader.GetAttribute("vbstart");
-
- // Ensure the list exists
- if (machine.Displays == null)
- machine.Displays = new List();
-
- machine.Displays.Add(display);
-
- reader.Read();
- break;
-
case "input":
var input = new Input();
input.Service = reader.GetAttribute("service").AsYesNo();
@@ -1253,28 +1255,6 @@ namespace SabreTools.Library.DatFiles
xtw.WriteOptionalElementString("manufacturer", datItem.Machine.Manufacturer);
// TODO: These are all going away due to promotions
- if (datItem.Machine.Displays != null)
- {
- foreach (var display in datItem.Machine.Displays)
- {
- xtw.WriteStartElement("display");
- xtw.WriteOptionalAttributeString("tag", display.Tag);
- xtw.WriteOptionalAttributeString("type", display.Type);
- xtw.WriteOptionalAttributeString("rotate", display.Rotate);
- xtw.WriteOptionalAttributeString("flipx", display.FlipX.FromYesNo());
- xtw.WriteOptionalAttributeString("width", display.Width);
- xtw.WriteOptionalAttributeString("height", display.Height);
- xtw.WriteOptionalAttributeString("refresh", display.Refresh);
- xtw.WriteOptionalAttributeString("pixclock", display.PixClock);
- xtw.WriteOptionalAttributeString("htotal", display.HTotal);
- xtw.WriteOptionalAttributeString("hbend", display.HBEnd);
- xtw.WriteOptionalAttributeString("hstart", display.HBStart);
- xtw.WriteOptionalAttributeString("vtotal", display.VTotal);
- xtw.WriteOptionalAttributeString("vbend", display.VBEnd);
- xtw.WriteOptionalAttributeString("vbstart", display.VBStart);
- xtw.WriteEndElement();
- }
- }
if (datItem.Machine.Inputs != null)
{
foreach (var input in datItem.Machine.Inputs)
@@ -1557,6 +1537,26 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
break;
+ case ItemType.Display:
+ var display = datItem as Display;
+ xtw.WriteStartElement("display");
+ xtw.WriteOptionalAttributeString("tag", display.Tag);
+ xtw.WriteOptionalAttributeString("type", display.DisplayType);
+ xtw.WriteOptionalAttributeString("rotate", display.Rotate);
+ xtw.WriteOptionalAttributeString("flipx", display.FlipX.FromYesNo());
+ xtw.WriteOptionalAttributeString("width", display.Width);
+ xtw.WriteOptionalAttributeString("height", display.Height);
+ xtw.WriteOptionalAttributeString("refresh", display.Refresh);
+ xtw.WriteOptionalAttributeString("pixclock", display.PixClock);
+ xtw.WriteOptionalAttributeString("htotal", display.HTotal);
+ xtw.WriteOptionalAttributeString("hbend", display.HBEnd);
+ xtw.WriteOptionalAttributeString("hstart", display.HBStart);
+ xtw.WriteOptionalAttributeString("vtotal", display.VTotal);
+ xtw.WriteOptionalAttributeString("vbend", display.VBEnd);
+ xtw.WriteOptionalAttributeString("vbstart", display.VBStart);
+ xtw.WriteEndElement();
+ break;
+
case ItemType.Driver:
var driver = datItem as Driver;
xtw.WriteStartElement("driver");
diff --git a/SabreTools.Library/DatFiles/SabreDat.cs b/SabreTools.Library/DatFiles/SabreDat.cs
index 79376159..9966d15a 100644
--- a/SabreTools.Library/DatFiles/SabreDat.cs
+++ b/SabreTools.Library/DatFiles/SabreDat.cs
@@ -1431,6 +1431,27 @@ namespace SabreTools.Library.DatFiles
xtw.WriteEndElement();
break;
+ case ItemType.Display:
+ var display = datItem as Display;
+ xtw.WriteStartElement("file");
+ xtw.WriteAttributeString("type", "display");
+ xtw.WriteOptionalAttributeString("tag", display.Tag);
+ xtw.WriteOptionalAttributeString("type", display.DisplayType);
+ xtw.WriteOptionalAttributeString("rotate", display.Rotate);
+ xtw.WriteOptionalAttributeString("flipx", display.FlipX.FromYesNo());
+ xtw.WriteOptionalAttributeString("width", display.Width);
+ xtw.WriteOptionalAttributeString("height", display.Height);
+ xtw.WriteOptionalAttributeString("refresh", display.Refresh);
+ xtw.WriteOptionalAttributeString("pixclock", display.PixClock);
+ xtw.WriteOptionalAttributeString("htotal", display.HTotal);
+ xtw.WriteOptionalAttributeString("hbend", display.HBEnd);
+ xtw.WriteOptionalAttributeString("hstart", display.HBStart);
+ xtw.WriteOptionalAttributeString("vtotal", display.VTotal);
+ xtw.WriteOptionalAttributeString("vbend", display.VBEnd);
+ xtw.WriteOptionalAttributeString("vbstart", display.VBStart);
+ xtw.WriteEndElement();
+ break;
+
case ItemType.Driver:
var driver = datItem as Driver;
xtw.WriteStartElement("file");
diff --git a/SabreTools.Library/DatItems/Auxiliary.cs b/SabreTools.Library/DatItems/Auxiliary.cs
index a08b4e93..222296af 100644
--- a/SabreTools.Library/DatItems/Auxiliary.cs
+++ b/SabreTools.Library/DatItems/Auxiliary.cs
@@ -5,6 +5,7 @@ using SabreTools.Library.DatItems;
using SabreTools.Library.Filtering;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
+using SabreTools.Library.Tools;
///
/// This holds all of the auxiliary types needed for proper parsing
@@ -98,102 +99,6 @@ namespace SabreTools.Library.DatItems
#endregion
}
- ///
- /// Represents one ListXML display
- ///
- /// TODO: Promote to DatItem level
- [JsonObject("display")]
- public class Display
- {
- #region Fields
-
- ///
- /// Display tag
- ///
- [JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string Tag { get; set; }
-
- ///
- /// Display type
- ///
- [JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string Type { get; set; } // TODO: (raster|vector|lcd|svg|unknown)
-
- ///
- /// Display rotation
- ///
- [JsonProperty("rotate", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string Rotate { get; set; } // TODO: (0|90|180|270) Int32?
-
- ///
- /// Determines if display is flipped in the X-coordinates
- ///
- [JsonProperty("flipx", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public bool? FlipX { get; set; }
-
- ///
- /// Display width
- ///
- [JsonProperty("width", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string Width { get; set; } // TODO: Int32?
-
- ///
- /// Display height
- ///
- [JsonProperty("height", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string Height { get; set; } // TODO: Int32?
-
- ///
- /// Refresh rate
- ///
- [JsonProperty("refresh", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string Refresh { get; set; } // TODO: Int32? Float?
-
- ///
- /// Pixel clock timer
- ///
- [JsonProperty("pixclock", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string PixClock { get; set; } // TODO: Int32? Float?
-
- ///
- /// Total horizontal lines
- ///
- [JsonProperty("htotal", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string HTotal { get; set; } // TODO: Int32? Float?
-
- ///
- /// Horizontal blank end
- ///
- [JsonProperty("hbend", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string HBEnd { get; set; } // TODO: Int32? Float?
-
- ///
- /// Horizontal blank start
- ///
- [JsonProperty("hbstart", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string HBStart { get; set; } // TODO: Int32? Float?
-
- ///
- /// Total vertical lines
- ///
- [JsonProperty("vtotal", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string VTotal { get; set; } // TODO: Int32? Float?
-
- ///
- /// Vertical blank end
- ///
- [JsonProperty("vbend", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string VBEnd { get; set; } // TODO: Int32? Float?
-
- ///
- /// Vertical blank start
- ///
- [JsonProperty("vbstart", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public string VBStart { get; set; } // TODO: Int32? Float?
-
- #endregion
- }
-
///
/// Represents one ListXML input
///
diff --git a/SabreTools.Library/DatItems/DatItem.cs b/SabreTools.Library/DatItems/DatItem.cs
index ebf4b561..509ea944 100644
--- a/SabreTools.Library/DatItems/DatItem.cs
+++ b/SabreTools.Library/DatItems/DatItem.cs
@@ -491,6 +491,9 @@ namespace SabreTools.Library.DatItems
case ItemType.Disk:
return new Disk();
+ case ItemType.Display:
+ return new Display();
+
case ItemType.Driver:
return new Driver();
@@ -548,6 +551,7 @@ namespace SabreTools.Library.DatItems
ItemType.DeviceReference => new DeviceReference(),
ItemType.DipSwitch => new DipSwitch(),
ItemType.Disk => new Disk(),
+ ItemType.Display => new Display(),
ItemType.Driver => new Driver(),
ItemType.Extension => new Extension(),
ItemType.Feature => new Feature(),
diff --git a/SabreTools.Library/DatItems/Display.cs b/SabreTools.Library/DatItems/Display.cs
new file mode 100644
index 00000000..18244726
--- /dev/null
+++ b/SabreTools.Library/DatItems/Display.cs
@@ -0,0 +1,473 @@
+using System.Collections.Generic;
+using System.Linq;
+using SabreTools.Library.Filtering;
+using Newtonsoft.Json;
+using SabreTools.Library.Tools;
+
+///
+/// This holds all of the auxiliary types needed for proper parsing
+///
+namespace SabreTools.Library.DatItems
+{
+ ///
+ /// Represents one machine display
+ ///
+ [JsonObject("display")]
+ public class Display : DatItem
+ {
+ #region Fields
+
+ ///
+ /// Display tag
+ ///
+ [JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string Tag { get; set; }
+
+ ///
+ /// Display type
+ ///
+ [JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string DisplayType { get; set; } // TODO: (raster|vector|lcd|svg|unknown)
+
+ ///
+ /// Display rotation
+ ///
+ [JsonProperty("rotate", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string Rotate { get; set; } // TODO: (0|90|180|270) Int32?
+
+ ///
+ /// Determines if display is flipped in the X-coordinates
+ ///
+ [JsonProperty("flipx", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public bool? FlipX { get; set; }
+
+ ///
+ /// Display width
+ ///
+ [JsonProperty("width", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string Width { get; set; } // TODO: Int32?
+
+ ///
+ /// Display height
+ ///
+ [JsonProperty("height", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string Height { get; set; } // TODO: Int32?
+
+ ///
+ /// Refresh rate
+ ///
+ [JsonProperty("refresh", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string Refresh { get; set; } // TODO: Int32? Float?
+
+ ///
+ /// Pixel clock timer
+ ///
+ [JsonProperty("pixclock", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string PixClock { get; set; } // TODO: Int32? Float?
+
+ ///
+ /// Total horizontal lines
+ ///
+ [JsonProperty("htotal", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string HTotal { get; set; } // TODO: Int32? Float?
+
+ ///
+ /// Horizontal blank end
+ ///
+ [JsonProperty("hbend", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string HBEnd { get; set; } // TODO: Int32? Float?
+
+ ///
+ /// Horizontal blank start
+ ///
+ [JsonProperty("hbstart", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string HBStart { get; set; } // TODO: Int32? Float?
+
+ ///
+ /// Total vertical lines
+ ///
+ [JsonProperty("vtotal", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string VTotal { get; set; } // TODO: Int32? Float?
+
+ ///
+ /// Vertical blank end
+ ///
+ [JsonProperty("vbend", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string VBEnd { get; set; } // TODO: Int32? Float?
+
+ ///
+ /// Vertical blank start
+ ///
+ [JsonProperty("vbstart", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ public string VBStart { get; set; } // TODO: Int32? Float?
+
+ #endregion
+
+ #region Accessors
+
+ ///
+ /// Set fields with given values
+ ///
+ /// Mappings dictionary
+ public override void SetFields(Dictionary mappings)
+ {
+ // Set base fields
+ base.SetFields(mappings);
+
+ // Handle Display-specific fields
+ if (mappings.Keys.Contains(Field.DatItem_Tag))
+ Tag = mappings[Field.DatItem_Tag];
+
+ if (mappings.Keys.Contains(Field.DatItem_DisplayType))
+ DisplayType = mappings[Field.DatItem_DisplayType];
+
+ if (mappings.Keys.Contains(Field.DatItem_Rotate))
+ Rotate = mappings[Field.DatItem_Rotate];
+
+ if (mappings.Keys.Contains(Field.DatItem_FlipX))
+ FlipX = mappings[Field.DatItem_FlipX].AsYesNo();
+
+ if (mappings.Keys.Contains(Field.DatItem_Width))
+ Width = mappings[Field.DatItem_Width];
+
+ if (mappings.Keys.Contains(Field.DatItem_Height))
+ Height = mappings[Field.DatItem_Height];
+
+ if (mappings.Keys.Contains(Field.DatItem_Refresh))
+ Refresh = mappings[Field.DatItem_Refresh];
+
+ if (mappings.Keys.Contains(Field.DatItem_PixClock))
+ PixClock = mappings[Field.DatItem_PixClock];
+
+ if (mappings.Keys.Contains(Field.DatItem_HTotal))
+ HTotal = mappings[Field.DatItem_HTotal];
+
+ if (mappings.Keys.Contains(Field.DatItem_HBEnd))
+ HBEnd = mappings[Field.DatItem_HBEnd];
+
+ if (mappings.Keys.Contains(Field.DatItem_HBStart))
+ HBStart = mappings[Field.DatItem_HBStart];
+
+ if (mappings.Keys.Contains(Field.DatItem_VTotal))
+ VTotal = mappings[Field.DatItem_VTotal];
+
+ if (mappings.Keys.Contains(Field.DatItem_VBEnd))
+ VBEnd = mappings[Field.DatItem_VBEnd];
+
+ if (mappings.Keys.Contains(Field.DatItem_VBStart))
+ VBStart = mappings[Field.DatItem_VBStart];
+ }
+
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Create a default, empty Display object
+ ///
+ public Display()
+ {
+ ItemType = ItemType.Display;
+ }
+
+ #endregion
+
+ #region Cloning Methods
+
+ public override object Clone()
+ {
+ return new Display()
+ {
+ 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,
+
+ Tag = this.Tag,
+ DisplayType = this.DisplayType,
+ Rotate = this.Rotate,
+ FlipX = this.FlipX,
+ Width = this.Width,
+ Height = this.Height,
+ Refresh = this.Refresh,
+ PixClock = this.PixClock,
+ HTotal = this.HTotal,
+ HBEnd = this.HBEnd,
+ HBStart = this.HBStart,
+ VTotal = this.VTotal,
+ VBEnd = this.VBEnd,
+ VBStart = this.VBStart,
+ };
+ }
+
+ #endregion
+
+ #region Comparision Methods
+
+ public override bool Equals(DatItem other)
+ {
+ // If we don't have a Display, return false
+ if (ItemType != other.ItemType)
+ return false;
+
+ // Otherwise, treat it as a Display
+ Display newOther = other as Display;
+
+ // If the Display information matches
+ return (Tag == newOther.Tag
+ && DisplayType == newOther.DisplayType
+ && Rotate == newOther.Rotate
+ && FlipX == newOther.FlipX
+ && Width == newOther.Width
+ && Height == newOther.Height
+ && Refresh == newOther.Refresh
+ && PixClock == newOther.PixClock
+ && HTotal == newOther.HTotal
+ && HBEnd == newOther.HBEnd
+ && HBStart == newOther.HBStart
+ && VTotal == newOther.VTotal
+ && VBEnd == newOther.VBEnd
+ && VBStart == newOther.VBStart);
+ }
+
+ #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 tag
+ if (filter.DatItem_Tag.MatchesPositiveSet(Tag) == false)
+ return false;
+ if (filter.DatItem_Tag.MatchesNegativeSet(Tag) == true)
+ return false;
+
+ // Filter on display type
+ if (filter.DatItem_DisplayType.MatchesPositiveSet(DisplayType) == false)
+ return false;
+ if (filter.DatItem_DisplayType.MatchesNegativeSet(DisplayType) == true)
+ return false;
+
+ // Filter on rotation
+ if (filter.DatItem_Rotate.MatchesPositiveSet(Rotate) == false)
+ return false;
+ if (filter.DatItem_Rotate.MatchesNegativeSet(Rotate) == true)
+ return false;
+
+ // Filter on flipx
+ if (filter.DatItem_FlipX.MatchesNeutral(null, FlipX) == false)
+ return false;
+
+ // Filter on width
+ if (filter.DatItem_Width.MatchesPositiveSet(Width) == false)
+ return false;
+ if (filter.DatItem_Width.MatchesNegativeSet(Width) == true)
+ return false;
+
+ // Filter on height
+ if (filter.DatItem_Height.MatchesPositiveSet(Height) == false)
+ return false;
+ if (filter.DatItem_Height.MatchesNegativeSet(Height) == true)
+ return false;
+
+ // Filter on refresh
+ if (filter.DatItem_Refresh.MatchesPositiveSet(Refresh) == false)
+ return false;
+ if (filter.DatItem_Refresh.MatchesNegativeSet(Refresh) == true)
+ return false;
+
+ // Filter on pixclock
+ if (filter.DatItem_PixClock.MatchesPositiveSet(PixClock) == false)
+ return false;
+ if (filter.DatItem_PixClock.MatchesNegativeSet(PixClock) == true)
+ return false;
+
+ // Filter on htotal
+ if (filter.DatItem_HTotal.MatchesPositiveSet(HTotal) == false)
+ return false;
+ if (filter.DatItem_HTotal.MatchesNegativeSet(HTotal) == true)
+ return false;
+
+ // Filter on hbend
+ if (filter.DatItem_HBEnd.MatchesPositiveSet(HBEnd) == false)
+ return false;
+ if (filter.DatItem_HBEnd.MatchesNegativeSet(HBEnd) == true)
+ return false;
+
+ // Filter on hbstart
+ if (filter.DatItem_HBStart.MatchesPositiveSet(HBStart) == false)
+ return false;
+ if (filter.DatItem_HBStart.MatchesNegativeSet(HBStart) == true)
+ return false;
+
+ // Filter on vtotal
+ if (filter.DatItem_VTotal.MatchesPositiveSet(VTotal) == false)
+ return false;
+ if (filter.DatItem_VTotal.MatchesNegativeSet(VTotal) == true)
+ return false;
+
+ // Filter on vbend
+ if (filter.DatItem_VBEnd.MatchesPositiveSet(VBEnd) == false)
+ return false;
+ if (filter.DatItem_VBEnd.MatchesNegativeSet(VBEnd) == true)
+ return false;
+
+ // Filter on vbstart
+ if (filter.DatItem_VBStart.MatchesPositiveSet(VBStart) == false)
+ return false;
+ if (filter.DatItem_VBStart.MatchesNegativeSet(VBStart) == 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_Tag))
+ Tag = null;
+
+ if (fields.Contains(Field.DatItem_DisplayType))
+ DisplayType = null;
+
+ if (fields.Contains(Field.DatItem_Rotate))
+ Rotate = null;
+
+ if (fields.Contains(Field.DatItem_FlipX))
+ FlipX = null;
+
+ if (fields.Contains(Field.DatItem_Width))
+ Width = null;
+
+ if (fields.Contains(Field.DatItem_Height))
+ Height = null;
+
+ if (fields.Contains(Field.DatItem_Refresh))
+ Refresh = null;
+
+ if (fields.Contains(Field.DatItem_PixClock))
+ PixClock = null;
+
+ if (fields.Contains(Field.DatItem_HTotal))
+ HTotal = null;
+
+ if (fields.Contains(Field.DatItem_HBEnd))
+ HBEnd = null;
+
+ if (fields.Contains(Field.DatItem_HBStart))
+ HBStart = null;
+
+ if (fields.Contains(Field.DatItem_VTotal))
+ VTotal = null;
+
+ if (fields.Contains(Field.DatItem_VBEnd))
+ VBEnd = null;
+
+ if (fields.Contains(Field.DatItem_VBStart))
+ VBStart = 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 Display to replace from, ignore specific fields
+ if (item.ItemType != ItemType.Display)
+ return;
+
+ // Cast for easier access
+ Display newItem = item as Display;
+
+ // Replace the fields
+ if (fields.Contains(Field.DatItem_Tag))
+ Tag = newItem.Tag;
+
+ if (fields.Contains(Field.DatItem_DisplayType))
+ DisplayType = newItem.DisplayType;
+
+ if (fields.Contains(Field.DatItem_Rotate))
+ Rotate = newItem.Rotate;
+
+ if (fields.Contains(Field.DatItem_FlipX))
+ FlipX = newItem.FlipX;
+
+ if (fields.Contains(Field.DatItem_Width))
+ Width = newItem.Width;
+
+ if (fields.Contains(Field.DatItem_Height))
+ Height = newItem.Height;
+
+ if (fields.Contains(Field.DatItem_Refresh))
+ Refresh = newItem.Refresh;
+
+ if (fields.Contains(Field.DatItem_PixClock))
+ PixClock = newItem.PixClock;
+
+ if (fields.Contains(Field.DatItem_HTotal))
+ HTotal = newItem.HTotal;
+
+ if (fields.Contains(Field.DatItem_HBEnd))
+ HBEnd = newItem.HBEnd;
+
+ if (fields.Contains(Field.DatItem_HBStart))
+ HBStart = newItem.HBStart;
+
+ if (fields.Contains(Field.DatItem_VTotal))
+ VTotal = newItem.VTotal;
+
+ if (fields.Contains(Field.DatItem_VBEnd))
+ VBEnd = newItem.VBEnd;
+
+ if (fields.Contains(Field.DatItem_VBStart))
+ VBStart = newItem.VBStart;
+ }
+
+ #endregion
+ }
+}
diff --git a/SabreTools.Library/DatItems/Enums.cs b/SabreTools.Library/DatItems/Enums.cs
index 10f956b0..8e1a8cb2 100644
--- a/SabreTools.Library/DatItems/Enums.cs
+++ b/SabreTools.Library/DatItems/Enums.cs
@@ -186,23 +186,6 @@ namespace SabreTools.Library.DatItems
Machine_SourceFile,
Machine_Runnable,
- // Displays
- Machine_Displays,
- Machine_Display_Tag,
- Machine_Display_Type,
- Machine_Display_Rotate,
- Machine_Display_FlipX,
- Machine_Display_Width,
- Machine_Display_Height,
- Machine_Display_Refresh,
- Machine_Display_PixClock,
- Machine_Display_HTotal,
- Machine_Display_HBEnd,
- Machine_Display_HBStart,
- Machine_Display_VTotal,
- Machine_Display_VBEnd,
- Machine_Display_VBStart,
-
// Inputs
Machine_Inputs,
Machine_Input_Service,
@@ -409,6 +392,21 @@ namespace SabreTools.Library.DatItems
DatItem_Value_Value,
DatItem_Value_Default,
+ // Display
+ DatItem_DisplayType,
+ DatItem_Rotate,
+ DatItem_FlipX,
+ DatItem_Width,
+ DatItem_Height,
+ DatItem_Refresh,
+ DatItem_PixClock,
+ DatItem_HTotal,
+ DatItem_HBEnd,
+ DatItem_HBStart,
+ DatItem_VTotal,
+ DatItem_VBEnd,
+ DatItem_VBStart,
+
// Driver
DatItem_SupportStatus,
DatItem_EmulationStatus,
@@ -489,6 +487,7 @@ namespace SabreTools.Library.DatItems
Device,
DeviceReference,
DipSwitch,
+ Display,
Driver,
Extension,
Feature,
diff --git a/SabreTools.Library/DatItems/Machine.cs b/SabreTools.Library/DatItems/Machine.cs
index 91eea2f8..1ede23b0 100644
--- a/SabreTools.Library/DatItems/Machine.cs
+++ b/SabreTools.Library/DatItems/Machine.cs
@@ -152,12 +152,6 @@ namespace SabreTools.Library.DatItems
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
public Runnable Runnable { get; set; } = Runnable.NULL;
- ///
- /// List of associated displays
- ///
- [JsonProperty("displays", DefaultValueHandling = DefaultValueHandling.Ignore)]
- public List Displays { get; set; } = null;
-
///
/// List of associated inputs
///
@@ -366,23 +360,6 @@ namespace SabreTools.Library.DatItems
if (mappings.Keys.Contains(Field.Machine_Runnable))
Runnable = mappings[Field.Machine_Runnable].AsRunnable();
- // TODO: Add Machine_DeviceReference*
- // TODO: Add Machine_Chip*
- // TODO: Add Machine_Display*
- // TODO: Add Machine_Sound*
- // TODO: Add Machine_Condition*
- // TODO: Add Machine_Input*
- // TODO: Add Machine_DipSwitch*
- // TODO: Add Machine_Configuration*
- // TODO: Add Machine_Port*
- // TODO: Add Machine_Adjuster*
- // TODO: Add Machine_Driver*
- // TODO: Add Machine_Feature*
- // TODO: Add Machine_Device*
- // TODO: Add Machine_Slot*
- // TODO: Add Machine_SoftwareList*
- // TODO: Add Machine_RamOption*
-
#endregion
#region Logiqx
@@ -516,7 +493,6 @@ namespace SabreTools.Library.DatItems
SourceFile = this.SourceFile,
Runnable = this.Runnable,
- Displays = this.Displays,
Inputs = this.Inputs,
#endregion
@@ -714,289 +690,6 @@ namespace SabreTools.Library.DatItems
if (filter.Machine_Runnable.MatchesNegative(Runnable.NULL, Runnable) == true)
return false;
- #region Displays
-
- // Machine_Displays
- if (filter.Machine_Displays.MatchesNeutral(null, Displays?.Any() ?? null) == false)
- return false;
-
- // Machine_Display_Tag
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_Tag.MatchesPositiveSet(display?.Tag) != false)
- anyPositive = true;
- if (filter.Machine_Display_Tag.MatchesNegativeSet(display?.Tag) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_Type
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_Type.MatchesPositiveSet(display?.Type) != false)
- anyPositive = true;
- if (filter.Machine_Display_Type.MatchesNegativeSet(display?.Type) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_Rotate
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_Rotate.MatchesPositiveSet(display?.Rotate) != false)
- anyPositive = true;
- if (filter.Machine_Display_Rotate.MatchesNegativeSet(display?.Rotate) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_FlipX
- if (Displays?.Any() == true)
- {
- bool anyNeutral = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_FlipX.MatchesNeutral(null, display?.FlipX) != false)
- anyNeutral = true;
- }
-
- if (!anyNeutral)
- return false;
- }
-
- // Machine_Display_Width
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_Width.MatchesPositiveSet(display?.Width) != false)
- anyPositive = true;
- if (filter.Machine_Display_Width.MatchesNegativeSet(display?.Width) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_Height
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_Height.MatchesPositiveSet(display?.Height) != false)
- anyPositive = true;
- if (filter.Machine_Display_Height.MatchesNegativeSet(display?.Height) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_Refresh
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_Refresh.MatchesPositiveSet(display?.Refresh) != false)
- anyPositive = true;
- if (filter.Machine_Display_Refresh.MatchesNegativeSet(display?.Refresh) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_PixClock
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_PixClock.MatchesPositiveSet(display?.PixClock) != false)
- anyPositive = true;
- if (filter.Machine_Display_PixClock.MatchesNegativeSet(display?.PixClock) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_HTotal
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_HTotal.MatchesPositiveSet(display?.HTotal) != false)
- anyPositive = true;
- if (filter.Machine_Display_HTotal.MatchesNegativeSet(display?.HTotal) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_HBEnd
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_HBEnd.MatchesPositiveSet(display?.HBEnd) != false)
- anyPositive = true;
- if (filter.Machine_Display_HBEnd.MatchesNegativeSet(display?.HBEnd) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_HBStart
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_HBStart.MatchesPositiveSet(display?.HBStart) != false)
- anyPositive = true;
- if (filter.Machine_Display_HBStart.MatchesNegativeSet(display?.HBStart) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_VTotal
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_VTotal.MatchesPositiveSet(display?.VTotal) != false)
- anyPositive = true;
- if (filter.Machine_Display_VTotal.MatchesNegativeSet(display?.VTotal) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_VBEnd
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_VBEnd.MatchesPositiveSet(display?.VBEnd) != false)
- anyPositive = true;
- if (filter.Machine_Display_VBEnd.MatchesNegativeSet(display?.VBEnd) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- // Machine_Display_VBStart
- if (Displays?.Any() == true)
- {
- bool anyPositive = false;
- bool anyNegative = false;
-
- foreach (var display in Displays)
- {
- if (filter.Machine_Display_VBStart.MatchesPositiveSet(display?.VBStart) != false)
- anyPositive = true;
- if (filter.Machine_Display_VBStart.MatchesNegativeSet(display?.VBStart) == true)
- anyNegative = true;
- }
-
- if (!anyPositive)
- return false;
- if (anyNegative)
- return false;
- }
-
- #endregion
-
// TODO: Inputs
// TODO: Inputs.Controls
diff --git a/SabreTools.Library/DatItems/Port.cs b/SabreTools.Library/DatItems/Port.cs
index 1a1eb6a2..e8e5c965 100644
--- a/SabreTools.Library/DatItems/Port.cs
+++ b/SabreTools.Library/DatItems/Port.cs
@@ -42,8 +42,8 @@ namespace SabreTools.Library.DatItems
base.SetFields(mappings);
// Handle Port-specific fields
- if (mappings.Keys.Contains(Field.DatItem_Name))
- Tag = mappings[Field.DatItem_Name];
+ if (mappings.Keys.Contains(Field.DatItem_Tag))
+ Tag = mappings[Field.DatItem_Tag];
// TODO: Handle DatItem_Analog*
}
diff --git a/SabreTools.Library/Filtering/Filter.cs b/SabreTools.Library/Filtering/Filter.cs
index 3a644895..38b9e84b 100644
--- a/SabreTools.Library/Filtering/Filter.cs
+++ b/SabreTools.Library/Filtering/Filter.cs
@@ -51,23 +51,6 @@ namespace SabreTools.Library.Filtering
public FilterItem Machine_SourceFile { get; private set; } = new FilterItem();
public FilterItem Machine_Runnable { get; private set; } = new FilterItem() { Positive = Runnable.NULL, Negative = Runnable.NULL };
- // Displays
- public FilterItem Machine_Displays { get; private set; } = new FilterItem() { Neutral = null };
- public FilterItem Machine_Display_Tag { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_Type { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_Rotate { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_FlipX { get; private set; } = new FilterItem() { Neutral = null };
- public FilterItem Machine_Display_Width { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_Height { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_Refresh { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_PixClock { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_HTotal { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_HBEnd { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_HBStart { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_VTotal { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_VBEnd { get; private set; } = new FilterItem();
- public FilterItem Machine_Display_VBStart { get; private set; } = new FilterItem();
-
// Inputs
public FilterItem Machine_Inputs { get; private set; } = new FilterItem() { Neutral = null };
public FilterItem Machine_Input_Service { get; private set; } = new FilterItem() { Neutral = null };
@@ -274,6 +257,21 @@ namespace SabreTools.Library.Filtering
public FilterItem DatItem_Value_Value { get; private set; } = new FilterItem();
public FilterItem DatItem_Value_Default { get; private set; } = new FilterItem() { Neutral = null };
+ // Display
+ public FilterItem DatItem_DisplayType { get; private set; } = new FilterItem();
+ public FilterItem DatItem_Rotate { get; private set; } = new FilterItem();
+ public FilterItem DatItem_FlipX { get; private set; } = new FilterItem() { Neutral = null };
+ public FilterItem DatItem_Width { get; private set; } = new FilterItem();
+ public FilterItem DatItem_Height { get; private set; } = new FilterItem();
+ public FilterItem DatItem_Refresh { get; private set; } = new FilterItem();
+ public FilterItem DatItem_PixClock { get; private set; } = new FilterItem();
+ public FilterItem DatItem_HTotal { get; private set; } = new FilterItem();
+ public FilterItem DatItem_HBEnd { get; private set; } = new FilterItem();
+ public FilterItem DatItem_HBStart { get; private set; } = new FilterItem();
+ public FilterItem DatItem_VTotal { get; private set; } = new FilterItem();
+ public FilterItem DatItem_VBEnd { get; private set; } = new FilterItem();
+ public FilterItem DatItem_VBStart { get; private set; } = new FilterItem();
+
// Driver
public FilterItem DatItem_SupportStatus { get; private set; } = new FilterItem() { Positive = SupportStatus.NULL, Negative = SupportStatus.NULL };
public FilterItem DatItem_EmulationStatus { get; private set; } = new FilterItem() { Positive = SupportStatus.NULL, Negative = SupportStatus.NULL };
@@ -535,112 +533,6 @@ namespace SabreTools.Library.Filtering
Machine_Runnable.Positive |= value.AsRunnable();
break;
- // Displays
- case Field.Machine_Displays:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- Machine_Displays.Neutral = false;
- else
- Machine_Displays.Neutral = true;
- break;
-
- case Field.Machine_Display_Tag:
- if (negate)
- Machine_Display_Tag.NegativeSet.Add(value);
- else
- Machine_Display_Tag.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_Type:
- if (negate)
- Machine_Display_Type.NegativeSet.Add(value);
- else
- Machine_Display_Type.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_Rotate:
- if (negate)
- Machine_Display_Rotate.NegativeSet.Add(value);
- else
- Machine_Display_Rotate.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_FlipX:
- if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
- Machine_Display_FlipX.Neutral = false;
- else
- Machine_Display_FlipX.Neutral = true;
- break;
-
- case Field.Machine_Display_Width:
- if (negate)
- Machine_Display_Width.NegativeSet.Add(value);
- else
- Machine_Display_Width.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_Height:
- if (negate)
- Machine_Display_Height.NegativeSet.Add(value);
- else
- Machine_Display_Height.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_Refresh:
- if (negate)
- Machine_Display_Refresh.NegativeSet.Add(value);
- else
- Machine_Display_Refresh.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_PixClock:
- if (negate)
- Machine_Display_PixClock.NegativeSet.Add(value);
- else
- Machine_Display_PixClock.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_HTotal:
- if (negate)
- Machine_Display_HTotal.NegativeSet.Add(value);
- else
- Machine_Display_HTotal.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_HBEnd:
- if (negate)
- Machine_Display_HBEnd.NegativeSet.Add(value);
- else
- Machine_Display_HBEnd.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_HBStart:
- if (negate)
- Machine_Display_HBStart.NegativeSet.Add(value);
- else
- Machine_Display_HBStart.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_VTotal:
- if (negate)
- Machine_Display_VTotal.NegativeSet.Add(value);
- else
- Machine_Display_VTotal.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_VBEnd:
- if (negate)
- Machine_Display_VBEnd.NegativeSet.Add(value);
- else
- Machine_Display_VBEnd.PositiveSet.Add(value);
- break;
-
- case Field.Machine_Display_VBStart:
- if (negate)
- Machine_Display_VBStart.NegativeSet.Add(value);
- else
- Machine_Display_VBStart.PositiveSet.Add(value);
- break;
-
// Inputs
case Field.Machine_Inputs:
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
@@ -1601,6 +1493,98 @@ namespace SabreTools.Library.Filtering
DatItem_Value_Default.Neutral = true;
break;
+ // Display
+ case Field.DatItem_DisplayType:
+ if (negate)
+ DatItem_DisplayType.NegativeSet.Add(value);
+ else
+ DatItem_DisplayType.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_Rotate:
+ if (negate)
+ DatItem_Rotate.NegativeSet.Add(value);
+ else
+ DatItem_Rotate.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_FlipX:
+ if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
+ DatItem_FlipX.Neutral = false;
+ else
+ DatItem_FlipX.Neutral = true;
+ break;
+
+ case Field.DatItem_Width:
+ if (negate)
+ DatItem_Width.NegativeSet.Add(value);
+ else
+ DatItem_Width.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_Height:
+ if (negate)
+ DatItem_Height.NegativeSet.Add(value);
+ else
+ DatItem_Height.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_Refresh:
+ if (negate)
+ DatItem_Refresh.NegativeSet.Add(value);
+ else
+ DatItem_Refresh.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_PixClock:
+ if (negate)
+ DatItem_PixClock.NegativeSet.Add(value);
+ else
+ DatItem_PixClock.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_HTotal:
+ if (negate)
+ DatItem_HTotal.NegativeSet.Add(value);
+ else
+ DatItem_HTotal.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_HBEnd:
+ if (negate)
+ DatItem_HBEnd.NegativeSet.Add(value);
+ else
+ DatItem_HBEnd.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_HBStart:
+ if (negate)
+ DatItem_HBStart.NegativeSet.Add(value);
+ else
+ DatItem_HBStart.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_VTotal:
+ if (negate)
+ DatItem_VTotal.NegativeSet.Add(value);
+ else
+ DatItem_VTotal.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_VBEnd:
+ if (negate)
+ DatItem_VBEnd.NegativeSet.Add(value);
+ else
+ DatItem_VBEnd.PositiveSet.Add(value);
+ break;
+
+ case Field.DatItem_VBStart:
+ if (negate)
+ DatItem_VBStart.NegativeSet.Add(value);
+ else
+ DatItem_VBStart.PositiveSet.Add(value);
+ break;
+
// Driver
case Field.DatItem_SupportStatus:
if (negate)
diff --git a/SabreTools.Library/Tools/Converters.cs b/SabreTools.Library/Tools/Converters.cs
index 1f70f01d..e0b8b100 100644
--- a/SabreTools.Library/Tools/Converters.cs
+++ b/SabreTools.Library/Tools/Converters.cs
@@ -572,51 +572,6 @@ namespace SabreTools.Library.Tools
case "runnable":
return Field.Machine_Runnable;
- case "displays":
- return Field.Machine_Displays;
-
- case "display_tag":
- return Field.Machine_Display_Tag;
-
- case "display_type":
- return Field.Machine_Display_Type;
-
- case "display_rotate":
- return Field.Machine_Display_Rotate;
-
- case "display_flipx":
- return Field.Machine_Display_FlipX;
-
- case "display_width":
- return Field.Machine_Display_Width;
-
- case "display_height":
- return Field.Machine_Display_Height;
-
- case "display_refresh":
- return Field.Machine_Display_Refresh;
-
- case "display_pixclock":
- return Field.Machine_Display_PixClock;
-
- case "display_htotal":
- return Field.Machine_Display_HTotal;
-
- case "display_hbend":
- return Field.Machine_Display_HBEnd;
-
- case "display_hbstart":
- return Field.Machine_Display_HBStart;
-
- case "display_vtotal":
- return Field.Machine_Display_VTotal;
-
- case "display_vbend":
- return Field.Machine_Display_VBEnd;
-
- case "display_vbstart":
- return Field.Machine_Display_VBStart;
-
case "inputs":
return Field.Machine_Inputs;
@@ -1080,6 +1035,46 @@ namespace SabreTools.Library.Tools
case "extension_name":
return Field.DatItem_Extension_Name;
+ // Display
+ case "displaytype":
+ return Field.DatItem_DisplayType;
+
+ case "rotate":
+ return Field.DatItem_Rotate;
+
+ case "flipx":
+ return Field.DatItem_FlipX;
+
+ case "width":
+ return Field.DatItem_Width;
+
+ case "height":
+ return Field.DatItem_Height;
+
+ case "refresh":
+ return Field.DatItem_Refresh;
+
+ case "pixclock":
+ return Field.DatItem_PixClock;
+
+ case "htotal":
+ return Field.DatItem_HTotal;
+
+ case "hbend":
+ return Field.DatItem_HBEnd;
+
+ case "hbstart":
+ return Field.DatItem_HBStart;
+
+ case "vtotal":
+ return Field.DatItem_VTotal;
+
+ case "vbend":
+ return Field.DatItem_VBEnd;
+
+ case "vbstart":
+ return Field.DatItem_VBStart;
+
// Driver
case "supportstatus":
return Field.DatItem_SupportStatus;
@@ -1670,6 +1665,8 @@ namespace SabreTools.Library.Tools
return ItemType.DipSwitch;
case "disk":
return ItemType.Disk;
+ case "display":
+ return ItemType.Display;
case "driver":
return ItemType.Driver;
case "extension":
@@ -1714,6 +1711,7 @@ namespace SabreTools.Library.Tools
"device_ref" => ItemType.DeviceReference,
"dipswitch" => ItemType.DipSwitch,
"disk" => ItemType.Disk,
+ "display" => ItemType.Display,
"driver" => ItemType.Driver,
"extension" => ItemType.Extension,
"feature" => ItemType.Feature,
@@ -2293,6 +2291,8 @@ namespace SabreTools.Library.Tools
return "dipswitch";
case ItemType.Disk:
return "disk";
+ case ItemType.Display:
+ return "display";
case ItemType.Driver:
return "driver";
case ItemType.Extension:
@@ -2337,6 +2337,7 @@ namespace SabreTools.Library.Tools
ItemType.DeviceReference => "device_ref",
ItemType.DipSwitch => "dipswitch",
ItemType.Disk => "disk",
+ ItemType.Display => "display",
ItemType.Driver => "driver",
ItemType.Extension => "extension",
ItemType.Feature => "feature",