platform, basic msu-md support

loading a .cue file will look for a cartridge image with the same basename
and an extension of "gen", "smd", "md", "32x".
This commit is contained in:
kub 2023-05-28 13:56:55 +00:00
parent f27a1749fe
commit 02f3222feb
2 changed files with 31 additions and 0 deletions

View file

@ -182,6 +182,21 @@ static const char *find_bios(int *region, const char *cd_fname)
(*region == 8 ? "EU" : "JAP") : "USA");
}
// look for MSU.MD rom file. XXX another extension list? ugh...
static const char *md_exts[] = { "gen", "smd", "md", "32x" };
char *ext = strrchr(cd_fname, '.');
int extpos = ext ? ext-cd_fname : strlen(cd_fname);
strcpy(static_buff, cd_fname);
static_buff[extpos++] = '.';
for (i = 0; i < ARRAY_SIZE(md_exts); i++) {
strcpy(static_buff+extpos, md_exts[i]);
if (access(static_buff, R_OK) == 0) {
printf("found MSU rom: %s\n",static_buff);
return static_buff;
}
}
// locate BIOS file
if (*region == 4) { // US
files = biosfiles_us;
count = sizeof(biosfiles_us) / sizeof(char *);

View file

@ -1274,6 +1274,22 @@ static const char *find_bios(int *region, const char *cd_fname)
int i, count;
FILE *f = NULL;
// look for MSU.MD rom file. XXX another extension list? ugh...
static const char *md_exts[] = { "gen", "smd", "md", "32x" };
char *ext = strrchr(cd_fname, '.');
int extpos = ext ? ext-cd_fname : strlen(cd_fname);
strcpy(path, cd_fname);
path[extpos++] = '.';
for (i = 0; i < ARRAY_SIZE(md_exts); i++) {
strcpy(path+extpos, md_exts[i]);
f = fopen(path, "rb");
if (f != NULL) {
log_cb(RETRO_LOG_INFO, "found MSU rom: %s\n", path);
fclose(f);
return path;
}
}
if (*region == 4) { // US
files = biosfiles_us;
count = sizeof(biosfiles_us) / sizeof(char *);