32x: change ppc handling for better logging
authornotaz <notasas@gmail.com>
Wed, 23 Sep 2009 21:32:20 +0000 (21:32 +0000)
committernotaz <notasas@gmail.com>
Wed, 23 Sep 2009 21:32:20 +0000 (21:32 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@791 be3aeb3a-fb24-0410-a615-afba39da0efa

cpu/sh2mame/sh2.c
cpu/sh2mame/sh2pico.c

index c466645..1fb6fc4 100644 (file)
@@ -367,7 +367,7 @@ INLINE void BRA(UINT32 d)
 #if BUSY_LOOP_HACKS\r
        if (disp == -2)\r
        {\r
-               UINT32 next_opcode = RW(sh2->ppc & AM);\r
+               UINT32 next_opcode = RW(sh2->pc & AM);\r
                /* BRA  $\r
          * NOP\r
          */\r
@@ -795,7 +795,7 @@ INLINE void DT(UINT32 n)
                sh2->sr &= ~T;\r
 #if BUSY_LOOP_HACKS\r
        {\r
-               UINT32 next_opcode = RW(sh2->ppc & AM);\r
+               UINT32 next_opcode = RW(sh2->pc & AM);\r
                /* DT   Rn\r
          * BF   $-2\r
          */\r
index 414985c..463261e 100644 (file)
@@ -71,15 +71,18 @@ int sh2_execute(SH2 *sh2_, int cycles)
 
                if (sh2->delay)
                {
+                       sh2->ppc = sh2->delay;
                        opcode = RW(sh2->delay);
                        sh2->pc -= 2;
                }
                else
+               {
+                       sh2->ppc = sh2->pc;
                        opcode = RW(sh2->pc);
+               }
 
                sh2->delay = 0;
                sh2->pc += 2;
-               sh2->ppc = sh2->pc;
 
                switch (opcode & ( 15 << 12))
                {