]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Interrupt mask support fix.
authorToni Wilen <twilen@winuae.net>
Tue, 17 Sep 2019 16:37:51 +0000 (19:37 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 17 Sep 2019 16:37:51 +0000 (19:37 +0300)
cputest.cpp
cputest/main.c

index 847f39fc43ad589367201e20333d85f5737002b5..0fea4213751ad7f7481a223ddd16d3e02f9a410c 100644 (file)
@@ -1236,7 +1236,7 @@ static void save_data(uae_u8 *dst, const TCHAR *dir)
                fwrite(data, 1, 4, f);
                pl(data, opcode_memory_start - test_memory_start);
                fwrite(data, 1, 4, f);
-               pl(data, (cpu_lvl << 16) | sr_undefined_mask | (addressing_mask == 0xffffffff ? 0x80000000 : 0) | ((feature_flag_mode & 1) << 30));
+               pl(data, (cpu_lvl << 16) | sr_undefined_mask | (addressing_mask == 0xffffffff ? 0x80000000 : 0) | ((feature_flag_mode & 1) << 30) | (feature_min_interrupt_mask << 20));
                fwrite(data, 1, 4, f);
                pl(data, currprefs.fpu_model);
                fwrite(data, 1, 4, f);
@@ -2266,6 +2266,7 @@ static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfi
                        dst = store_fpureg(dst, CT_FPREG + i, cur_fpuregisters[i]);
                        regs.fp[i].fpx = cur_fpuregisters[i];
                }
+               regs.sr = feature_min_interrupt_mask << 8;
 
                for (int opcode = 0; opcode < 65536; opcode++) {
 
@@ -2597,6 +2598,7 @@ static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfi
                                                        } else {
                                                                regs.sr = ((ccr & 1) ? 31 : 0) | sr_mask;
                                                        }
+                                                       regs.sr |= feature_min_interrupt_mask << 8;
                                                        regs.usp = regs.regs[8 + 7];
                                                        regs.isp = test_memory_end - 0x80;
                                                        // copy user stack to super stack, for RTE etc support
index 0afc5f5500fbd72f8e7ba888395edc4ed1d3ce52..552cbabed70e4eed87c93c9cc14f20d359d31e7d 100644 (file)
@@ -54,8 +54,8 @@ static uae_u8 *opcode_memory;
 static uae_u32 opcode_memory_addr;
 static uae_u8 *low_memory;
 static uae_u8 *high_memory;
-static uae_u32 low_memory_size;
-static uae_u32 high_memory_size;
+static int low_memory_size;
+static int high_memory_size;
 static uae_u8 *test_memory;
 static uae_u32 test_memory_addr;
 static uae_u32 test_memory_size;
@@ -99,6 +99,7 @@ static int dooutput = 1;
 static int quit;
 static uae_u8 ccr_mask;
 static uae_u32 addressing_mask = 0x00ffffff;
+static uae_u32 interrupt_mask;
 
 #ifndef M68K
 
@@ -738,7 +739,7 @@ struct srbit
        char *name;
        int bit;
 };
-static struct srbit srbits[] = {
+static const struct srbit srbits[] = {
        { "T1", 15 },
        { "T0", 14 },
        { "M", 13 },
@@ -1283,6 +1284,7 @@ static void process_test(uae_u8 *p)
        errors = 0;
 
        memset(&regs, 0, sizeof(struct registers));
+       regs.sr = interrupt_mask << 8;
 
        start_test();
 
@@ -1352,7 +1354,7 @@ static void process_test(uae_u8 *p)
                                } else {
                                        test_regs.sr = (ccr ? 31 : 0);
                                }
-                               test_regs.sr |= sr_mask;
+                               test_regs.sr |= sr_mask | (interrupt_mask << 8);
                                uae_u32 test_sr = test_regs.sr;
                                if (fpumode) {
                                        if (flag_mode == 0) {
@@ -1500,6 +1502,7 @@ static int test_mnemo(const char *path, const char *opcode)
        opcode_memory_addr = gl(data) + test_memory_addr;
        fread(data, 1, 4, f);
        lvl = (gl(data) >> 16) & 15;
+       interrupt_mask = (gl(data) >> 20) & 7;
        addressing_mask = (gl(data) & 0x80000000) ? 0xffffffff : 0x00ffffff;
        flag_mode = (gl(data) >> 30) & 1;
        sr_undefined_mask = gl(data) & 0xffff;