Reset windowed/fullscreen state when restarting.

This commit is contained in:
Toni Wilen 2023-11-25 15:46:00 +02:00
parent 55b7a6120f
commit f59e51c6e7
6 changed files with 23 additions and 20 deletions

View File

@ -29,7 +29,7 @@ extern int sleep_resolution;
extern void uae_reset (int, int);
extern void uae_quit (void);
extern void uae_restart (int, const TCHAR*);
extern void uae_restart(struct uae_prefs*, int, const TCHAR*);
extern void target_reset (void);
extern void target_addtorecent (const TCHAR*, int);
extern void target_run (void);

View File

@ -4956,7 +4956,7 @@ static bool inputdevice_handle_inputcode2(int monid, int code, int state, const
uae_reset (1, 1);
break;
case AKS_RESTART:
uae_restart(-1, NULL);
uae_restart(&currprefs, -1, NULL);
break;
case AKS_STATESAVEQUICK:
case AKS_STATESAVEQUICK1:

View File

@ -843,7 +843,7 @@ void uae_quit (void)
}
/* 0 = normal, 1 = nogui, -1 = disable nogui, -2 = autorestart */
void uae_restart (int opengui, const TCHAR *cfgfile)
void uae_restart(struct uae_prefs *p, int opengui, const TCHAR *cfgfile)
{
uae_quit ();
restart_program = opengui == -2 ? 4 : (opengui > 0 ? 1 : (opengui == 0 ? 2 : 3));
@ -852,6 +852,9 @@ void uae_restart (int opengui, const TCHAR *cfgfile)
if (cfgfile)
_tcscpy (restart_config, cfgfile);
target_restart ();
p->gfx_apmode[0].gfx_fullscreen = GFX_WINDOW;
p->gfx_apmode[1].gfx_fullscreen = GFX_WINDOW;
}
#ifndef DONT_PARSE_CMDLINE
@ -1199,7 +1202,7 @@ static int real_main2 (int argc, TCHAR **argv)
#ifdef NATMEM_OFFSET
if (!init_shm ()) {
if (currprefs.start_gui)
uae_restart(-1, NULL);
uae_restart(&currprefs, -1, NULL);
return 0;
}
#endif

View File

@ -2850,17 +2850,17 @@ static void restore_roms(void)
write_log (_T("Known ROM '%s' loaded\n"), rd->name);
#if 1
if ((rd->cpu & 8) && changed_prefs.cpu_model < 68030) {
notify_user (NUMSG_KS68030PLUS);
uae_restart (-1, NULL);
notify_user(NUMSG_KS68030PLUS);
uae_restart(&currprefs, -1, NULL);
} else if ((rd->cpu & 3) == 3 && changed_prefs.cpu_model != 68030) {
notify_user (NUMSG_KS68030);
uae_restart (-1, NULL);
notify_user(NUMSG_KS68030);
uae_restart(&currprefs, -1, NULL);
} else if ((rd->cpu & 3) == 1 && changed_prefs.cpu_model < 68020) {
notify_user (NUMSG_KS68EC020);
uae_restart (-1, NULL);
notify_user(NUMSG_KS68EC020);
uae_restart(&currprefs, -1, NULL);
} else if ((rd->cpu & 3) == 2 && (changed_prefs.cpu_model < 68020 || changed_prefs.address_space_24)) {
notify_user (NUMSG_KS68020);
uae_restart (-1, NULL);
notify_user(NUMSG_KS68020);
uae_restart(&currprefs, -1, NULL);
}
#endif
if (rd->cloanto)

View File

@ -3803,7 +3803,7 @@ uae_u32 REGPARAM2 op_illg (uae_u32 opcode)
if (opcode == 0x4E7B && inrom) {
if (get_long (0x10) == 0) {
notify_user (NUMSG_KS68020);
uae_restart (-1, NULL);
uae_restart(&currprefs, -1, NULL);
m68k_setstopped(1);
return 4;
}

View File

@ -6335,7 +6335,7 @@ static void loadsavecommands (HWND hDlg, WPARAM wParam, struct ConfigStruct **co
if (full_property_sheet) {
inputdevice_updateconfig (NULL, &workprefs);
} else {
uae_restart (-1, *pcfgfile);
uae_restart(&workprefs, -1, *pcfgfile);
exit_gui(1);
}
}
@ -6348,7 +6348,7 @@ static void loadsavecommands (HWND hDlg, WPARAM wParam, struct ConfigStruct **co
if (full_property_sheet) {
inputdevice_updateconfig (NULL, &workprefs);
} else {
uae_restart (-1, *pcfgfile);
uae_restart(&workprefs, -1, *pcfgfile);
exit_gui(1);
}
}
@ -6470,7 +6470,7 @@ static INT_PTR CALLBACK LoadSaveDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA
if (cfgfile) {
ConfigToRegistry (config, configtypepanel);
if (!full_property_sheet)
uae_restart (0, cfgfile);
uae_restart(&workprefs, 0, cfgfile);
exit_gui (1);
}
}
@ -22615,7 +22615,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
if (!workprefs.start_gui)
ret = 1;
} else {
uae_restart (workprefs.start_gui, file);
uae_restart(&workprefs, workprefs.start_gui, file);
ret = 1;
}
}
@ -23003,7 +23003,7 @@ static INT_PTR CALLBACK DialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
}
break;
case IDC_RESETAMIGA:
uae_reset (1, 1);
uae_reset(1, 1);
SendMessage (hDlg, WM_COMMAND, IDOK, 0);
return TRUE;
case IDC_QUITEMU:
@ -23011,7 +23011,7 @@ static INT_PTR CALLBACK DialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
SendMessage (hDlg, WM_COMMAND, IDCANCEL, 0);
return TRUE;
case IDC_RESTARTEMU:
uae_restart (-1, NULL);
uae_restart(&workprefs, -1, NULL);
exit_gui (1);
return TRUE;
case IDHELP:
@ -23642,7 +23642,7 @@ gui_exit:
} else if (qs_request_reset && quickstart) {
if (qs_request_reset & 4) {
copy_prefs(&changed_prefs, &currprefs);
uae_restart(-2, NULL);
uae_restart(&workprefs, -2, NULL);
} else {
uae_reset((qs_request_reset & 2) ? 1 : 0, 1);
}