mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add No-Intro ID support
This commit is contained in:
@@ -763,6 +763,7 @@ namespace SabreTools.Core
|
|||||||
|
|
||||||
Board,
|
Board,
|
||||||
RebuildTo,
|
RebuildTo,
|
||||||
|
NoIntroId,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -1120,6 +1120,12 @@ namespace SabreTools.Core.Tools
|
|||||||
case "rebuild_to":
|
case "rebuild_to":
|
||||||
return MachineField.RebuildTo;
|
return MachineField.RebuildTo;
|
||||||
|
|
||||||
|
case "id":
|
||||||
|
case "nointroid":
|
||||||
|
case "nointro_id":
|
||||||
|
case "no_intro_id":
|
||||||
|
return MachineField.NoIntroId;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx EmuArc
|
#region Logiqx EmuArc
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
SourceFile = reader.GetAttribute("sourcefile"),
|
SourceFile = reader.GetAttribute("sourcefile"),
|
||||||
Board = reader.GetAttribute("board"),
|
Board = reader.GetAttribute("board"),
|
||||||
RebuildTo = reader.GetAttribute("rebuildto"),
|
RebuildTo = reader.GetAttribute("rebuildto"),
|
||||||
|
NoIntroId = reader.GetAttribute("id"),
|
||||||
Runnable = reader.GetAttribute("runnable").AsRunnable(), // Used by older DATs
|
Runnable = reader.GetAttribute("runnable").AsRunnable(), // Used by older DATs
|
||||||
|
|
||||||
CloneOf = reader.GetAttribute("cloneof"),
|
CloneOf = reader.GetAttribute("cloneof"),
|
||||||
@@ -950,6 +951,7 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
xtw.WriteAttributeString("ismechanical", "yes");
|
xtw.WriteAttributeString("ismechanical", "yes");
|
||||||
|
|
||||||
xtw.WriteOptionalAttributeString("runnable", datItem.Machine.Runnable.FromRunnable());
|
xtw.WriteOptionalAttributeString("runnable", datItem.Machine.Runnable.FromRunnable());
|
||||||
|
xtw.WriteOptionalAttributeString("id", datItem.Machine.NoIntroId);
|
||||||
|
|
||||||
if (!string.Equals(datItem.Machine.Name, datItem.Machine.CloneOf, StringComparison.OrdinalIgnoreCase))
|
if (!string.Equals(datItem.Machine.Name, datItem.Machine.CloneOf, StringComparison.OrdinalIgnoreCase))
|
||||||
xtw.WriteOptionalAttributeString("cloneof", datItem.Machine.CloneOf);
|
xtw.WriteOptionalAttributeString("cloneof", datItem.Machine.CloneOf);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace SabreTools.DatFiles
|
|||||||
public Dictionary<DatItemField, string> DatItemMappings { get; set; }
|
public Dictionary<DatItemField, string> DatItemMappings { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logging
|
#region Logging
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -367,6 +367,9 @@ namespace SabreTools.DatFiles
|
|||||||
if (MachineMappings.Keys.Contains(MachineField.RebuildTo))
|
if (MachineMappings.Keys.Contains(MachineField.RebuildTo))
|
||||||
machine.RebuildTo = MachineMappings[MachineField.RebuildTo];
|
machine.RebuildTo = MachineMappings[MachineField.RebuildTo];
|
||||||
|
|
||||||
|
if (MachineMappings.Keys.Contains(MachineField.NoIntroId))
|
||||||
|
machine.NoIntroId = MachineMappings[MachineField.NoIntroId];
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx EmuArc
|
#region Logiqx EmuArc
|
||||||
@@ -420,7 +423,7 @@ namespace SabreTools.DatFiles
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set fields with given values
|
/// Set fields with given values
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -708,7 +711,7 @@ namespace SabreTools.DatFiles
|
|||||||
private void SetFields(Disk disk)
|
private void SetFields(Disk disk)
|
||||||
{
|
{
|
||||||
#region Common
|
#region Common
|
||||||
|
|
||||||
if (DatItemMappings.Keys.Contains(DatItemField.MD5))
|
if (DatItemMappings.Keys.Contains(DatItemField.MD5))
|
||||||
disk.MD5 = DatItemMappings[DatItemField.MD5];
|
disk.MD5 = DatItemMappings[DatItemField.MD5];
|
||||||
|
|
||||||
|
|||||||
@@ -201,6 +201,13 @@ namespace SabreTools.DatItems
|
|||||||
[XmlElement("rebuildto")]
|
[XmlElement("rebuildto")]
|
||||||
public string RebuildTo { get; set; } = null;
|
public string RebuildTo { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// No-Intro ID for the game
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("nointroid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("nointroid")]
|
||||||
|
public string NoIntroId { get; set; } = null;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// TODO: Should this be a separate object for TruRip?
|
// TODO: Should this be a separate object for TruRip?
|
||||||
@@ -387,6 +394,7 @@ namespace SabreTools.DatItems
|
|||||||
|
|
||||||
Board = this.Board,
|
Board = this.Board,
|
||||||
RebuildTo = this.RebuildTo,
|
RebuildTo = this.RebuildTo,
|
||||||
|
NoIntroId = this.NoIntroId,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -212,6 +212,9 @@ namespace SabreTools.Filtering
|
|||||||
if (MachineFields.Contains(MachineField.RebuildTo))
|
if (MachineFields.Contains(MachineField.RebuildTo))
|
||||||
machine.RebuildTo = null;
|
machine.RebuildTo = null;
|
||||||
|
|
||||||
|
if (MachineFields.Contains(MachineField.NoIntroId))
|
||||||
|
machine.NoIntroId = null;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx EmuArc
|
#region Logiqx EmuArc
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ namespace SabreTools.Filtering
|
|||||||
|
|
||||||
public FilterItem<string> Board { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> Board { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<string> RebuildTo { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> RebuildTo { get; private set; } = new FilterItem<string>();
|
||||||
|
public FilterItem<string> NoIntroId { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -255,6 +256,10 @@ namespace SabreTools.Filtering
|
|||||||
SetStringFilter(RebuildTo, value, negate);
|
SetStringFilter(RebuildTo, value, negate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MachineField.NoIntroId:
|
||||||
|
SetStringFilter(NoIntroId, value, negate);
|
||||||
|
break;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx EmuArc
|
#region Logiqx EmuArc
|
||||||
@@ -456,6 +461,10 @@ namespace SabreTools.Filtering
|
|||||||
if (!PassStringFilter(RebuildTo, machine.RebuildTo))
|
if (!PassStringFilter(RebuildTo, machine.RebuildTo))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Machine_NoIntroId
|
||||||
|
if (!PassStringFilter(NoIntroId, machine.NoIntroId))
|
||||||
|
return false;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx EmuArc
|
#region Logiqx EmuArc
|
||||||
|
|||||||
@@ -166,6 +166,9 @@ namespace SabreTools.Filtering
|
|||||||
if (machineFields.Contains(MachineField.RebuildTo))
|
if (machineFields.Contains(MachineField.RebuildTo))
|
||||||
machine.RebuildTo = repMachine.RebuildTo;
|
machine.RebuildTo = repMachine.RebuildTo;
|
||||||
|
|
||||||
|
if (machineFields.Contains(MachineField.NoIntroId))
|
||||||
|
machine.NoIntroId = repMachine.NoIntroId;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Logiqx EmuArc
|
#region Logiqx EmuArc
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<dir name="topdir">
|
<dir name="topdir">
|
||||||
<machine name="game1" sourcefile="blah.c" board="newboard" rebuildto="game1" runnable="partial" cloneof="game2" romof="game2" sampleof="game2" isbios="yes" isdevice="no" ismechanical="yes">
|
<machine name="game1" sourcefile="blah.c" board="newboard" rebuildto="game1" runnable="partial" cloneof="game2" romof="game2" sampleof="game2" isbios="yes" isdevice="no" ismechanical="yes" id="0001">
|
||||||
<comment>Not a real game, sorry</comment>
|
<comment>Not a real game, sorry</comment>
|
||||||
<description>Game! (Version 1)</description>
|
<description>Game! (Version 1)</description>
|
||||||
<year>1980</year>
|
<year>1980</year>
|
||||||
|
|||||||
Reference in New Issue
Block a user