mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL] Add read/write support for MAME Listrom format
This commit is contained in:
@@ -106,6 +106,25 @@ namespace SabreTools.Library.Tools
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean a hash string from a Listrom DAT
|
||||
/// </summary>
|
||||
/// <param name="hash">Hash string to sanitize</param>
|
||||
/// <returns>Cleaned string</returns>
|
||||
public static string CleanListromHashData(string hash)
|
||||
{
|
||||
if (hash.StartsWith("CRC"))
|
||||
{
|
||||
return hash.Substring(4, 8).ToLowerInvariant();
|
||||
}
|
||||
else if (hash.StartsWith("SHA1"))
|
||||
{
|
||||
return hash.Substring(5, 40).ToLowerInvariant();
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a proper outfile name based on a DAT and output directory
|
||||
/// </summary>
|
||||
@@ -156,25 +175,37 @@ namespace SabreTools.Library.Tools
|
||||
|| (datdata.DatFormat & DatFormat.RomCenter) != 0))
|
||||
{
|
||||
outfileNames.Add(DatFormat.DOSCenter, CreateOutfileNamesHelper(outDir, ".dc.dat", datdata, overwrite));
|
||||
};
|
||||
}
|
||||
|
||||
//MAME Listroms
|
||||
if ((datdata.DatFormat & DatFormat.Listroms) != 0
|
||||
&& (datdata.DatFormat & DatFormat.AttractMode) == 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.Listroms, CreateOutfileNamesHelper(outDir, ".txt", datdata, overwrite));
|
||||
}
|
||||
if ((datdata.DatFormat & DatFormat.Listroms) != 0
|
||||
&& (datdata.DatFormat & DatFormat.AttractMode) != 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.Listroms, CreateOutfileNamesHelper(outDir, ".lr.txt", datdata, overwrite));
|
||||
}
|
||||
|
||||
// Logiqx XML
|
||||
if ((datdata.DatFormat & DatFormat.Logiqx) != 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.Logiqx, CreateOutfileNamesHelper(outDir, ".xml", datdata, overwrite));
|
||||
};
|
||||
}
|
||||
|
||||
// Missfile
|
||||
if ((datdata.DatFormat & DatFormat.MissFile) != 0
|
||||
&& (datdata.DatFormat & DatFormat.AttractMode) == 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.MissFile, CreateOutfileNamesHelper(outDir, ".txt", datdata, overwrite));
|
||||
};
|
||||
}
|
||||
if ((datdata.DatFormat & DatFormat.MissFile) != 0
|
||||
&& (datdata.DatFormat & DatFormat.AttractMode) != 0)
|
||||
{
|
||||
outfileNames.Add(DatFormat.MissFile, CreateOutfileNamesHelper(outDir, ".miss.txt", datdata, overwrite));
|
||||
};
|
||||
}
|
||||
|
||||
// OfflineList
|
||||
if (((datdata.DatFormat & DatFormat.OfflineList) != 0)
|
||||
|
||||
Reference in New Issue
Block a user