fetch_configurationpath(tmp, sizeof(tmp) / sizeof(TCHAR));
_tcsncat(tmp, p->config_all_path, sizeof(tmp) / sizeof(TCHAR) - _tcslen(tmp) - 1);
type2 = CONFIG_TYPE_HOST | CONFIG_TYPE_HARDWARE;
+ target_setdefaultstatefilename(filename);
cfgfile_load(p, tmp, &type2, 1, 0);
}
if (p->config_hardware_path[0]) {
fetch_configurationpath (tmp, sizeof (tmp) / sizeof (TCHAR));
_tcsncat (tmp, p->config_host_path, sizeof (tmp) / sizeof (TCHAR) - _tcslen(tmp) - 1);
type2 = CONFIG_TYPE_HOST;
+ target_setdefaultstatefilename(filename);
cfgfile_load (p, tmp, &type2, 1, 0);
}
}
extern void target_getdate(int *y, int *m, int *d);
extern void target_cpu_speed(void);
extern int target_sleep_nanos(int);
+void target_setdefaultstatefilename(const TCHAR*);
extern bool get_plugin_path (TCHAR *out, int size, const TCHAR *path);
extern void stripslashes (TCHAR *p);
extern void fixtrailing (TCHAR *p);
target_load_debugger_config();
}
+void target_setdefaultstatefilename(const TCHAR *name)
+{
+ TCHAR path[MAX_DPATH];
+ fetch_path(_T("StatefilePath"), path, sizeof(path) / sizeof(TCHAR));
+ if (!name || !name[0]) {
+ _tcscat(path, _T("default.uss"));
+ } else {
+ _tcscat(path, name);
+ const TCHAR *p = _tcsrchr(name, '.');
+ if (p) {
+ path[_tcslen(path) - ((name + _tcslen(name)) - p)] = 0;
+ _tcscat(path, _T(".uss"));
+ }
+ }
+ _tcscpy(savestate_fname, path);
+}
+
#if WINUAEPUBLICBETA > 0
static const TCHAR *BETAMESSAGE = {
_T("This is unstable beta software. Click cancel if you are not comfortable using software that is incomplete and can have serious programming errors.")
WIN32GUI_LoadUIString (IDS_MUSTSELECTCONFIG, szMessage, MAX_DPATH);
pre_gui_message (szMessage);
} else {
+ target_setdefaultstatefilename(config_filename);
if (target_cfgfile_load (&workprefs, path, configtypepanel, 0) == 0) {
TCHAR szMessage[MAX_DPATH];
WIN32GUI_LoadUIString (IDS_COULDNOTLOADCONFIG, szMessage, MAX_DPATH);
break;
}
- setguititle (NULL);
+ setguititle(NULL);
return ok ? full_path : NULL;
}
addfloppyhistory (hDlg);
config_filename[0] = 0;
setguititle (NULL);
+ target_setdefaultstatefilename(config_filename);
}
static void quickstarthost (HWND hDlg, TCHAR *name)