Redump bioses need their own pattern, like TOSEC

This commit is contained in:
Matt Nadareski
2016-04-04 18:01:38 -07:00
parent f3c5f0b371
commit 2f619489c9

View File

@@ -51,6 +51,7 @@ namespace SabreTools
private static string _noIntroNumberedPattern = @"(.*? - .*?) \(.*?_CM\).dat"; private static string _noIntroNumberedPattern = @"(.*? - .*?) \(.*?_CM\).dat";
private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat"; private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat";
private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$"; private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$";
private static string _redumpBiosPattern = @"^(.*?) \(\d+\) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$";
private static string _tosecPattern = @"^(.*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$"; private static string _tosecPattern = @"^(.*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$";
private static string _tosecSpecialPattern = @"^(.*? - .*? - .*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$"; private static string _tosecSpecialPattern = @"^(.*? - .*? - .*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$";
private static string _truripPattern = @"^(.*?) - .* \(trurip_XML\)\.dat$"; private static string _truripPattern = @"^(.*?) - .* \(trurip_XML\)\.dat$";
@@ -211,11 +212,17 @@ namespace SabreTools
} }
break; break;
case DatType.Redump: case DatType.Redump:
if (!Remapping.Redump.ContainsKey(fileinfo[1].Value))
{
// Handle special case mappings found only in TOSEC
fileinfo = Regex.Match(filename, _redumpBiosPattern).Groups;
if (!Remapping.Redump.ContainsKey(fileinfo[1].Value)) if (!Remapping.Redump.ContainsKey(fileinfo[1].Value))
{ {
_logger.Error("The filename " + fileinfo[1].Value + " could not be mapped! Please check the mappings and try again"); _logger.Error("The filename " + fileinfo[1].Value + " could not be mapped! Please check the mappings and try again");
return false; return false;
} }
}
GroupCollection redumpInfo = Regex.Match(Remapping.Redump[fileinfo[1].Value], _remappedPattern).Groups; GroupCollection redumpInfo = Regex.Match(Remapping.Redump[fileinfo[1].Value], _remappedPattern).Groups;
manufacturer = redumpInfo[1].Value; manufacturer = redumpInfo[1].Value;