[ALL] Fix CMP parsing again, add NotNodump option for filter

This commit is contained in:
Matt Nadareski
2016-09-21 16:46:01 -07:00
parent 0dca764563
commit f512fa5b50
7 changed files with 101 additions and 7 deletions

View File

@@ -819,8 +819,30 @@ namespace SabreTools.Helper
{
continue;
}
// Special case for itemStatus...
else if (gc[i] == "itemStatus" && attrib != "status" && attrib != "flags")
// Special cases for item statuses
else if (gc[i] == "good" && attrib != "status" && attrib != "flags")
{
if (item.Type == ItemType.Rom)
{
((Rom)item).ItemStatus = ItemStatus.Good;
}
else if (item.Type == ItemType.Disk)
{
((Disk)item).ItemStatus = ItemStatus.Good;
}
}
else if (gc[i] == "baddump" && attrib != "status" && attrib != "flags")
{
if (item.Type == ItemType.Rom)
{
((Rom)item).ItemStatus = ItemStatus.BadDump;
}
else if (item.Type == ItemType.Disk)
{
((Disk)item).ItemStatus = ItemStatus.BadDump;
}
}
else if (gc[i] == "nodump" && attrib != "status" && attrib != "flags")
{
if (item.Type == ItemType.Rom)
{
@@ -831,6 +853,17 @@ namespace SabreTools.Helper
((Disk)item).ItemStatus = ItemStatus.Nodump;
}
}
else if (gc[i] == "verified" && attrib != "status" && attrib != "flags")
{
if (item.Type == ItemType.Rom)
{
((Rom)item).ItemStatus = ItemStatus.Verified;
}
else if (item.Type == ItemType.Disk)
{
((Disk)item).ItemStatus = ItemStatus.Verified;
}
}
// Even number of quotes, not in a quote, not in attribute
else if (Regex.Matches(gc[i], "\"").Count % 2 == 0 && !quote && attrib == "")
{
@@ -934,6 +967,48 @@ namespace SabreTools.Helper
}
i++;
break;
// Special cases for item statuses
case "good":
if (item.Type == ItemType.Rom)
{
((Rom)item).ItemStatus = ItemStatus.Good;
}
else if (item.Type == ItemType.Disk)
{
((Disk)item).ItemStatus = ItemStatus.Good;
}
break;
case "baddump":
if (item.Type == ItemType.Rom)
{
((Rom)item).ItemStatus = ItemStatus.BadDump;
}
else if (item.Type == ItemType.Disk)
{
((Disk)item).ItemStatus = ItemStatus.BadDump;
}
break;
case "nodump":
if (item.Type == ItemType.Rom)
{
((Rom)item).ItemStatus = ItemStatus.Nodump;
}
else if (item.Type == ItemType.Disk)
{
((Disk)item).ItemStatus = ItemStatus.Nodump;
}
break;
case "verified":
if (item.Type == ItemType.Rom)
{
((Rom)item).ItemStatus = ItemStatus.Verified;
}
else if (item.Type == ItemType.Disk)
{
((Disk)item).ItemStatus = ItemStatus.Verified;
}
break;
}
attrib = "";