From: Toni Wilen Date: Tue, 17 Sep 2019 16:37:51 +0000 (+0300) Subject: Interrupt mask support fix. X-Git-Tag: 4300~118 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=98d880ac813d6691b179ec9a58491745d95a6216;p=francis%2Fwinuae.git Interrupt mask support fix. --- diff --git a/cputest.cpp b/cputest.cpp index 847f39fc..0fea4213 100644 --- a/cputest.cpp +++ b/cputest.cpp @@ -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 diff --git a/cputest/main.c b/cputest/main.c index 0afc5f55..552cbabe 100644 --- a/cputest/main.c +++ b/cputest/main.c @@ -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(®s, 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;