mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
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:
parent
f27a1749fe
commit
02f3222feb
2 changed files with 31 additions and 0 deletions
|
@ -182,6 +182,21 @@ static const char *find_bios(int *region, const char *cd_fname)
|
||||||
(*region == 8 ? "EU" : "JAP") : "USA");
|
(*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
|
if (*region == 4) { // US
|
||||||
files = biosfiles_us;
|
files = biosfiles_us;
|
||||||
count = sizeof(biosfiles_us) / sizeof(char *);
|
count = sizeof(biosfiles_us) / sizeof(char *);
|
||||||
|
|
|
@ -1274,6 +1274,22 @@ static const char *find_bios(int *region, const char *cd_fname)
|
||||||
int i, count;
|
int i, count;
|
||||||
FILE *f = NULL;
|
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
|
if (*region == 4) { // US
|
||||||
files = biosfiles_us;
|
files = biosfiles_us;
|
||||||
count = sizeof(biosfiles_us) / sizeof(char *);
|
count = sizeof(biosfiles_us) / sizeof(char *);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue