if (p->cdimagefile[0])
cfgfile_write_str (f, L"cdimage0", p->cdimagefile);
+ if (p->quitstatefile[0])
+ cfgfile_write_str (f, L"statefile_quit", p->quitstatefile);
+
cfgfile_write (f, L"nr_floppies", L"%d", p->nr_floppies);
cfgfile_write (f, L"floppy_speed", L"%d", p->floppy_speed);
cfgfile_write (f, L"floppy_volume", L"%d", p->dfxclickvolume);
if (cfgfile_strval (option, value, L"joyport3autofire", &p->jports[3].autofire, joyaf, 0))
return 1;
- if (cfgfile_path (option, value, L"statefile", tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) {
+ if (cfgfile_path (option, value, L"statefile_quit", p->quitstatefile, sizeof p->quitstatefile / sizeof (TCHAR)))
+ return 1;
+
+ if (cfgfile_path (option, value, L"statefile", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) {
_tcscpy (savestate_fname, tmpbuf);
if (zfile_exists (savestate_fname)) {
savestate_state = STATE_DORESTORE;
#endif
if (quit_program < 0) {
+ if (!savestate_state) {
+ if (currprefs.quitstatefile[0]) {
+ savestate_initsave (currprefs.quitstatefile, 1, 1);
+ save_state (currprefs.quitstatefile, L"");
+ }
+ }
quit_program = -quit_program;
set_inhibit_frame (IHF_QUIT_PROGRAM);
set_special (SPCFLAG_BRK);
TCHAR amaxromfile[MAX_DPATH];
TCHAR a2065name[MAX_DPATH];
TCHAR cdimagefile[MAX_DPATH];
+ TCHAR quitstatefile[MAX_DPATH];
TCHAR path_floppy[256];
TCHAR path_hardfile[256];
/* input */
- TCHAR inputname[256];
struct jport jports[MAX_JPORTS];
int input_selected_setting;
int input_joymouse_multiplier;