From: Toni Wilen Date: Fri, 3 Jul 2020 16:57:20 +0000 (+0300) Subject: CPU tester exception stacked PC validation X-Git-Tag: 4900~359 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f0cf95364331566c2bec8c7e961e6777ac478574;p=francis%2Fwinuae.git CPU tester exception stacked PC validation --- diff --git a/cputest.cpp b/cputest.cpp index ee106476..fd5be1dd 100644 --- a/cputest.cpp +++ b/cputest.cpp @@ -962,6 +962,10 @@ void REGPARAM2 MakeFromSR(void) MakeFromSR_x(0); } +void REGPARAM2 MakeFromSR_intmask(uae_u16 oldsr, uae_u16 newsr) +{ +} + void cpu_halt(int halt) { cpu_halted = halt; @@ -3919,10 +3923,15 @@ static uae_u8 *save_exception(uae_u8 *p, struct instr *dp) p = store_rel(p, 0, opcode_memory_start, gl(sf + 2), 1); // program counter p = store_rel(p, 0, opcode_memory_start, gl(sf + 10), 1); + } else { + // program counter + p = store_rel(p, 0, opcode_memory_start, gl(sf + 2), 1); } } else if (cpu_lvl > 0) { uae_u8 ccrmask = 0; uae_u16 frame = (sf[6] << 8) | sf[7]; + // program counter + p = store_rel(p, 0, opcode_memory_start, gl(sf + 2), 1); // frame + vector offset *p++ = sf[6]; *p++ = sf[7]; diff --git a/cputest/cputest_defines.h b/cputest/cputest_defines.h index e8c649b3..9be180a2 100644 --- a/cputest/cputest_defines.h +++ b/cputest/cputest_defines.h @@ -1,5 +1,5 @@ -#define DATA_VERSION 20 +#define DATA_VERSION 21 #define CT_FPREG 0 #define CT_DREG 0 diff --git a/cputest/main.c b/cputest/main.c index 26c80632..697a3dda 100644 --- a/cputest/main.c +++ b/cputest/main.c @@ -1711,12 +1711,24 @@ static uae_u8 *validate_exception(struct registers *regs, uae_u8 *p, short excnu alts += 2; } } + } else { + // sr + exc[0] = regs->sr >> 8; + exc[1] = regs->sr; + // program counter + v = opcode_memory_addr; + p = restore_rel_ordered(p, &v); + pl(exc + 2, v); + exclen = 6; } } else if (cpu_lvl > 0) { // sr exc[0] = regs->sr >> 8; exc[1] = regs->sr; - pl(exc + 2, regs->pc); + // program counter + v = opcode_memory_addr; + p = restore_rel_ordered(p, &v); + pl(exc + 2, v); const uae_u16 t0 = *p++; const uae_u16 t1 = *p++; // frame type