From: Toni Wilen Date: Sat, 30 Apr 2016 13:52:18 +0000 (+0300) Subject: Halt if exception and SSP pointing to non-existing memory. X-Git-Tag: 3300~46 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=1c64080a9cd08c5087b800e1f3fd3a74530fc7b4;p=francis%2Fwinuae.git Halt if exception and SSP pointing to non-existing memory. --- diff --git a/include/newcpu.h b/include/newcpu.h index 1ca089ce..2413c62e 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -687,6 +687,7 @@ extern bool can_cpu_tracer (void); #define CPU_HALT_AUTOCONFIG_CONFLICT 7 #define CPU_HALT_PCI_CONFLICT 8 #define CPU_HALT_CPU_STUCK 9 +#define CPU_HALT_SSP_IN_NON_EXISTING_ADDRESS 10 void cpu_semaphore_get(void); void cpu_semaphore_release(void); diff --git a/newcpu.cpp b/newcpu.cpp index 37c01340..7de401c9 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2712,6 +2712,14 @@ static void Exception_normal (int nr) return; } + if (!currprefs.cpu_compatible) { + addrbank *ab = &get_mem_bank(m68k_areg(regs, 7)); + if (!ab || !(ab->flags & ABFLAG_RAM)) { + cpu_halt(CPU_HALT_SSP_IN_NON_EXISTING_ADDRESS); + return; + } + } + if (currprefs.cpu_model > 68000) { currpc = exception_pc (nr); if (nr == 2 || nr == 3) { diff --git a/statusline.cpp b/statusline.cpp index af0e0f04..e5108676 100644 --- a/statusline.cpp +++ b/statusline.cpp @@ -190,9 +190,9 @@ void draw_status_line_single (uae_u8 *buf, int bpp, int y, int totalwidth, uae_u am = 3; } else { on_rgb = 0xcccc00; - num1 = -1; - num2 = 11; - num3 = gui_data.cpu_halted; + num1 = gui_data.cpu_halted >= 10 ? 11 : -1; + num2 = gui_data.cpu_halted >= 10 ? gui_data.cpu_halted / 10 : 11; + num3 = gui_data.cpu_halted % 10; am = 2; } } else {