From 018199e9b96c4c84094fa814b89b655dd7000276 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 1 Apr 2023 11:04:32 +0300 Subject: [PATCH] Check CPU reset immediately. --- custom.cpp | 6 +++++- drawing.cpp | 9 +++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/custom.cpp b/custom.cpp index 363bef8d..ebb2af0c 100644 --- a/custom.cpp +++ b/custom.cpp @@ -13865,7 +13865,11 @@ static void hsync_handler_post(bool onvsync) /* See if there's a chance of a copper wait ending this line. */ compute_spcflag_copper(); - + // check reset and process it immediately, don't wait for vsync + if (quit_program == -UAE_RESET || quit_program == -UAE_RESET_KEYBOARD || quit_program == -UAE_RESET_HARD) { + quit_program = -quit_program; + set_special(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE); + } #if 0 diff --git a/drawing.cpp b/drawing.cpp index 973cb0ba..3e48f381 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -5014,11 +5014,9 @@ void vsync_handle_redraw(int long_field, int lof_changed, uae_u16 bplcon0p, uae_ if (quit_program < 0) { #ifdef SAVESTATE - if (!savestate_state) { - if (currprefs.quitstatefile[0]) { - savestate_initsave(currprefs.quitstatefile, 1, 1, true); - save_state(currprefs.quitstatefile, _T("")); - } + if (!savestate_state && quit_program == -UAE_QUIT && currprefs.quitstatefile[0]) { + savestate_initsave(currprefs.quitstatefile, 1, 1, true); + save_state(currprefs.quitstatefile, _T("")); } #endif quit_program = -quit_program; @@ -5027,7 +5025,6 @@ void vsync_handle_redraw(int long_field, int lof_changed, uae_u16 bplcon0p, uae_ return; } - if (ad->framecnt == 0) { init_drawing_frame(); } else if (currprefs.cpu_memory_cycle_exact) { -- 2.47.3