]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
hard reset if cpu halt options
authorToni Wilen <twilen@winuae.net>
Sat, 27 Apr 2019 17:52:59 +0000 (20:52 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 27 Apr 2019 17:52:59 +0000 (20:52 +0300)
cfgfile.cpp
include/options.h
newcpu.cpp

index d17cf152d8efe554dd6904810a307c30093e67cf..02e2b75d9e829d9196629df9465f9ac3f68bbcfc 100644 (file)
@@ -2571,6 +2571,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_write_bool (f, _T("cpu_data_cache"), p->cpu_data_cache);
        /* do not reorder end */
        cfgfile_dwrite_bool(f, _T("cpu_reset_pause"), p->reset_delay);
+       cfgfile_dwrite_bool(f, _T("cpu_halt_auto_reset"), p->crash_auto_reset);
        cfgfile_dwrite_bool(f, _T("cpu_threaded"), p->cpu_thread);
        if (p->ppc_mode)
                cfgfile_write_str(f, _T("ppc_implementation"), ppc_implementations[p->ppc_implementation]);
@@ -5388,6 +5389,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
                || cfgfile_yesno(option, value, _T("cpu_threaded"), &p->cpu_thread)
                || cfgfile_yesno(option, value, _T("cpu_24bit_addressing"), &p->address_space_24)
                || cfgfile_yesno(option, value, _T("cpu_reset_pause"), &p->reset_delay)
+               || cfgfile_yesno(option, value, _T("cpu_halt_auto_reset"), &p->crash_auto_reset)
                || cfgfile_yesno(option, value, _T("parallel_on_demand"), &p->parallel_demand)
                || cfgfile_yesno (option, value, _T("parallel_postscript_emulation"), &p->parallel_postscript_emulation)
                || cfgfile_yesno (option, value, _T("parallel_postscript_detection"), &p->parallel_postscript_detection)
index ee76df48b4b4d67d20a8eabdb17552f816c37068..1d1609fd42475092b4c13f52df955d86958fcf70 100644 (file)
@@ -629,6 +629,7 @@ struct uae_prefs {
        TCHAR filesys_inject_icons_drawer[MAX_DPATH];
        int uaescsidevmode;
        bool reset_delay;
+       bool crash_auto_reset;
 
        int cs_compatible;
        int cs_ciaatod;
index 48b97be64a356954e2bc1f27ff3e3c6190e522d9..09e13fcca51e446641380d91663ca9db6d230bd2 100644 (file)
@@ -5795,6 +5795,13 @@ void cpu_halt (int id)
        // id > 0: emulation halted.
        if (!regs.halted) {
                write_log (_T("CPU halted: reason = %d PC=%08x\n"), id, M68K_GETPC);
+               if (currprefs.crash_auto_reset) {
+                       write_log(_T("Forcing hard reset\n"));
+                       uae_reset(true, false);
+                       quit_program = -quit_program;
+                       set_special(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE);
+                       return;
+               }
                regs.halted = id;
                gui_data.cpu_halted = id;
                gui_led(LED_CPU, 0, -1);