X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2FCyclone%2FOpLogic.cpp;h=65d229379cd4308e8dadc164689f6cc30213dc02;hb=60305cdd4d832c9a0b69914a78d4668a1b4d2b48;hp=33be8c94ac605efabe984d244ca48b9fd6e88aa0;hpb=3a5e6cf8477084dd63ab1eeadef88db3d218caea;p=picodrive.git diff --git a/cpu/Cyclone/OpLogic.cpp b/cpu/Cyclone/OpLogic.cpp index 33be8c9..65d2293 100644 --- a/cpu/Cyclone/OpLogic.cpp +++ b/cpu/Cyclone/OpLogic.cpp @@ -23,7 +23,7 @@ int OpBtstReg(int op) if (EaCanWrite(tea)==0) return 1; } - use=OpBase(op); + use=OpBase(op,size); use&=~0x0e00; // Use same handler for all registers if (op!=use) { OpUse(op,use); return 0; } // Use existing handler @@ -36,13 +36,9 @@ int OpBtstReg(int op) if(size>=2) Cycles+=2; } - EaCalc (10,0x0e00,sea,0,0,0); - EaRead (10, 10,sea,0,0x0e00,0,0); + EaCalcReadNoSE(-1,10,sea,0,0x0e00); - EaCalc ( 0,0x003f,tea,size,0,0); - if (type>0) - ot(" mov r11,r0\n"); - EaRead ( 0, 0,tea,size,0x003f,0,0); + EaCalcReadNoSE((type>0)?11:-1,0,tea,size,0x003f); if (tea>=0x10) ot(" and r10,r10,#7 ;@ mem - do mod 8\n"); // size always 0 @@ -89,14 +85,13 @@ int OpBtstImm(int op) if (EaCanWrite(tea)==0) return 1; } - use=OpBase(op); + use=OpBase(op,size); if (op!=use) { OpUse(op,use); return 0; } // Use existing handler OpStart(op,sea,tea); ot("\n"); - EaCalc ( 0,0x0000,sea,0,0,0); - EaRead ( 0, 0,sea,0,0,0,0); + EaCalcReadNoSE(-1,0,sea,0,0); ot(" mov r10,#1\n"); ot(" bic r9,r9,#0x40000000 ;@ Blank Z flag\n"); if (tea>=0x10) @@ -112,8 +107,7 @@ int OpBtstImm(int op) if(size>=2) Cycles+=2; } - EaCalc (11,0x003f,tea,size,0,0); - EaRead (11, 0,tea,size,0x003f,0,0); + EaCalcReadNoSE((type>0)?11:-1,0,tea,size,0x003f); ot(" tst r0,r10 ;@ Do arithmetic\n"); ot(" orreq r9,r9,#0x40000000 ;@ Get Z flag\n"); ot("\n"); @@ -146,7 +140,7 @@ int OpNeg(int op) if (EaCanRead (ea,size)==0||EaAn(ea)) return 1; if (EaCanWrite(ea )==0) return 1; - use=OpBase(op); + use=OpBase(op,size); if (op!=use) { OpUse(op,use); return 0; } // Use existing handler OpStart(op,ea); Cycles=size<2?4:6; @@ -162,7 +156,7 @@ int OpNeg(int op) EaCalc (10,0x003f,ea,size,0,0); - if (type!=1) EaRead (10,0,ea,size,0x003f,0,0); // Don't need to read for 'clr' (or do we, for dummy read?) + if (type!=1) EaRead (10,0,ea,size,0x003f,0,0); // Don't need to read for 'clr' (or do we, for a dummy read?) if (type==1) ot("\n"); if (type==0) @@ -260,7 +254,7 @@ int OpTst(int op) // See if we can do this opcode: if (EaCanWrite(sea)==0||EaAn(sea)) return 1; - use=OpBase(op); + use=OpBase(op,size); if (op!=use) { OpUse(op,use); return 0; } // Use existing handler OpStart(op,sea); Cycles=4; @@ -288,7 +282,7 @@ int OpExt(int op) size=(op>>6)&1; shift=32-(8<