[DatFile] Fully implement full merge

This commit is contained in:
Matt Nadareski
2017-01-09 16:46:15 -08:00
parent 14915d5918
commit 93b0039f56
2 changed files with 23 additions and 4 deletions

View File

@@ -1265,6 +1265,7 @@ namespace SabreTools.Helper.Dats
CloneOf = xtr.GetAttribute("cloneof") ?? "",
SampleOf = xtr.GetAttribute("sampleof") ?? "",
Devices = new List<string>(),
MachineType =
xtr.GetAttribute("isbios") == "yes" ? MachineType.Bios :
xtr.GetAttribute("isdevice") == "yes" ? MachineType.Device :
@@ -1273,6 +1274,7 @@ namespace SabreTools.Helper.Dats
Runnable = xtr.GetAttribute("runnable") == "yes" || xtr.GetAttribute("runnable") == null,
};
// Get the supported value from the reader
if (subreader.GetAttribute("supported") != null)
{
switch (subreader.GetAttribute("supported"))
@@ -1286,7 +1288,6 @@ namespace SabreTools.Helper.Dats
}
}
if (superdat && !keep)
{
string tempout = Regex.Match(machine.Name, @".*?\\(.*)").Groups[1].Value;
@@ -1363,7 +1364,16 @@ namespace SabreTools.Helper.Dats
ParseAddHelper(olrom, filter, trim, single, root, clean, logger, out key);
break;
// For Software List only
// For Software List and MAME listxml only
case "device_ref":
string device = subreader.GetAttribute("name");
if (!machine.Devices.Contains(device))
{
machine.Devices.Add(device);
}
subreader.Read();
break;
case "publisher":
publisher = subreader.ReadElementContentAsString();
break;
@@ -1686,6 +1696,7 @@ namespace SabreTools.Helper.Dats
break;
}
}
xtr.Skip();
break;
case "dir":