mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add support for inverted CRC flag
This commit is contained in:
@@ -254,6 +254,11 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
private FilterItem<string> Offset = new FilterItem<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Include or exclude offsets
|
||||
/// </summary>
|
||||
private FilterItem<bool?> Inverted = new FilterItem<bool?>();
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion // Private instance variables
|
||||
@@ -779,6 +784,13 @@ namespace SabreTools.Library.DatFiles
|
||||
Offset.PositiveSet.Add(value);
|
||||
break;
|
||||
|
||||
case Field.Inverted:
|
||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||
Inverted.Neutral = false;
|
||||
else
|
||||
Inverted.Neutral = true;
|
||||
break;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1318,6 +1330,10 @@ namespace SabreTools.Library.DatFiles
|
||||
if (this.Optional.MatchesNeutral(null, rom.Optional) == false)
|
||||
return false;
|
||||
|
||||
// Filter on inverted
|
||||
if (this.Inverted.MatchesNeutral(null, rom.Inverted) == false)
|
||||
return false;
|
||||
|
||||
break;
|
||||
|
||||
case ItemType.Sample:
|
||||
@@ -2268,6 +2284,11 @@ namespace SabreTools.Library.DatFiles
|
||||
if (item.ItemType == ItemType.Rom)
|
||||
(item as Rom).Offset = null;
|
||||
}
|
||||
if (field == Field.Inverted)
|
||||
{
|
||||
if (item.ItemType == ItemType.Rom)
|
||||
(item as Rom).Inverted = null;
|
||||
}
|
||||
}
|
||||
|
||||
items[j] = item;
|
||||
|
||||
Reference in New Issue
Block a user