mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
All OpenMSX fields are Rom-only
This is one of the single largest reductions in boilerplate items because of the nature of the change. Unfortunately, a lot of cases won't see *too* much improvement since most DatFiles use Rom heavily.
This commit is contained in:
@@ -252,8 +252,14 @@ namespace SabreTools.Library.DatFiles
|
||||
// If we have any items, loop through and add them
|
||||
foreach (DatItem item in items)
|
||||
{
|
||||
switch (item.ItemType)
|
||||
{
|
||||
case ItemType.Rom:
|
||||
(item as Rom).Original = original;
|
||||
break;
|
||||
}
|
||||
|
||||
item.CopyMachineInformation(machine);
|
||||
item.Original = original;
|
||||
ParseAddHelper(item);
|
||||
}
|
||||
|
||||
@@ -705,12 +711,12 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteEndElement();
|
||||
}
|
||||
|
||||
switch (datItem.OpenMSXSubType)
|
||||
switch (rom.OpenMSXSubType)
|
||||
{
|
||||
// Default to Rom for converting from other formats
|
||||
case OpenMSXSubType.Rom:
|
||||
case OpenMSXSubType.NULL:
|
||||
xtw.WriteStartElement(datItem.OpenMSXSubType.FromOpenMSXSubType());
|
||||
xtw.WriteStartElement(rom.OpenMSXSubType.FromOpenMSXSubType());
|
||||
xtw.WriteRequiredElementString("hash", rom.SHA1?.ToLowerInvariant());
|
||||
xtw.WriteOptionalElementString("start", rom.Offset);
|
||||
xtw.WriteOptionalElementString("type", rom.OpenMSXType);
|
||||
@@ -719,7 +725,7 @@ namespace SabreTools.Library.DatFiles
|
||||
break;
|
||||
|
||||
case OpenMSXSubType.MegaRom:
|
||||
xtw.WriteStartElement(datItem.OpenMSXSubType.FromOpenMSXSubType());
|
||||
xtw.WriteStartElement(rom.OpenMSXSubType.FromOpenMSXSubType());
|
||||
xtw.WriteRequiredElementString("hash", rom.SHA1?.ToLowerInvariant());
|
||||
xtw.WriteOptionalElementString("start", rom.Offset);
|
||||
xtw.WriteOptionalElementString("type", rom.OpenMSXType);
|
||||
@@ -728,7 +734,7 @@ namespace SabreTools.Library.DatFiles
|
||||
break;
|
||||
|
||||
case OpenMSXSubType.SCCPlusCart:
|
||||
xtw.WriteStartElement(datItem.OpenMSXSubType.FromOpenMSXSubType());
|
||||
xtw.WriteStartElement(rom.OpenMSXSubType.FromOpenMSXSubType());
|
||||
xtw.WriteOptionalElementString("boot", rom.Boot);
|
||||
xtw.WriteRequiredElementString("hash", rom.SHA1?.ToLowerInvariant());
|
||||
xtw.WriteOptionalElementString("remark", rom.Remark);
|
||||
|
||||
@@ -101,12 +101,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -64,12 +64,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -77,12 +77,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -95,12 +95,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -32,12 +32,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -106,12 +106,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -99,12 +99,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -140,12 +140,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -164,12 +164,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -66,42 +66,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
[JsonProperty("original", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public Original Original { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
[JsonProperty("openmsx_subtype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public OpenMSXSubType OpenMSXSubType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
/// <remarks>Not related to the subtype above</remarks>
|
||||
[JsonProperty("openmsx_type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string OpenMSXType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Item remark (like a comment)
|
||||
/// </summary>
|
||||
[JsonProperty("remark", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Boot state
|
||||
/// </summary>
|
||||
[JsonProperty("boot", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Boot { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Metadata information
|
||||
|
||||
/// <summary>
|
||||
@@ -337,25 +301,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltTitle = mappings[Field.DatItem_AltTitle];
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Original))
|
||||
Original = new Original() { Content = mappings[Field.DatItem_Original] };
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_OpenMSXSubType))
|
||||
OpenMSXSubType = mappings[Field.DatItem_OpenMSXSubType].AsOpenMSXSubType();
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_OpenMSXType))
|
||||
OpenMSXType = mappings[Field.DatItem_OpenMSXType];
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Remark))
|
||||
Remark = mappings[Field.DatItem_Remark];
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Boot))
|
||||
Boot = mappings[Field.DatItem_Boot];
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -700,40 +645,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
// Filter on original
|
||||
if (filter.DatItem_Original.MatchesPositiveSet(Original?.Content) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Original.MatchesNegativeSet(Original?.Content) == true)
|
||||
return false;
|
||||
|
||||
// Filter on OpenMSX subtype
|
||||
if (filter.DatItem_OpenMSXSubType.MatchesPositiveSet(OpenMSXSubType) == false)
|
||||
return false;
|
||||
if (filter.DatItem_OpenMSXSubType.MatchesNegativeSet(OpenMSXSubType) == true)
|
||||
return false;
|
||||
|
||||
// Filter on OpenMSX type
|
||||
if (filter.DatItem_OpenMSXType.MatchesPositiveSet(OpenMSXType) == false)
|
||||
return false;
|
||||
if (filter.DatItem_OpenMSXType.MatchesNegativeSet(OpenMSXType) == true)
|
||||
return false;
|
||||
|
||||
// Filter on remark
|
||||
if (filter.DatItem_Remark.MatchesPositiveSet(Remark) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Remark.MatchesNegativeSet(Remark) == true)
|
||||
return false;
|
||||
|
||||
// Filter on boot
|
||||
if (filter.DatItem_Boot.MatchesPositiveSet(Boot) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Boot.MatchesNegativeSet(Boot) == true)
|
||||
return false;
|
||||
|
||||
#endregion
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -755,25 +666,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltTitle = null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
if (fields.Contains(Field.DatItem_Original))
|
||||
Original = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXSubType))
|
||||
OpenMSXSubType = OpenMSXSubType.NULL;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXType))
|
||||
OpenMSXType = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Remark))
|
||||
Remark = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Boot))
|
||||
Boot = null;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -872,25 +764,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltTitle = item.AltTitle;
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
if (fields.Contains(Field.DatItem_Original))
|
||||
Original = item.Original;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXSubType))
|
||||
OpenMSXSubType = item.OpenMSXSubType;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXType))
|
||||
OpenMSXType = item.OpenMSXType;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Remark))
|
||||
Remark = item.Remark;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Boot))
|
||||
Boot = item.Boot;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -115,12 +115,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -77,12 +77,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -158,12 +158,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -230,12 +230,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
@@ -269,12 +263,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -181,12 +181,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -97,12 +97,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// List of valid field types within a DatItem/Machine
|
||||
/// </summary>
|
||||
/// TODO: Move this to a more common location
|
||||
/// TODO: Should this be split into separate enums?
|
||||
/// TODO: Ensure the order of these after all shuffling
|
||||
public enum Field : int
|
||||
{
|
||||
NULL = 0,
|
||||
@@ -241,16 +241,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
DatItem_Original,
|
||||
DatItem_OpenMSXSubType,
|
||||
DatItem_OpenMSXType,
|
||||
DatItem_Remark,
|
||||
DatItem_Boot,
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
// Part
|
||||
@@ -291,6 +281,13 @@ namespace SabreTools.Library.DatItems
|
||||
DatItem_Optional,
|
||||
DatItem_Inverted,
|
||||
|
||||
// Rom (OpenMSX)
|
||||
DatItem_Original,
|
||||
DatItem_OpenMSXSubType,
|
||||
DatItem_OpenMSXType,
|
||||
DatItem_Remark,
|
||||
DatItem_Boot,
|
||||
|
||||
// Rom (SoftwareList)
|
||||
DatItem_AreaName,
|
||||
DatItem_AreaSize,
|
||||
|
||||
@@ -77,12 +77,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -87,12 +87,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -85,12 +85,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -99,12 +99,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -86,12 +86,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -94,12 +94,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -142,12 +142,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
@@ -173,12 +167,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -74,12 +74,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -95,12 +95,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -117,12 +117,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -171,6 +171,42 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
[JsonProperty("original", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public Original Original { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
[JsonProperty("openmsx_subtype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public OpenMSXSubType OpenMSXSubType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
/// <remarks>Not related to the subtype above</remarks>
|
||||
[JsonProperty("openmsx_type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string OpenMSXType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Item remark (like a comment)
|
||||
/// </summary>
|
||||
[JsonProperty("remark", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Boot state
|
||||
/// </summary>
|
||||
[JsonProperty("boot", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Boot { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
/// <summary>
|
||||
@@ -284,6 +320,25 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Original))
|
||||
Original = new Original() { Content = mappings[Field.DatItem_Original] };
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_OpenMSXSubType))
|
||||
OpenMSXSubType = mappings[Field.DatItem_OpenMSXSubType].AsOpenMSXSubType();
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_OpenMSXType))
|
||||
OpenMSXType = mappings[Field.DatItem_OpenMSXType];
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Remark))
|
||||
Remark = mappings[Field.DatItem_Remark];
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Boot))
|
||||
Boot = mappings[Field.DatItem_Boot];
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_AreaName))
|
||||
@@ -760,6 +815,40 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
// Filter on original
|
||||
if (filter.DatItem_Original.MatchesPositiveSet(Original?.Content) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Original.MatchesNegativeSet(Original?.Content) == true)
|
||||
return false;
|
||||
|
||||
// Filter on OpenMSX subtype
|
||||
if (filter.DatItem_OpenMSXSubType.MatchesPositiveSet(OpenMSXSubType) == false)
|
||||
return false;
|
||||
if (filter.DatItem_OpenMSXSubType.MatchesNegativeSet(OpenMSXSubType) == true)
|
||||
return false;
|
||||
|
||||
// Filter on OpenMSX type
|
||||
if (filter.DatItem_OpenMSXType.MatchesPositiveSet(OpenMSXType) == false)
|
||||
return false;
|
||||
if (filter.DatItem_OpenMSXType.MatchesNegativeSet(OpenMSXType) == true)
|
||||
return false;
|
||||
|
||||
// Filter on remark
|
||||
if (filter.DatItem_Remark.MatchesPositiveSet(Remark) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Remark.MatchesNegativeSet(Remark) == true)
|
||||
return false;
|
||||
|
||||
// Filter on boot
|
||||
if (filter.DatItem_Boot.MatchesPositiveSet(Boot) == false)
|
||||
return false;
|
||||
if (filter.DatItem_Boot.MatchesNegativeSet(Boot) == true)
|
||||
return false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
// Filter on area name
|
||||
@@ -887,6 +976,25 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
if (fields.Contains(Field.DatItem_Original))
|
||||
Original = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXSubType))
|
||||
OpenMSXSubType = OpenMSXSubType.NULL;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXType))
|
||||
OpenMSXType = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Remark))
|
||||
Remark = null;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Boot))
|
||||
Boot = null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
if (fields.Contains(Field.DatItem_AreaName))
|
||||
@@ -1101,6 +1209,25 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX
|
||||
|
||||
if (fields.Contains(Field.DatItem_Original))
|
||||
Original = newItem.Original;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXSubType))
|
||||
OpenMSXSubType = newItem.OpenMSXSubType;
|
||||
|
||||
if (fields.Contains(Field.DatItem_OpenMSXType))
|
||||
OpenMSXType = newItem.OpenMSXType;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Remark))
|
||||
Remark = newItem.Remark;
|
||||
|
||||
if (fields.Contains(Field.DatItem_Boot))
|
||||
Boot = newItem.Boot;
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
|
||||
if (fields.Contains(Field.DatItem_AreaName))
|
||||
|
||||
@@ -77,12 +77,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -109,12 +109,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -85,12 +85,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -85,12 +85,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -94,12 +94,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -97,12 +97,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
@@ -64,12 +64,6 @@ namespace SabreTools.Library.DatItems
|
||||
AltName = this.AltName,
|
||||
AltTitle = this.AltTitle,
|
||||
|
||||
Original = this.Original,
|
||||
OpenMSXSubType = this.OpenMSXSubType,
|
||||
OpenMSXType = this.OpenMSXType,
|
||||
Remark = this.Remark,
|
||||
Boot = this.Boot,
|
||||
|
||||
Machine = this.Machine.Clone() as Machine,
|
||||
Source = this.Source.Clone() as Source,
|
||||
Remove = this.Remove,
|
||||
|
||||
Reference in New Issue
Block a user