From: Toni Wilen Date: Fri, 23 Sep 2022 17:36:50 +0000 (+0300) Subject: Hard reset CPU startup was not identical to initial power up. X-Git-Tag: 41000~138 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=d5ed0c65d2e16c66ced51c8d66a22f5506335fab;p=francis%2Fwinuae.git Hard reset CPU startup was not identical to initial power up. --- diff --git a/newcpu.cpp b/newcpu.cpp index 861eef58..0e0162f5 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -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);