mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Update Driver with new fields
This commit is contained in:
@@ -652,6 +652,10 @@ namespace SabreTools.Core
|
|||||||
EmulationStatus,
|
EmulationStatus,
|
||||||
CocktailStatus,
|
CocktailStatus,
|
||||||
SaveStateStatus,
|
SaveStateStatus,
|
||||||
|
RequiresArtwork,
|
||||||
|
Unofficial,
|
||||||
|
NoSoundHardware,
|
||||||
|
Incomplete,
|
||||||
|
|
||||||
// Extension
|
// Extension
|
||||||
Extension_Name,
|
Extension_Name,
|
||||||
|
|||||||
@@ -665,6 +665,18 @@ namespace SabreTools.Core.Tools
|
|||||||
case "savestatestatus":
|
case "savestatestatus":
|
||||||
return DatItemField.SaveStateStatus;
|
return DatItemField.SaveStateStatus;
|
||||||
|
|
||||||
|
case "requiresartwork":
|
||||||
|
return DatItemField.RequiresArtwork;
|
||||||
|
|
||||||
|
case "unofficial":
|
||||||
|
return DatItemField.Unofficial;
|
||||||
|
|
||||||
|
case "nosoundhardware":
|
||||||
|
return DatItemField.NoSoundHardware;
|
||||||
|
|
||||||
|
case "incomplete":
|
||||||
|
return DatItemField.Incomplete;
|
||||||
|
|
||||||
// Extension
|
// Extension
|
||||||
case "extension_name":
|
case "extension_name":
|
||||||
return DatItemField.Extension_Name;
|
return DatItemField.Extension_Name;
|
||||||
|
|||||||
@@ -569,6 +569,10 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
Emulation = reader.GetAttribute("emulation").AsSupportStatus(),
|
Emulation = reader.GetAttribute("emulation").AsSupportStatus(),
|
||||||
Cocktail = reader.GetAttribute("cocktail").AsSupportStatus(),
|
Cocktail = reader.GetAttribute("cocktail").AsSupportStatus(),
|
||||||
SaveState = reader.GetAttribute("savestate").AsSupported(),
|
SaveState = reader.GetAttribute("savestate").AsSupported(),
|
||||||
|
RequiresArtwork = reader.GetAttribute("requiresartwork").AsYesNo(),
|
||||||
|
Unofficial = reader.GetAttribute("unofficial").AsYesNo(),
|
||||||
|
NoSoundHardware = reader.GetAttribute("nosoundhardware").AsYesNo(),
|
||||||
|
Incomplete = reader.GetAttribute("incomplete").AsYesNo(),
|
||||||
|
|
||||||
Source = new Source
|
Source = new Source
|
||||||
{
|
{
|
||||||
@@ -1592,6 +1596,18 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
xtw.WriteRequiredAttributeString("name", setting.Name);
|
xtw.WriteRequiredAttributeString("name", setting.Name);
|
||||||
xtw.WriteRequiredAttributeString("value", setting.Value);
|
xtw.WriteRequiredAttributeString("value", setting.Value);
|
||||||
xtw.WriteOptionalAttributeString("default", setting.Default.FromYesNo());
|
xtw.WriteOptionalAttributeString("default", setting.Default.FromYesNo());
|
||||||
|
if (setting.ConditionsSpecified)
|
||||||
|
{
|
||||||
|
foreach (var confsettingCondition in setting.Conditions)
|
||||||
|
{
|
||||||
|
xtw.WriteStartElement("condition");
|
||||||
|
xtw.WriteRequiredAttributeString("tag", confsettingCondition.Tag);
|
||||||
|
xtw.WriteRequiredAttributeString("mask", confsettingCondition.Mask);
|
||||||
|
xtw.WriteRequiredAttributeString("relation", confsettingCondition.Relation.FromRelation());
|
||||||
|
xtw.WriteRequiredAttributeString("value", confsettingCondition.Value);
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1731,6 +1747,10 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
xtw.WriteRequiredAttributeString("emulation", driver.Emulation.FromSupportStatus());
|
xtw.WriteRequiredAttributeString("emulation", driver.Emulation.FromSupportStatus());
|
||||||
xtw.WriteOptionalAttributeString("cocktail", driver.Cocktail.FromSupportStatus());
|
xtw.WriteOptionalAttributeString("cocktail", driver.Cocktail.FromSupportStatus());
|
||||||
xtw.WriteRequiredAttributeString("savestate", driver.SaveState.FromSupported(true));
|
xtw.WriteRequiredAttributeString("savestate", driver.SaveState.FromSupported(true));
|
||||||
|
xtw.WriteOptionalAttributeString("requiresartwork", driver.RequiresArtwork.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("unofficial", driver.Unofficial.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("nosoundhardware", driver.NoSoundHardware.FromYesNo());
|
||||||
|
xtw.WriteOptionalAttributeString("incomplete", driver.Incomplete.FromYesNo());
|
||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -826,6 +826,18 @@ namespace SabreTools.DatFiles
|
|||||||
|
|
||||||
if (DatItemMappings.Keys.Contains(DatItemField.SaveStateStatus))
|
if (DatItemMappings.Keys.Contains(DatItemField.SaveStateStatus))
|
||||||
driver.SaveState = DatItemMappings[DatItemField.SaveStateStatus].AsSupported();
|
driver.SaveState = DatItemMappings[DatItemField.SaveStateStatus].AsSupported();
|
||||||
|
|
||||||
|
if (DatItemMappings.Keys.Contains(DatItemField.RequiresArtwork))
|
||||||
|
driver.RequiresArtwork = DatItemMappings[DatItemField.RequiresArtwork].AsYesNo();
|
||||||
|
|
||||||
|
if (DatItemMappings.Keys.Contains(DatItemField.Unofficial))
|
||||||
|
driver.Unofficial = DatItemMappings[DatItemField.Unofficial].AsYesNo();
|
||||||
|
|
||||||
|
if (DatItemMappings.Keys.Contains(DatItemField.NoSoundHardware))
|
||||||
|
driver.NoSoundHardware = DatItemMappings[DatItemField.NoSoundHardware].AsYesNo();
|
||||||
|
|
||||||
|
if (DatItemMappings.Keys.Contains(DatItemField.Incomplete))
|
||||||
|
driver.Incomplete = DatItemMappings[DatItemField.Incomplete].AsYesNo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -58,6 +58,46 @@ namespace SabreTools.DatItems.Formats
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public bool SaveStateSpecified { get { return SaveState != Supported.NULL; } }
|
public bool SaveStateSpecified { get { return SaveState != Supported.NULL; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Requires artwork
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("requiresartwork", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("requiresartwork")]
|
||||||
|
public bool? RequiresArtwork { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool RequiresArtworkSpecified { get { return RequiresArtwork != null; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unofficial
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("unofficial", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("unofficial")]
|
||||||
|
public bool? Unofficial { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool UnofficialSpecified { get { return Unofficial != null; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// No sound hardware
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("nosoundhardware", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("nosoundhardware")]
|
||||||
|
public bool? NoSoundHardware { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool NoSoundHardwareSpecified { get { return NoSoundHardware != null; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Incomplete
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("incomplete", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("incomplete")]
|
||||||
|
public bool? Incomplete { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool IncompleteSpecified { get { return Incomplete != null; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@@ -89,6 +129,10 @@ namespace SabreTools.DatItems.Formats
|
|||||||
Emulation = this.Emulation,
|
Emulation = this.Emulation,
|
||||||
Cocktail = this.Cocktail,
|
Cocktail = this.Cocktail,
|
||||||
SaveState = this.SaveState,
|
SaveState = this.SaveState,
|
||||||
|
RequiresArtwork = this.RequiresArtwork,
|
||||||
|
Unofficial = this.Unofficial,
|
||||||
|
NoSoundHardware = this.NoSoundHardware,
|
||||||
|
Incomplete = this.Incomplete,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +153,11 @@ namespace SabreTools.DatItems.Formats
|
|||||||
return (Status == newOther.Status
|
return (Status == newOther.Status
|
||||||
&& Emulation == newOther.Emulation
|
&& Emulation == newOther.Emulation
|
||||||
&& Cocktail == newOther.Cocktail
|
&& Cocktail == newOther.Cocktail
|
||||||
&& SaveState == newOther.SaveState);
|
&& SaveState == newOther.SaveState
|
||||||
|
&& RequiresArtwork == newOther.RequiresArtwork
|
||||||
|
&& Unofficial == newOther.Unofficial
|
||||||
|
&& NoSoundHardware == newOther.NoSoundHardware
|
||||||
|
&& Incomplete == newOther.Incomplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -143,6 +143,10 @@ namespace SabreTools.Filtering
|
|||||||
public FilterItem<SupportStatus> EmulationStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = Core.SupportStatus.NULL, Negative = Core.SupportStatus.NULL };
|
public FilterItem<SupportStatus> EmulationStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = Core.SupportStatus.NULL, Negative = Core.SupportStatus.NULL };
|
||||||
public FilterItem<SupportStatus> CocktailStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = Core.SupportStatus.NULL, Negative = Core.SupportStatus.NULL };
|
public FilterItem<SupportStatus> CocktailStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = Core.SupportStatus.NULL, Negative = Core.SupportStatus.NULL };
|
||||||
public FilterItem<Supported> SaveStateStatus { get; private set; } = new FilterItem<Supported>() { Positive = Supported.NULL, Negative = Supported.NULL };
|
public FilterItem<Supported> SaveStateStatus { get; private set; } = new FilterItem<Supported>() { Positive = Supported.NULL, Negative = Supported.NULL };
|
||||||
|
public FilterItem<bool?> RequiresArtwork { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<bool?> Unofficial { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<bool?> NoSoundHardware { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
public FilterItem<bool?> Incomplete { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
|
||||||
// Extension
|
// Extension
|
||||||
public FilterItem<string> Extension_Name { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> Extension_Name { get; private set; } = new FilterItem<string>();
|
||||||
@@ -653,6 +657,22 @@ namespace SabreTools.Filtering
|
|||||||
SaveStateStatus.Positive |= value.AsSupported();
|
SaveStateStatus.Positive |= value.AsSupported();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DatItemField.RequiresArtwork:
|
||||||
|
SetBooleanFilter(RequiresArtwork, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DatItemField.Unofficial:
|
||||||
|
SetBooleanFilter(Unofficial, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DatItemField.NoSoundHardware:
|
||||||
|
SetBooleanFilter(NoSoundHardware, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DatItemField.Incomplete:
|
||||||
|
SetBooleanFilter(Incomplete, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
// Extension
|
// Extension
|
||||||
case DatItemField.Extension_Name:
|
case DatItemField.Extension_Name:
|
||||||
SetStringFilter(Extension_Name, value, negate);
|
SetStringFilter(Extension_Name, value, negate);
|
||||||
@@ -1431,6 +1451,22 @@ namespace SabreTools.Filtering
|
|||||||
if (SaveStateStatus.MatchesNegative(Supported.NULL, driver.SaveState) == true)
|
if (SaveStateStatus.MatchesNegative(Supported.NULL, driver.SaveState) == true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Filter on requires artwork
|
||||||
|
if (!PassBoolFilter(RequiresArtwork, driver.RequiresArtwork))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on unofficial
|
||||||
|
if (!PassBoolFilter(Unofficial, driver.Unofficial))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on no sound hardware
|
||||||
|
if (!PassBoolFilter(NoSoundHardware, driver.NoSoundHardware))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on incomplete
|
||||||
|
if (!PassBoolFilter(Incomplete, driver.Incomplete))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -666,6 +666,18 @@ namespace SabreTools.Filtering
|
|||||||
|
|
||||||
if (DatItemFields.Contains(DatItemField.SaveStateStatus))
|
if (DatItemFields.Contains(DatItemField.SaveStateStatus))
|
||||||
driver.SaveState = Supported.NULL;
|
driver.SaveState = Supported.NULL;
|
||||||
|
|
||||||
|
if (DatItemFields.Contains(DatItemField.RequiresArtwork))
|
||||||
|
driver.RequiresArtwork = null;
|
||||||
|
|
||||||
|
if (DatItemFields.Contains(DatItemField.Unofficial))
|
||||||
|
driver.Unofficial = null;
|
||||||
|
|
||||||
|
if (DatItemFields.Contains(DatItemField.NoSoundHardware))
|
||||||
|
driver.NoSoundHardware = null;
|
||||||
|
|
||||||
|
if (DatItemFields.Contains(DatItemField.Incomplete))
|
||||||
|
driver.Incomplete = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -608,6 +608,18 @@ namespace SabreTools.Filtering
|
|||||||
|
|
||||||
if (datItemFields.Contains(DatItemField.SaveStateStatus))
|
if (datItemFields.Contains(DatItemField.SaveStateStatus))
|
||||||
driver.SaveState = newItem.SaveState;
|
driver.SaveState = newItem.SaveState;
|
||||||
|
|
||||||
|
if (datItemFields.Contains(DatItemField.RequiresArtwork))
|
||||||
|
driver.RequiresArtwork = newItem.RequiresArtwork;
|
||||||
|
|
||||||
|
if (datItemFields.Contains(DatItemField.Unofficial))
|
||||||
|
driver.Unofficial = newItem.Unofficial;
|
||||||
|
|
||||||
|
if (datItemFields.Contains(DatItemField.NoSoundHardware))
|
||||||
|
driver.NoSoundHardware = newItem.NoSoundHardware;
|
||||||
|
|
||||||
|
if (datItemFields.Contains(DatItemField.Incomplete))
|
||||||
|
driver.Incomplete = newItem.Incomplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user