X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2FCyclone%2FOpLogic.cpp;h=3389a8e5398f4af37bea6797122ff8a5faa648a6;hb=85a36a57a816ac643ee5f982d774532a0ca4d58b;hp=207ff4565fd00977908910d87e5f3efff30bc66b;hpb=b637c56aadc5b854ca28a8a111cf07324bc0e2ad;p=picodrive.git diff --git a/cpu/Cyclone/OpLogic.cpp b/cpu/Cyclone/OpLogic.cpp index 207ff45..3389a8e 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<