mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] Fully implement full merge
This commit is contained in:
@@ -386,6 +386,11 @@ namespace SabreTools.Helper.Dats
|
|||||||
List<string> games = Keys.ToList();
|
List<string> games = Keys.ToList();
|
||||||
foreach (string game in games)
|
foreach (string game in games)
|
||||||
{
|
{
|
||||||
|
if (game.Contains("galaga"))
|
||||||
|
{
|
||||||
|
logger.Verbose("");
|
||||||
|
}
|
||||||
|
|
||||||
// Determine if the game has any devices or not
|
// Determine if the game has any devices or not
|
||||||
if (this[game][0].Machine.Devices.Count > 0)
|
if (this[game][0].Machine.Devices.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -581,9 +586,12 @@ namespace SabreTools.Helper.Dats
|
|||||||
games = Keys.ToList();
|
games = Keys.ToList();
|
||||||
foreach (string game in games)
|
foreach (string game in games)
|
||||||
{
|
{
|
||||||
if (this[game][0].Machine.MachineType == MachineType.Bios || this[game][0].Machine.MachineType == MachineType.Device)
|
if (this[game].Count > 0)
|
||||||
{
|
{
|
||||||
Remove(game);
|
if (this[game][0].Machine.MachineType == MachineType.Bios || this[game][0].Machine.MachineType == MachineType.Device)
|
||||||
|
{
|
||||||
|
Remove(game);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1265,6 +1265,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
CloneOf = xtr.GetAttribute("cloneof") ?? "",
|
CloneOf = xtr.GetAttribute("cloneof") ?? "",
|
||||||
SampleOf = xtr.GetAttribute("sampleof") ?? "",
|
SampleOf = xtr.GetAttribute("sampleof") ?? "",
|
||||||
|
|
||||||
|
Devices = new List<string>(),
|
||||||
MachineType =
|
MachineType =
|
||||||
xtr.GetAttribute("isbios") == "yes" ? MachineType.Bios :
|
xtr.GetAttribute("isbios") == "yes" ? MachineType.Bios :
|
||||||
xtr.GetAttribute("isdevice") == "yes" ? MachineType.Device :
|
xtr.GetAttribute("isdevice") == "yes" ? MachineType.Device :
|
||||||
@@ -1273,6 +1274,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
Runnable = xtr.GetAttribute("runnable") == "yes" || xtr.GetAttribute("runnable") == null,
|
Runnable = xtr.GetAttribute("runnable") == "yes" || xtr.GetAttribute("runnable") == null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get the supported value from the reader
|
||||||
if (subreader.GetAttribute("supported") != null)
|
if (subreader.GetAttribute("supported") != null)
|
||||||
{
|
{
|
||||||
switch (subreader.GetAttribute("supported"))
|
switch (subreader.GetAttribute("supported"))
|
||||||
@@ -1286,7 +1288,6 @@ namespace SabreTools.Helper.Dats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (superdat && !keep)
|
if (superdat && !keep)
|
||||||
{
|
{
|
||||||
string tempout = Regex.Match(machine.Name, @".*?\\(.*)").Groups[1].Value;
|
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);
|
ParseAddHelper(olrom, filter, trim, single, root, clean, logger, out key);
|
||||||
break;
|
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":
|
case "publisher":
|
||||||
publisher = subreader.ReadElementContentAsString();
|
publisher = subreader.ReadElementContentAsString();
|
||||||
break;
|
break;
|
||||||
@@ -1686,6 +1696,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xtr.Skip();
|
xtr.Skip();
|
||||||
break;
|
break;
|
||||||
case "dir":
|
case "dir":
|
||||||
|
|||||||
Reference in New Issue
Block a user