Improvements to path handling. Patch from bit.
This commit is contained in:
parent
1d4c9ab4e8
commit
807b710a5d
55 changed files with 588 additions and 368 deletions
25
src/rom.c
25
src/rom.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue