]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix 68000 MOVE write address error stacked PC.
authorToni Wilen <twilen@winuae.net>
Sun, 17 May 2020 09:19:20 +0000 (12:19 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 17 May 2020 09:19:20 +0000 (12:19 +0300)
gencpu.cpp

index 5531df2c01275feb9a031fd1a59e229dcc65f458..502a526681b1c2364a0f6e720c37e38c4f3f783c 100644 (file)
@@ -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) {