From: Toni Wilen Date: Sat, 27 Apr 2019 17:52:59 +0000 (+0300) Subject: hard reset if cpu halt options X-Git-Tag: 4300~233 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8def2477c33e73b6236414fc958daad3ce028877;p=francis%2Fwinuae.git hard reset if cpu halt options --- diff --git a/cfgfile.cpp b/cfgfile.cpp index d17cf152..02e2b75d 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -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) diff --git a/include/options.h b/include/options.h index ee76df48..1d1609fd 100644 --- a/include/options.h +++ b/include/options.h @@ -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; diff --git a/newcpu.cpp b/newcpu.cpp index 48b97be6..09e13fcc 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -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);