[DatFile] Add DOSCenter output format to all that support

This commit is contained in:
Matt Nadareski
2016-09-21 14:59:39 -07:00
parent f147a06bc0
commit 9bd116589c
4 changed files with 48 additions and 2 deletions

View File

@@ -112,6 +112,7 @@ namespace SabreTools.Helper
helptext.Add(" -u, --unzip Force unzipping in created DAT");
helptext.Add(" -f, --files Treat archives as files");
helptext.Add(" -oc, --output-cmp Output in CMP format");
helptext.Add(" -od, --output-dc Output in DOSCenter format");
helptext.Add(" -om, --output-miss Output in Missfile format");
helptext.Add(" -omd5, --output-md5 Output in MD5 format");
helptext.Add(" -or, --output-rc Output in RomCenter format");
@@ -147,6 +148,7 @@ namespace SabreTools.Helper
helptext.Add(" -out= Output directory");
helptext.Add(" -ud, --update Update a DAT file");
helptext.Add(" -oc, --output-cmp Output in CMP format");
helptext.Add(" -od, --output-dc Output in DOSCenter format");
helptext.Add(" -om, --output-miss Output in Missfile format");
helptext.Add(" -r, --roms Output roms to miss instead of sets");
helptext.Add(" -gp, --game-prefix Add game name as a prefix");

View File

@@ -3094,6 +3094,17 @@ namespace SabreTools.Helper
(datdata.ForceMerging == ForceMerging.Split ? "\tforcemerging split\n" : "") +
")\n";
break;
case OutputFormat.DOSCenter:
header = "DOSCenter (\n" +
"Name: " + datdata.Name + "\"\n" +
"Description: " + datdata.Description + "\"\n" +
"Version: " + datdata.Version + "\"\n" +
"Date: " + datdata.Date + "\"\n" +
"Author: " + datdata.Author + "\"\n" +
"Homepage: " + datdata.Homepage + "\"\n" +
"Comment: " + datdata.Comment + "\"\n" +
")\n";
break;
case OutputFormat.MissFile:
if (datdata.XSV == true)
{
@@ -3225,7 +3236,9 @@ namespace SabreTools.Helper
"\tdescription \"" + (String.IsNullOrEmpty(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription) + "\"\n" +
(String.IsNullOrEmpty(rom.Year) ? "" : "\tyear " + rom.Year + "\n") +
(String.IsNullOrEmpty(rom.Manufacturer) ? "" : "\tmanufacturer \"" + rom.Manufacturer + "\"\n");
break;
case OutputFormat.DOSCenter:
state += "game (\n\tname \"" + rom.MachineName + ".zip\"\n";
break;
case OutputFormat.SabreDat:
for (int i = (last == -1 ? 0 : last); i < newsplit.Count; i++)
@@ -3289,6 +3302,7 @@ namespace SabreTools.Helper
switch (outputFormat)
{
case OutputFormat.ClrMamePro:
case OutputFormat.DOSCenter:
state += (String.IsNullOrEmpty(rom.SampleOf) ? "" : "\tsampleof \"" + rom.SampleOf + "\"\n") + ")\n";
break;
case OutputFormat.SabreDat:
@@ -3413,6 +3427,25 @@ namespace SabreTools.Helper
break;
}
break;
case OutputFormat.DOSCenter:
switch (rom.Type)
{
case ItemType.Archive:
case ItemType.BiosSet:
case ItemType.Disk:
case ItemType.Release:
case ItemType.Sample:
// We don't output these at all
break;
case ItemType.Rom:
state += "\tfile ( name\"" + ((Rom)rom).Name
+ " size " + ((Rom)rom).Size
+ " date " + ((Rom)rom).Date
+ " crc " + ((Rom)rom).CRC
+ " )\n";
break;
}
break;
case OutputFormat.MissFile:
// Missfile should only output Rom and Disk
@@ -3751,6 +3784,7 @@ namespace SabreTools.Helper
switch (outputFormat)
{
case OutputFormat.ClrMamePro:
case OutputFormat.DOSCenter:
footer = ")\n";
break;
case OutputFormat.SabreDat:

View File

@@ -163,7 +163,10 @@ Options:
should be read as-is.
-oc, --output-cmp Output in CMP format
Add outputting the created DAT to clrmamepro format
Add outputting the created DAT to CLRMamePro format
-od, --output-dc Output in DOSCenter format
Add outputting the created DAT to DOSCenter format
-om, --output-miss Output in Missfile format
Add outputting the created DAT to GoodTools miss format
@@ -334,6 +337,9 @@ Options:
-oc, --output-cmp Output in CMP format
Add outputting the created DAT to clrmamepro format
-od, --output-dc Output in DOSCenter format
Add outputting the created DAT to DOSCenter format
-om, --output-miss Output in Missfile format
Add outputting the created DAT to GoodTools miss format

View File

@@ -236,6 +236,10 @@ namespace SabreTools
case "--output-cmp":
outputFormat |= OutputFormat.ClrMamePro;
break;
case "-od":
case "--output-dc":
outputFormat |= OutputFormat.DOSCenter;
break;
case "-om":
case "--output-miss":
outputFormat |= OutputFormat.MissFile;