drc: lots of new debug code
[picodrive.git] / cpu / sh2 / mame / sh2.c
index 0010a69..44cd7ea 100644 (file)
@@ -349,11 +349,13 @@ INLINE void BF(sh2_state *sh2, UINT32 d)
  */\r
 INLINE void BFS(sh2_state *sh2, UINT32 d)\r
 {\r
+       sh2->delay = sh2->pc;\r
+       sh2->pc += 2;\r
+\r
        if ((sh2->sr & T) == 0)\r
        {\r
                INT32 disp = ((INT32)d << 24) >> 24;\r
-               sh2->delay = sh2->pc;\r
-               sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;\r
+               sh2->pc = sh2->ea = sh2->pc + disp * 2;\r
                sh2->icount--;\r
        }\r
 }\r
@@ -439,11 +441,13 @@ INLINE void BT(sh2_state *sh2, UINT32 d)
  */\r
 INLINE void BTS(sh2_state *sh2, UINT32 d)\r
 {\r
+       sh2->delay = sh2->pc;\r
+       sh2->pc += 2;\r
+\r
        if ((sh2->sr & T) != 0)\r
        {\r
                INT32 disp = ((INT32)d << 24) >> 24;\r
-               sh2->delay = sh2->pc;\r
-               sh2->pc = sh2->ea = sh2->pc + disp * 2 + 2;\r
+               sh2->pc = sh2->ea = sh2->pc + disp * 2;\r
                sh2->icount--;\r
        }\r
 }\r