From f65aef25ff4641c8e692c75c068b632255d6c3e0 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 10 May 2020 14:15:40 +0300 Subject: [PATCH] 68000 bus error update. 68010 bus/address error PC field test fixed. Bus error test memory region check fixed. --- cputest.cpp | 6 +++++- cputest/main.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cputest.cpp b/cputest.cpp index 21242367..e087fe5b 100644 --- a/cputest.cpp +++ b/cputest.cpp @@ -1191,6 +1191,7 @@ static void exception2_fetch_common(uae_u32 opcode, int offset) void exception2_fetch(uae_u32 opcode, int offset) { exception2_fetch_common(opcode, offset); + regs.pc = test_exception_addr; doexcstack(); } @@ -1200,6 +1201,7 @@ void exception2_fetch_opcode(uae_u32 opcode, int offset) if (currprefs.cpu_model == 68010) { test_exception_3_di = -1; } + regs.pc = test_exception_addr; doexcstack(); } @@ -3879,6 +3881,8 @@ static uae_u8 *save_exception(uae_u8 *p, struct instr *dp) *p++ = regs.fp_ea_set ? 0x01 : 0x00; break; case 8: // 68010 address/bus error + // program counter + p = store_rel(p, 0, opcode_memory_start, gl(sf + 2), 1); // SSW *p++ = sf[8]; *p++ = sf[9]; @@ -6144,7 +6148,7 @@ static int test(struct ini_data *ini, const TCHAR *sections, const TCHAR *testna } if (safe_memory_start != 0xffffffff) { - int err = check_safe_memory(test_low_memory_start, test_low_memory_end); + int err = check_safe_memory(test_memory_start, test_memory_end); err += check_safe_memory(test_low_memory_start, test_low_memory_end); err += check_safe_memory(test_high_memory_start, test_high_memory_end); if (err == 3) { diff --git a/cputest/main.c b/cputest/main.c index 86f6f9cc..d2eaf9b3 100644 --- a/cputest/main.c +++ b/cputest/main.c @@ -1699,6 +1699,10 @@ static uae_u8 *validate_exception(struct registers *regs, uae_u8 *p, short excnu break; case 8: // 68010 bus/address error { + // program counter + v = opcode_memory_addr; + p = restore_rel_ordered(p, &v); + pl(exc + 2, v); uae_u16 ssw = (p[0] << 8) | p[1]; exc[8] = *p++; exc[9] = *p++; -- 2.47.3