mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL] Add device non-merged option
This is a special merging mode that counts on newer versions of MAME not respecting the romof tags, leaving parents with files that are not actually required by the children. This new merging mode ignores those romof and cloneof tags, using devices only to add more required roms.
This commit is contained in:
@@ -279,6 +279,7 @@
|
||||
Merged,
|
||||
FullNonMerged,
|
||||
Split,
|
||||
DeviceNonMerged
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -381,6 +381,28 @@ namespace SabreTools.Library.Dats
|
||||
|
||||
#region Merging/Splitting Methods
|
||||
|
||||
/// <summary>
|
||||
/// Use cdevice_ref tags to get full non-merged sets and remove parenting tags
|
||||
/// </summary>
|
||||
/// <param name="mergeroms">True if roms should be deduped, false otherwise</param>
|
||||
public void CreateDeviceNonMergedSets(bool mergeroms)
|
||||
{
|
||||
Globals.Logger.User("Creating device non-merged sets from the DAT");
|
||||
|
||||
// For sake of ease, the first thing we want to do is sort by game
|
||||
BucketBy(SortedBy.Game, mergeroms, norename: true);
|
||||
_sortedBy = SortedBy.Default;
|
||||
|
||||
// Now we want to loop through all of the games and set the correct information
|
||||
AddRomsFromDevices();
|
||||
|
||||
// Then, remove the romof and cloneof tags so it's not picked up by the manager
|
||||
RemoveTagsFromChild();
|
||||
|
||||
// Finally, remove all sets that are labeled as bios or device
|
||||
//RemoveBiosAndDeviceSets(logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use cloneof tags to create non-merged sets and remove the tags plus using the device_ref tags to get full sets
|
||||
/// </summary>
|
||||
|
||||
@@ -180,6 +180,9 @@ namespace SabreTools.Library.Dats
|
||||
// Now we pre-process the DAT with the splitting/merging mode
|
||||
switch (splitType)
|
||||
{
|
||||
case SplitType.DeviceNonMerged:
|
||||
CreateDeviceNonMergedSets(false);
|
||||
break;
|
||||
case SplitType.FullNonMerged:
|
||||
CreateFullyNonMergedSets(false);
|
||||
break;
|
||||
|
||||
@@ -597,6 +597,11 @@ Options:
|
||||
parent set based on the cloneof tag. This is incompatible with the
|
||||
other --dat-X flags.
|
||||
|
||||
-dnd, --dat-devnonmerged Force creating device non-merged sets
|
||||
Preprocess the DAT to have child sets contain all items from the
|
||||
device references. This is incompatible with the other --dat-X
|
||||
flags.
|
||||
|
||||
-df, --dat-fullnonmerged Force creating fully non-merged sets
|
||||
Preprocess the DAT to have child sets contain all items from the
|
||||
parent sets based on the cloneof and romof tags as well as device
|
||||
|
||||
@@ -1100,6 +1100,11 @@ namespace SabreTools
|
||||
"Create non-merged sets",
|
||||
FeatureType.Flag,
|
||||
null));
|
||||
update.AddFeature("dat-devnonmerged", new Feature(
|
||||
new List<string>() { "-dnd", "--dat-devnonmerged" },
|
||||
"Create device non-merged sets",
|
||||
FeatureType.Flag,
|
||||
null));
|
||||
update.AddFeature("dat-fullnonmerged", new Feature(
|
||||
new List<string>() { "-df", "--dat-fullnonmerged" },
|
||||
"Create fully non-merged sets",
|
||||
|
||||
@@ -356,6 +356,10 @@ namespace SabreTools
|
||||
case "--dat-merged":
|
||||
splitType = SplitType.Merged;
|
||||
break;
|
||||
case "-dnd":
|
||||
case "--dat-devnonmerged":
|
||||
splitType = SplitType.DeviceNonMerged;
|
||||
break;
|
||||
case "-dnm":
|
||||
case "--dat-nonmerged":
|
||||
splitType = SplitType.NonMerged;
|
||||
|
||||
Reference in New Issue
Block a user