]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Halt if exception and SSP pointing to non-existing memory.
authorToni Wilen <twilen@winuae.net>
Sat, 30 Apr 2016 13:52:18 +0000 (16:52 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 30 Apr 2016 13:52:18 +0000 (16:52 +0300)
include/newcpu.h
newcpu.cpp
statusline.cpp

index 1ca089cea6048aa5e0a336d50dff9df91ebbc755..2413c62e45f15cb4670e4ec928ff873cd01cd14b 100644 (file)
@@ -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);
index 37c01340dc8b6e2987cfaaff3fbf61140eeafed4..7de401c94676a334610e77b6868fcac0c0c1a65d 100644 (file)
@@ -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) {
index af0e0f04ca567c42674432d65d29d91ad2d214fe..e510867638c25ba3c604b6f1f22b32a8e52a4571 100644 (file)
@@ -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 {