adjustments for MAME
[picodrive.git] / cpu / Cyclone / OpLogic.cpp
index d0eafec..2a0c819 100644 (file)
@@ -27,7 +27,7 @@ int OpBtstReg(int op)
   use&=~0x0e00; // Use same handler for all registers\r
   if (op!=use) { OpUse(op,use); return 0; } // Use existing handler\r
 \r
-  OpStart(op);\r
+  OpStart(op,tea);\r
 \r
   if(type==1||type==3) {\r
     Cycles=8;\r
@@ -88,7 +88,7 @@ int OpBtstImm(int op)
   use=OpBase(op);\r
   if (op!=use) { OpUse(op,use); return 0; } // Use existing handler\r
 \r
-  OpStart(op);\r
+  OpStart(op,sea|tea);\r
 \r
   ot("  mov r10,#1\n");\r
   ot("\n");\r
@@ -145,7 +145,7 @@ int OpNeg(int op)
   use=OpBase(op);\r
   if (op!=use) { OpUse(op,use); return 0; } // Use existing handler\r
 \r
-  OpStart(op);   Cycles=size<2?4:6;\r
+  OpStart(op,ea);   Cycles=size<2?4:6;\r
   if(ea >= 0x10) {\r
     Cycles*=2;\r
 #ifdef CYCLONE_FOR_GENESIS\r
@@ -170,10 +170,10 @@ int OpNeg(int op)
     ot("  orr r3,r9,#0xb0000000 ;@ for old Z\n");\r
     OpGetFlags(1,1,0);\r
     if(size!=2) {\r
-         ot("  movs r1,r1,asr #%i\n",size?16:24);\r
+      ot("  movs r1,r1,asr #%i\n",size?16:24);\r
       ot("  orreq r9,r9,#0x40000000 ;@ possily missed Z\n");\r
-       }\r
-       ot("  andeq r9,r9,r3 ;@ fix Z\n");\r
+    }\r
+    ot("  andeq r9,r9,r3 ;@ fix Z\n");\r
     ot("\n");\r
   }\r
 \r
@@ -254,7 +254,7 @@ int OpTst(int op)
   use=OpBase(op);\r
   if (op!=use) { OpUse(op,use); return 0; } // Use existing handler\r
 \r
-  OpStart(op); Cycles=4;\r
+  OpStart(op,sea); Cycles=4;\r
 \r
   EaCalc ( 0,0x003f,sea,size,1);\r
   EaRead ( 0,     0,sea,size,0x003f,1);\r
@@ -322,7 +322,7 @@ int OpSet(int op)
   use=OpBase(op);\r
   if (op!=use) { OpUse(op,use); return 0; } // Use existing handler\r
 \r
-  OpStart(op); Cycles=8;\r
+  OpStart(op,ea); Cycles=8;\r
   if (ea<8) Cycles=4;\r
 \r
   ot("  mov r1,#0\n");\r
@@ -429,9 +429,9 @@ static int EmitAsr(int op,int type,int dir,int count,int size,int usereg)
     if(count == 1) {\r
       if(dir==0) {\r
         if(size!=2) {\r
-                 ot("  orr r0,r0,r0,lsr #%i\n", size?16:24);\r
-                 ot("  bic r0,r0,#0x%x\n", 1<<(32-wide));\r
-               }\r
+          ot("  orr r0,r0,r0,lsr #%i\n", size?16:24);\r
+          ot("  bic r0,r0,#0x%x\n", 1<<(32-wide));\r
+        }\r
         GetXBit(0);\r
         ot("  movs r0,r0,rrx\n");\r
         OpGetFlags(0,1);\r
@@ -619,7 +619,7 @@ int OpAsrEa(int op)
   use=OpBase(op);\r
   if (op!=use) { OpUse(op,use); return 0; } // Use existing handler\r
 \r
-  OpStart(op); Cycles=6; // EmitAsr() will add 2\r
+  OpStart(op,ea); Cycles=6; // EmitAsr() will add 2\r
 \r
   EaCalc (10,0x003f,ea,size,1);\r
   EaRead (10,     0,ea,size,0x003f,1);\r
@@ -645,7 +645,7 @@ int OpTas(int op, int gen_special)
   use=OpBase(op);\r
   if (op!=use) { OpUse(op,use); return 0; } // Use existing handler\r
 \r
-  if (!gen_special) OpStart(op);\r
+  if (!gen_special) OpStart(op,ea);\r
   else\r
     ot("Op%.4x_%s\n", op, ms?"":":");\r
 \r