drc: some debug improvements
[picodrive.git] / cpu / sh2 / mame / sh2.c
index 0010a69..81203e7 100644 (file)
 #ifndef USE_SH2DRC\r
 \r
 /* speed up delay loops, bail out of tight loops */\r
-#define BUSY_LOOP_HACKS        1\r
+//#define BUSY_LOOP_HACKS      1\r
 \r
 #define VERBOSE 0\r
 \r
@@ -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