The nvr directory is now automatically created if it does not exist.

This commit is contained in:
OBattler
2017-07-16 17:28:30 +02:00
parent 6a7652d7a0
commit a7eb3c1608
2 changed files with 13 additions and 0 deletions

View File

@@ -107,6 +107,8 @@ extern int find_status_bar_part(int tag);
extern void cdrom_close(uint8_t id); extern void cdrom_close(uint8_t id);
extern void update_tip(int meaning); extern void update_tip(int meaning);
extern BOOL DirectoryExists(LPCTSTR szPath);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -835,6 +835,7 @@ static void loadconfig_machine(void)
{ {
char *cat = "Machine"; char *cat = "Machine";
wchar_t *wp; wchar_t *wp;
wchar_t last;
char *p; char *p;
p = config_get_string(cat, "model", NULL); p = config_get_string(cat, "model", NULL);
@@ -883,6 +884,16 @@ static void loadconfig_machine(void)
path_len = wcslen(nvr_path); path_len = wcslen(nvr_path);
#ifndef __unix
last = nvr_path[wcslen(nvr_path) - 1];
nvr_path[wcslen(nvr_path) - 1] = 0;
if (!DirectoryExists(nvr_path))
{
CreateDirectory(nvr_path, NULL);
}
nvr_path[wcslen(nvr_path)] = last;
#endif
cpu_use_dynarec = !!config_get_int(cat, "cpu_use_dynarec", 0); cpu_use_dynarec = !!config_get_int(cat, "cpu_use_dynarec", 0);
enable_external_fpu = !!config_get_int(cat, "cpu_enable_fpu", 0); enable_external_fpu = !!config_get_int(cat, "cpu_enable_fpu", 0);