diff --git a/Changes.txt b/Changes.txt index 2f733a6e3..7386b39c6 100644 --- a/Changes.txt +++ b/Changes.txt @@ -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. diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 52620243e..db5850aa4 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -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