diff --git a/SabreTools.DatFiles/DatFile.MetadataConverter.cs b/SabreTools.DatFiles/DatFile.MetadataConverter.cs index 220b5ae7..f065dd37 100644 --- a/SabreTools.DatFiles/DatFile.MetadataConverter.cs +++ b/SabreTools.DatFiles/DatFile.MetadataConverter.cs @@ -7,7 +7,7 @@ namespace SabreTools.DatFiles // TODO: Determine which items need to have their values flipped (e.g. Part, DiskArea, DataArea) public partial class DatFile { - #region Converters + #region Converters /// /// Convert metadata information @@ -110,9 +110,8 @@ namespace SabreTools.DatFiles } if (item.ContainsKey(Models.Metadata.Machine.DumpKey)) { - // TODO: Figure out what this maps to - // var items = item.Read(Models.Metadata.Machine.DumpKey); - // ProcessItems(items, machine, filename, indexId, statsOnly); + var items = ReadItemArray(item, Models.Metadata.Machine.DumpKey); + ProcessItems(items, machine, filename, indexId, statsOnly); } if (item.ContainsKey(Models.Metadata.Machine.FeatureKey)) { @@ -600,6 +599,27 @@ namespace SabreTools.DatFiles } } + /// + /// Convert Dump information + /// + /// Array of internal items to convert + /// Machine to use with the converted items + /// Name of the file to be parsed + /// Index ID for the DAT + /// True to only add item statistics while parsing, false otherwise + private void ProcessItems(Models.Metadata.Dump[]? items, DatItems.Machine machine, string filename, int indexId, bool statsOnly) + { + // If the array is null or empty, return without processing + if (items == null || items.Length == 0) + return; + + // Loop through the items and add + foreach (var item in items) + { + // TODO: Handle processing of Dump items (rom, megarom, sccpluscart) + } + } + /// /// Convert Feature information /// diff --git a/SabreTools.DatItems/Formats/Rom.cs b/SabreTools.DatItems/Formats/Rom.cs index 2fecaea0..8abbc343 100644 --- a/SabreTools.DatItems/Formats/Rom.cs +++ b/SabreTools.DatItems/Formats/Rom.cs @@ -1,8 +1,10 @@ -using System.Xml.Serialization; +using System.Reflection; +using System.Xml.Serialization; using Newtonsoft.Json; using SabreTools.Core; using SabreTools.Core.Tools; using SabreTools.FileTypes; +using SabreTools.Filter; namespace SabreTools.DatItems.Formats {