From 9a1d5ba3a757b1a2588b9b0cebb1d89ae0e40039 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 10 Aug 2016 04:56:55 +0200 Subject: [PATCH] The only x86 exception now logged is illegal instruction. --- src/386_dynarec.c | 6 +++++- src/x86seg.c | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/386_dynarec.c b/src/386_dynarec.c index 84865d36d..4a7478473 100644 --- a/src/386_dynarec.c +++ b/src/386_dynarec.c @@ -269,12 +269,13 @@ void x86_int_sw(int num) CPU_BLOCK_END(); } +int prev_prev_opcode = 0; int prev_opcode = 0; void x86illegal() { uint16_t addr; - pclog("x86 illegal %04X %08X %04X:%08X %02X (prev. %02X)\n",msw,cr0,CS,cpu_state.pc,opcode,prev_opcode); + pclog("x86 illegal %04X %08X %04X:%08X %02X (prev. %02X, prev. prev. %02X)\n",msw,cr0,CS,cpu_state.pc,opcode,prev_opcode,prev_prev_opcode); // if (output) // { @@ -1272,6 +1273,7 @@ void exec386_dynarec(int cycs) if (!abrt) { trap = flags & T_FLAG; + prev_prev_opcode = prev_opcode; prev_opcode = opcode; opcode = fetchdat & 0xFF; fetchdat >>= 8; @@ -1424,6 +1426,7 @@ inrecomp=0; if (!abrt) { trap = flags & T_FLAG; + prev_prev_opcode = prev_opcode; prev_opcode = opcode; opcode = fetchdat & 0xFF; fetchdat >>= 8; @@ -1504,6 +1507,7 @@ inrecomp=0; if (!abrt) { trap = flags & T_FLAG; + prev_prev_opcode = prev_opcode; prev_opcode = opcode; opcode = fetchdat & 0xFF; fetchdat >>= 8; diff --git a/src/x86seg.c b/src/x86seg.c index eb2aa079f..d13824eee 100644 --- a/src/x86seg.c +++ b/src/x86seg.c @@ -145,25 +145,25 @@ void x86_doabrt(int x86_abrt) } void x86gpf(char *s, uint16_t error) { - pclog("GPF %04X : %s\n", error, s); + // pclog("GPF %04X : %s\n", error, s); abrt = ABRT_GPF; abrt_error = error; } void x86ss(char *s, uint16_t error) { - pclog("SS %04X\n", error); + // pclog("SS %04X\n", error); abrt = ABRT_SS; abrt_error = error; } void x86ts(char *s, uint16_t error) { - pclog("TS %04X\n", error); + // pclog("TS %04X\n", error); abrt = ABRT_TS; abrt_error = error; } void x86np(char *s, uint16_t error) { - pclog("NP %04X : %s\n", error, s); + // pclog("NP %04X : %s\n", error, s); abrt = ABRT_NP; abrt_error = error; }