]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Reset windowed/fullscreen state when restarting.
authorToni Wilen <twilen@winuae.net>
Sat, 25 Nov 2023 13:46:00 +0000 (15:46 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 25 Nov 2023 13:46:00 +0000 (15:46 +0200)
include/uae.h
inputdevice.cpp
main.cpp
memory.cpp
newcpu.cpp
od-win32/win32gui.cpp

index e87dd55ea5d225930356c11888536338c2e911d0..3d5be5f4ce417ce0a9081aa9be7b0739196b6561 100644 (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);
index 2cbcce8f6001fbc6c8f3f0b3b936503726583f2d..43c75d799bf29edfd5543b2dd4a921494201337e 100644 (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:
index 92a8e4e995cb898f866700a6033284a517282c45..4cd1a84909d2824d80cc4f47f524529e95a00910 100644 (file)
--- 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
index 52676825f18ec0d3ceff96f8628b4fd7fd866b42..89178c9d8d40ebe263809cff97073ed3fc42db3c 100644 (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)
index 75b9a0bb10076fe8befa471e8ff0d4ab32c3c51f..12b604b29bfb0d28923faec870b72101a50c0e2e 100644 (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;
                }
index ace85e35375d9537f40d5e939254a830fd25e585..14528610c5715e36201197de9beaf2a7d17ac87a 100644 (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);
                }