Add skip on nodump

This commit is contained in:
Matt Nadareski
2016-05-06 10:59:05 -07:00
parent 53cfcd19ed
commit ced41c5cde

View File

@@ -447,6 +447,12 @@ namespace SabreTools.Helper
{ {
case "rom": case "rom":
case "disk": case "disk":
// If the rom is nodump, skip it
if (xtr.GetAttribute("flags") == "nodump" || xtr.GetAttribute("status") == "nodump")
{
break;
}
// Take care of hex-sized files // Take care of hex-sized files
long size = -1; long size = -1;
if (xtr.GetAttribute("size") != null && xtr.GetAttribute("size").Contains("0x")) if (xtr.GetAttribute("size") != null && xtr.GetAttribute("size").Contains("0x"))
@@ -469,31 +475,35 @@ namespace SabreTools.Helper
sha1 = (sha1.StartsWith("0x") ? sha1.Remove(0, 2) : sha1); sha1 = (sha1.StartsWith("0x") ? sha1.Remove(0, 2) : sha1);
sha1 = (sha1 == "-" ? "" : sha1); sha1 = (sha1 == "-" ? "" : sha1);
// Get the new values to add // Only add the rom if there's useful information in it
string key = crc + "-" + size; if (!(crc == "" && md5 == "" && sha1 == ""))
RomData value = new RomData
{ {
Game = tempname, // Get the new values to add
Name = xtr.GetAttribute("name"), string key = crc + "-" + size;
Type = xtr.Name, RomData value = new RomData
SystemID = sysid, {
SourceID = srcid, Game = tempname,
Size = size, Name = xtr.GetAttribute("name"),
CRC = crc, Type = xtr.Name,
MD5 = md5, SystemID = sysid,
SHA1 = sha1, SourceID = srcid,
System = filename, Size = size,
}; CRC = crc,
MD5 = md5,
SHA1 = sha1,
System = filename,
};
if (dict.ContainsKey(key)) if (dict.ContainsKey(key))
{ {
dict[key].Add(value); dict[key].Add(value);
} }
else else
{ {
List<RomData> newvalue = new List<RomData>(); List<RomData> newvalue = new List<RomData>();
newvalue.Add(value); newvalue.Add(value);
dict.Add(key, newvalue); dict.Add(key, newvalue);
}
} }
break; break;
} }