Skip to content

Commit 7679d96

Browse files
committed
search for TV spec in filename now ignores the path component
for example, in ROM Hunter's archive there are directories called "PAL VERSIONS OF NTSC ORIGINALS" and "NTSC VERSIONS OF PAL ORIGINALS". these cause false positives in the TV spec search
1 parent 83e52bd commit 7679d96

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hardware/television/specification/specifications.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package specification
1919

2020
import (
2121
"image/color"
22+
"path/filepath"
2223
"strings"
2324

2425
"github.com/jetsetilly/gopher2600/hardware/television/signal"
@@ -39,6 +40,14 @@ func SearchSpec(s string) string {
3940
// actually "PAL60".
4041
var list = []string{"pal-60", "pal60", "pal-m", "palm", "ntsc", "pal", "secam"}
4142

43+
// we don't want to include the path in the search because this may cause
44+
// false positives. for example, in ROM Hunter's archive there are
45+
// directories called "PAL VERSIONS OF NTSC ORIGINALS" and "NTSC VERSIONS OF
46+
// PAL ORIGINALS"
47+
//
48+
// http://www.atarimania.com/rom_collection_archive_atari_2600_roms.html
49+
s = filepath.Base(s)
50+
4251
// look for any settings embedded in the filename
4352
s = strings.ToLower(s)
4453
for _, spec := range list {

0 commit comments

Comments
 (0)