X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Fmenu_pico.c;h=2dd582dc353c080bb1272914eb7828a9edf17764;hb=504e2f5688f14a35bb6d7a080811889d465dbd75;hp=a43c55ac23bdfe2f420661e5595c05e2177c6494;hpb=4c2e35547fd6f849648234989419a4a02d2546b4;p=picodrive.git diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index a43c55a..2dd582d 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -11,8 +11,7 @@ #include "emu.h" #include "menu_pico.h" #include "input_pico.h" - -#include +#include "version.h" #include #include @@ -28,7 +27,7 @@ static const char *rom_exts[] = { "zip", - "bin", "smd", "gen", + "bin", "smd", "gen", "md", "iso", "cso", "cue", "32x", "sms", @@ -38,11 +37,16 @@ static const char *rom_exts[] = { // rrrr rggg gggb bbbb static unsigned short fname2color(const char *fname) { - const char *ext = fname + strlen(fname) - 3; static const char *other_exts[] = { "gmv", "pat" }; + const char *ext; int i; - if (ext < fname) ext = fname; + ext = strrchr(fname, '.'); + if (ext++ == NULL) { + ext = fname + strlen(fname) - 3; + if (ext < fname) ext = fname; + } + for (i = 0; rom_exts[i] != NULL; i++) if (strcasecmp(ext, rom_exts[i]) == 0) return 0xbdff; // FIXME: mk defines for (i = 0; i < array_size(other_exts); i++)