From: Toni Wilen Date: Sat, 25 Nov 2023 13:46:00 +0000 (+0200) Subject: Reset windowed/fullscreen state when restarting. X-Git-Tag: 5.1.0~44 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f59e51c6e79591afe62baed6b5729d6d08c115e3;p=francis%2Fwinuae.git Reset windowed/fullscreen state when restarting. --- diff --git a/include/uae.h b/include/uae.h index e87dd55e..3d5be5f4 100644 --- a/include/uae.h +++ b/include/uae.h @@ -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); diff --git a/inputdevice.cpp b/inputdevice.cpp index 2cbcce8f..43c75d79 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -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: diff --git a/main.cpp b/main.cpp index 92a8e4e9..4cd1a849 100644 --- a/main.cpp +++ b/main.cpp @@ -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 diff --git a/memory.cpp b/memory.cpp index 52676825..89178c9d 100644 --- a/memory.cpp +++ b/memory.cpp @@ -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) diff --git a/newcpu.cpp b/newcpu.cpp index 75b9a0bb..12b604b2 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -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; } diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index ace85e35..14528610 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -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); }