First phase of cleaning up the use of pathnames internally. We now have the --vmpath (short: -P) commandline option to override the 'work dir' relative to which the program will try to find certain files and folders.

This commit is contained in:
waltje
2017-09-23 21:12:26 -04:00
parent 35c25cab74
commit 637ce66da2
25 changed files with 1086 additions and 894 deletions

View File

@@ -11,25 +11,22 @@
FILE *romfopen(wchar_t *fn, wchar_t *mode)
{
wchar_t s[512];
wcscpy(s, pcempath);
wchar_t s[1024];
wcscpy(s, exe_path);
put_backslash_w(s);
wcscat(s, fn);
return _wfopen(s, mode);
}
FILE *nvrfopen(wchar_t *fn, wchar_t *mode)
{
return _wfopen(nvr_concat(fn), mode);
}
int rom_getfile(wchar_t *fn, wchar_t *s, int size)
{
FILE *f;
wcscpy(s, pcempath);
wcscpy(s, exe_path);
put_backslash_w(s);
wcscat(s, fn);
f = _wfopen(s, L"rb");
@@ -46,7 +43,7 @@ int rom_present(wchar_t *fn)
FILE *f;
wchar_t s[512];
wcscpy(s, pcempath);
wcscpy(s, exe_path);
put_backslash_w(s);
wcscat(s, fn);
f = _wfopen(s, L"rb");