]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Hard reset CPU startup was not identical to initial power up.
authorToni Wilen <twilen@winuae.net>
Fri, 23 Sep 2022 17:36:50 +0000 (20:36 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 23 Sep 2022 17:36:50 +0000 (20:36 +0300)
newcpu.cpp

index 861eef58fc27170b9b4d4a493cdabe8073233061..0e0162f5c7aefe4b67c2e6f7e37d76cbce13f20a 100644 (file)
@@ -6257,7 +6257,6 @@ bool is_keyboardreset(void)
 void m68k_go (int may_quit)
 {
        int hardboot = 1;
-       int startup = 1;
 
 #ifdef WITH_THREADED_CPU
        init_cpu_thread();
@@ -6296,7 +6295,8 @@ void m68k_go (int may_quit)
 
                if (quit_program > 0) {
                        cpu_keyboardreset = quit_program == UAE_RESET_KEYBOARD;
-                       cpu_hardreset = ((quit_program == UAE_RESET_HARD ? 1 : 0) | hardboot) != 0;
+                       cpu_hardreset = ((quit_program == UAE_RESET_HARD ? 1 : 0) || hardboot) != 0;
+                       hardboot |= quit_program == UAE_RESET_HARD ? 1 : 0;
 
                        if (quit_program == UAE_QUIT)
                                break;
@@ -6304,7 +6304,6 @@ void m68k_go (int may_quit)
                        hsync_counter = 0;
                        vsync_counter = 0;
                        quit_program = 0;
-                       hardboot = 0;
 
 #ifdef SAVESTATE
                        if (savestate_state == STATE_DORESTORE)
@@ -6326,7 +6325,6 @@ void m68k_go (int may_quit)
                                memory_clear ();
                                write_log (_T("hardreset, memory cleared\n"));
                        }
-                       cpu_hardreset = false;
 #ifdef SAVESTATE
                        /* We may have been restoring state, but we're done now.  */
                        if (isrestore ()) {
@@ -6341,7 +6339,7 @@ void m68k_go (int may_quit)
                                } else if (currprefs.mmu_model >= 68040) {
                                        mmu_set_tc (regs.tcr);
                                }
-                               startup = 1;
+                               hardboot = 1;
                        }
 #endif
                        if (currprefs.produce_sound == 0)
@@ -6398,12 +6396,14 @@ void m68k_go (int may_quit)
                }
 
                set_x_funcs();
-               if (startup) {
+               if (hardboot) {
                        custom_prepare();
                        mman_set_barriers(false);
                        protect_roms(true);
                }
-               startup = 0;
+               cpu_hardreset = false;
+               cpu_keyboardreset = false;
+               hardboot = 0;
                event_wait = true;
                unset_special(SPCFLAG_MODE_CHANGE);