From: notaz Date: Sat, 29 Jun 2013 17:23:15 +0000 (+0300) Subject: add .md extension X-Git-Tag: v1.85~78 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53b2e51c0bb65344685b336a73216b059fb6d13c;p=picodrive.git add .md extension some popular romset has binary dumps as .md, although there is also some old ROM copier format too? --- diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index 3ed768d7..2dd582dc 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -27,7 +27,7 @@ static const char *rom_exts[] = { "zip", - "bin", "smd", "gen", + "bin", "smd", "gen", "md", "iso", "cso", "cue", "32x", "sms", @@ -37,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++) diff --git a/platform/libretro.c b/platform/libretro.c index 0521f180..63551cdc 100644 --- a/platform/libretro.c +++ b/platform/libretro.c @@ -187,7 +187,7 @@ void retro_get_system_info(struct retro_system_info *info) memset(info, 0, sizeof(*info)); info->library_name = "PicoDrive"; info->library_version = VERSION; - info->valid_extensions = "bin|gen|smd|32x|cue|iso|sms"; + info->valid_extensions = "bin|gen|smd|md|32x|cue|iso|sms"; info->need_fullpath = true; }