Fix overzealous TV detection in ROM filenames. Fixes #747.

This commit is contained in:
Stephen Anthony 2020-12-24 11:51:53 -03:30
parent e14da1344a
commit 5c7ae3a147
2 changed files with 8 additions and 5 deletions

View File

@ -38,6 +38,9 @@
* Fixed autofire bug for trackball controllers.
* Fixed bug in TV autodetection in filenames; a filename containing
'PAL' would sometimes misdetect as a PAL ROM.
* Fixed Stelladaptor/2600'daptor devices sometimes not being assigned
correct default mappings.

View File

@ -316,13 +316,13 @@ string Console::formatFromFilename() const
{ R"([ _\-(\[<]+NTSC[ _-]?50)", "NTSC50" },
{ R"([ _\-(\[<]+PAL[ _-]?60)", "PAL60" },
{ R"([ _\-(\[<]+SECAM[ _-]?60)", "SECAM60" },
{ R"([ _\-(\[<]+NTSC[ _\-)\]>]?)", "NTSC" },
{ R"([ _\-(\[<]+PAL[ _\-)\]>]?)", "PAL" },
{ R"([ _\-(\[<]+SECAM[ _\-)\]>]?)", "SECAM" }
{ R"([ _\-(\[<]+NTSC[ _\-)\]>.])", "NTSC" },
{ R"([ _\-(\[<]+PAL[ _\-)\]>.])", "PAL" },
{ R"([ _\-(\[<]+SECAM[ _\-)\]>.])", "SECAM" }
}};
// Get filename *without* extension, and search using regex's above
const string& filename = myOSystem.romFile().getNameWithExt("");
// Get filename, and search using regex's above
const string& filename = myOSystem.romFile().getName();
for(size_t i = 0; i < Pattern.size(); ++i)
{
try