Improvements to path handling. Patch from bit.

This commit is contained in:
SarahW 2017-07-06 21:25:10 +01:00
commit 807b710a5d
55 changed files with 588 additions and 368 deletions

View file

@ -4,25 +4,30 @@
#include "config.h"
#include "mem.h"
#include "rom.h"
#include "paths.h"
FILE *romfopen(char *fn, char *mode)
{
FILE *f;
char s[512];
strcpy(s, pcempath);
put_backslash(s);
strcat(s, fn);
return fopen(s, mode);
int i;
for (i = 0; i < num_roms_paths; ++i)
{
get_roms_path(i, s, 511);
put_backslash(s);
strcat(s, fn);
f = fopen(s, mode);
if (f)
return f;
}
return 0;
}
int rom_present(char *fn)
{
FILE *f;
char s[512];
strcpy(s, pcempath);
put_backslash(s);
strcat(s, fn);
f = fopen(s, "rb");
f = romfopen(fn, "rb");
if (f)
{
fclose(f);