diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index 23c82f47..c70b6c26 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -5737,7 +5737,17 @@ namespace SabreTools.Library.DatFiles outfileNames.Add(DatFormat.DOSCenter, CreateOutfileNamesHelper(outDir, ".dc.dat", overwrite)); } - //MAME Listroms + // Logiqx XML + if ((DatFormat & DatFormat.Logiqx) != 0) + { + outfileNames.Add(DatFormat.Logiqx, CreateOutfileNamesHelper(outDir, ".xml", overwrite)); + } + if ((DatFormat & DatFormat.LogiqxDepreciated) != 0) + { + outfileNames.Add(DatFormat.LogiqxDepreciated, CreateOutfileNamesHelper(outDir, ".xml", overwrite)); + } + + // MAME Listroms if ((DatFormat & DatFormat.Listrom) != 0 && (DatFormat & DatFormat.AttractMode) == 0) { @@ -5749,14 +5759,22 @@ namespace SabreTools.Library.DatFiles outfileNames.Add(DatFormat.Listrom, CreateOutfileNamesHelper(outDir, ".lr.txt", overwrite)); } - // Logiqx XML - if ((DatFormat & DatFormat.Logiqx) != 0) + // MAME Listxml + if (((DatFormat & DatFormat.Listxml) != 0) + && (DatFormat & DatFormat.Logiqx) == 0 + && (DatFormat & DatFormat.LogiqxDepreciated) == 0 + && (DatFormat & DatFormat.SabreDat) == 0 + && (DatFormat & DatFormat.SoftwareList) == 0) { - outfileNames.Add(DatFormat.Logiqx, CreateOutfileNamesHelper(outDir, ".xml", overwrite)); + outfileNames.Add(DatFormat.Listxml, CreateOutfileNamesHelper(outDir, ".xml", overwrite)); } - if ((DatFormat & DatFormat.LogiqxDepreciated) != 0) + if (((DatFormat & DatFormat.Listxml) != 0 + && ((DatFormat & DatFormat.Logiqx) != 0 + || (DatFormat & DatFormat.LogiqxDepreciated) != 0 + || (DatFormat & DatFormat.SabreDat) != 0 + || (DatFormat & DatFormat.SoftwareList) != 0))) { - outfileNames.Add(DatFormat.LogiqxDepreciated, CreateOutfileNamesHelper(outDir, ".xml", overwrite)); + outfileNames.Add(DatFormat.Listxml, CreateOutfileNamesHelper(outDir, ".mame.xml", overwrite)); } // Missfile @@ -5775,6 +5793,7 @@ namespace SabreTools.Library.DatFiles if (((DatFormat & DatFormat.OfflineList) != 0) && (DatFormat & DatFormat.Logiqx) == 0 && (DatFormat & DatFormat.LogiqxDepreciated) == 0 + && (DatFormat & DatFormat.Listxml) == 0 && (DatFormat & DatFormat.SabreDat) == 0 && (DatFormat & DatFormat.SoftwareList) == 0) { @@ -5783,6 +5802,7 @@ namespace SabreTools.Library.DatFiles if (((DatFormat & DatFormat.OfflineList) != 0 && ((DatFormat & DatFormat.Logiqx) != 0 || (DatFormat & DatFormat.LogiqxDepreciated) != 0 + || (DatFormat & DatFormat.Listxml) != 0 || (DatFormat & DatFormat.SabreDat) != 0 || (DatFormat & DatFormat.SoftwareList) != 0))) { diff --git a/SabreTools.Library/Data/Flags.cs b/SabreTools.Library/Data/Flags.cs index 32e797ca..381fc716 100644 --- a/SabreTools.Library/Data/Flags.cs +++ b/SabreTools.Library/Data/Flags.cs @@ -194,9 +194,10 @@ namespace SabreTools.Library.Data { // XML Formats Logiqx = 0x01, - LogiqxDepreciated = Logiqx << 1, - SoftwareList = LogiqxDepreciated << 1, // Special internal type for "game" instead of "machine" - OfflineList = SoftwareList << 1, + LogiqxDepreciated = Logiqx << 1, // Special internal type for "game" instead of "machine" + SoftwareList = LogiqxDepreciated << 1, + Listxml = SoftwareList << 1, + OfflineList = Listxml << 1, SabreDat = OfflineList << 1, // Propietary Formats diff --git a/SabreTools.Library/Tools/Utilities.cs b/SabreTools.Library/Tools/Utilities.cs index 57d56dab..7ce32043 100644 --- a/SabreTools.Library/Tools/Utilities.cs +++ b/SabreTools.Library/Tools/Utilities.cs @@ -619,6 +619,8 @@ namespace SabreTools.Library.Tools return new DosCenter(baseDat); case DatFormat.Listrom: return new Listrom(baseDat); + case DatFormat.Listxml: + return new Listxml(baseDat); case DatFormat.Logiqx: return new Logiqx(baseDat, false); case DatFormat.LogiqxDepreciated: @@ -1096,7 +1098,15 @@ namespace SabreTools.Library.Tools // Get the first two lines to check StreamReader sr = File.OpenText(filename); string first = sr.ReadLine().ToLowerInvariant(); + while (String.IsNullOrWhiteSpace(first)) + { + first = sr.ReadLine(); + } string second = sr.ReadLine().ToLowerInvariant(); + while (String.IsNullOrWhiteSpace(second)) + { + second = sr.ReadLine(); + } sr.Dispose(); // If we have an XML-based DAT @@ -1106,6 +1116,12 @@ namespace SabreTools.Library.Tools { return DatFormat.Logiqx; } + else if (second.StartsWith("