From 9073c05e0b40007ec20274f062c5700be4b8cf00 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 31 May 2020 19:42:55 +0300 Subject: [PATCH] Optional BKPT CPU halt. --- cfgfile.cpp | 3 +++ include/newcpu.h | 1 + include/options.h | 1 + newcpu.cpp | 9 +++++++++ 4 files changed, 14 insertions(+) diff --git a/cfgfile.cpp b/cfgfile.cpp index 37d652cd..f536abe7 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -2429,6 +2429,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite_bool(f, _T("resetwarning"), p->cs_resetwarning); cfgfile_dwrite_bool(f, _T("denise_noehb"), p->cs_denisenoehb); cfgfile_dwrite_bool(f, _T("agnus_bltbusybug"), p->cs_agnusbltbusybug); + cfgfile_dwrite_bool(f, _T("bkpt_halt"), p->cs_bkpthang); cfgfile_dwrite_bool(f, _T("ics_agnus"), p->cs_dipagnus); cfgfile_dwrite_bool(f, _T("cia_todbug"), p->cs_ciatodbug); cfgfile_dwrite_bool(f, _T("z3_autoconfig"), p->cs_z3autoconfig); @@ -5405,6 +5406,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || cfgfile_yesno(option, value, _T("rom_is_slow"), &p->cs_romisslow) || cfgfile_yesno(option, value, _T("1mchipjumper"), &p->cs_1mchipjumper) || cfgfile_yesno(option, value, _T("agnus_bltbusybug"), &p->cs_agnusbltbusybug) + || cfgfile_yesno(option, value, _T("bkpt_halt"), &p->cs_bkpthang) || cfgfile_yesno(option, value, _T("gfxcard_hardware_vblank"), &p->rtg_hardwareinterrupt) || cfgfile_yesno(option, value, _T("gfxcard_hardware_sprite"), &p->rtg_hardwaresprite) || cfgfile_yesno(option, value, _T("gfxcard_multithread"), &p->rtg_multithread) @@ -8847,6 +8849,7 @@ int built_in_chipset_prefs (struct uae_prefs *p) p->cs_denisenoehb = 0; p->cs_dipagnus = 0; p->cs_agnusbltbusybug = 0; + p->cs_bkpthang = 0; p->cs_mbdmac = 0; p->cs_pcmcia = 0; p->cs_ksmirror_e0 = 1; diff --git a/include/newcpu.h b/include/newcpu.h index 668a9d02..ef9428bb 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -840,6 +840,7 @@ extern bool can_cpu_tracer (void); #define CPU_HALT_SSP_IN_NON_EXISTING_ADDRESS 10 #define CPU_HALT_INVALID_START_ADDRESS 11 #define CPU_HALT_68060_HALT 12 +#define CPU_HALT_BKPT 13 uae_u32 process_cpu_indirect_memory_read(uae_u32 addr, int size); void process_cpu_indirect_memory_write(uae_u32 addr, uae_u32 data, int size); diff --git a/include/options.h b/include/options.h index 76e930f4..0e9ac2ad 100644 --- a/include/options.h +++ b/include/options.h @@ -674,6 +674,7 @@ struct uae_prefs { bool cs_color_burst; bool cs_romisslow; bool cs_toshibagary; + bool cs_bkpthang; int cs_unmapped_space; int cs_hacks; int cs_ciatype[2]; diff --git a/newcpu.cpp b/newcpu.cpp index 09062b6d..e312b446 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -3582,6 +3582,15 @@ uae_u32 REGPARAM2 op_illg (uae_u32 opcode) return 4; } + // BKPT? + if (opcode >= 0x4848 && opcode <= 0x484f && currprefs.cpu_model >= 68020) { + // some boards hang because there is no break point cycle acknowledge + if (currprefs.cs_bkpthang) { + cpu_halt(CPU_HALT_BKPT); + return 4; + } + } + if (debugmem_illg(opcode)) { m68k_incpc_normal(2); return 4; -- 2.47.3