From 53b2e51c0bb65344685b336a73216b059fb6d13c Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 29 Jun 2013 20:23:15 +0300 Subject: [PATCH] add .md extension some popular romset has binary dumps as .md, although there is also some old ROM copier format too? --- platform/common/menu_pico.c | 11 ++++++++--- platform/libretro.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) 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; } -- 2.39.5