From: Toni Wilen Date: Sun, 17 May 2020 09:19:20 +0000 (+0300) Subject: Fix 68000 MOVE write address error stacked PC. X-Git-Tag: 4400~38 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=71a11cce49b79cb4a3b2beef3cc10bf113f4df3a;p=francis%2Fwinuae.git Fix 68000 MOVE write address error stacked PC. --- diff --git a/gencpu.cpp b/gencpu.cpp index 5531df2c..502a5266 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -3085,9 +3085,21 @@ static void check_address_error(const char *name, int mode, const char *reg, in setapdiback = 1; } + int pcextra = 0; + + // adjust MOVE write address error stacked PC + if (g_instr->mnemo == i_MOVE && getv == 2) { + if (g_instr->smode >= Aind && g_instr->smode != imm && g_instr->dmode == absl) { + pcextra = -2; + } else if (g_instr->dmode >= Ad16) { + pcextra = 0; + } else { + pcextra = 2; + } + } - if (exception_pc_offset || exception_pc_offset_extra) { - incpc("%d", exception_pc_offset + exception_pc_offset_extra); + if (exception_pc_offset + exception_pc_offset_extra + pcextra) { + incpc("%d", exception_pc_offset + exception_pc_offset_extra + pcextra); } if (g_instr->mnemo == i_MOVE) {