X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=OpArith.cpp;h=ca277d9d728898f169ce2b6dfd48d41619446701;hb=19a2e09532d56379faa16b2a95bff6703a35774f;hp=e95683103c4e2050c37e1d31d366ad7bccdccf89;hpb=3504ce942735ae4283cd47ca6defaae87b550c57;p=cyclone68000.git diff --git a/OpArith.cpp b/OpArith.cpp index e956831..ca277d9 100644 --- a/OpArith.cpp +++ b/OpArith.cpp @@ -37,8 +37,8 @@ int OpArith(int op) OpStart(op, sea, tea); Cycles=4; // imm must be read first - EaCalcReadNoSE(-1,10,sea,size,0); - EaCalcReadNoSE((type!=6)?11:-1,0,tea,size,0x003f); + EaCalcRead(-1,10,sea,size,0,earwt_msb_dont_care); + EaCalcRead((type!=6)?11:-1,0,tea,size,0x003f,earwt_msb_dont_care); if (size<2) shiftstr=(char *)(size?",asl #16":",asl #24"); if (size<2) ot(" mov r10,r10,asl #%i\n",size?16:24); @@ -61,7 +61,7 @@ int OpArith(int op) if (type!=6) { - EaWrite(11, 1, tea,size,0x003f,1); + EaWrite(11, 1, tea,size,0x003f,earwt_shifted_up); } // Correct cycles: @@ -112,7 +112,7 @@ int OpAddq(int op) if (size>0 && (ea&0x38)==0x08) size=2; // addq.w #n,An is also 32-bit - EaCalcReadNoSE(11,0,ea,size,0x003f); + EaCalcRead(11,0,ea,size,0x003f,earwt_msb_dont_care); shift=32-(8<=2)?8:4; else Cycles+=(size>=2)?26:14; @@ -240,7 +240,7 @@ int OpMul(int op) if(type) Cycles=54; else Cycles=sign?158:140; - EaCalcReadNoSE(-1,0,ea,1,0x003f); + EaCalcRead(-1,0,ea,1,0x003f,earwt_msb_dont_care); EaCalc(11,0x0e00,rea, 2); EaRead(11, 2,rea, 2,0x0e00); @@ -344,7 +344,7 @@ int OpMul(int op) } ot("\n"); - EaWrite(11, 1,rea, 2,0x0e00,1); + EaWrite(11, 1,rea, 2,0x0e00,earwt_shifted_up); if (type==0) ot("endofop%.4x%s\n",op,ms?"":":"); OpEnd(ea); @@ -397,15 +397,15 @@ int OpAbcd(int op) if (mem) { ot(";@ Get src/dest EA vals\n"); - EaCalc (0,0x000f, sea,0,1); - EaRead (0, 6, sea,0,0x000f,1); - EaCalcReadNoSE(11,0,dea,0,0x0e00); + EaCalc (0,0x000f, sea,0,earwt_shifted_up); + EaRead (0, 6, sea,0,0x000f,earwt_shifted_up); + EaCalcRead(11,0,dea,0,0x0e00,earwt_msb_dont_care); } else { ot(";@ Get src/dest reg vals\n"); - EaCalcReadNoSE(-1,6,sea,0,0x0007); - EaCalcReadNoSE(11,0,dea,0,0x0e00); + EaCalcRead(-1,6,sea,0,0x0007,earwt_msb_dont_care); + EaCalcRead(11,0,dea,0,0x0e00,earwt_msb_dont_care); ot(" mov r6,r6,asl #24\n"); } ot(" mov r1,r0,asl #24\n\n"); @@ -470,7 +470,7 @@ int OpAbcd(int op) ot(" str r10,[r7,#0x4c] ;@ Save X bit\n"); ot("\n"); - EaWrite(11, 0, dea,0,0x0e00,1); + EaWrite(11, 0, dea,0,0x0e00,earwt_shifted_up); ot(" ldr r6,[r7,#0x54]\n"); OpEnd(sea,dea); @@ -494,7 +494,7 @@ int OpNbcd(int op) OpStart(op,ea); Cycles=6; if(ea >= 8) Cycles+=2; - EaCalcReadNoSE(6,0,ea,0,0x003f); + EaCalcRead(6,0,ea,0,0x003f,earwt_msb_dont_care); // this is rewrite of Musashi's code ot(" ldr r2,[r7,#0x4c]\n"); @@ -508,19 +508,19 @@ int OpNbcd(int op) ot(" beq finish%.4x\n",op); ot("\n"); - ot(" mvn r3,r11,lsr #31 ;@ Undefined V behavior\n",op); + ot(" mvn r3,r11,lsr #31 ;@ Undefined V behavior\n"); ot(" and r2,r11,#0x0f000000\n"); ot(" cmp r2,#0x0a000000\n"); ot(" andeq r11,r11,#0xf0000000\n"); ot(" addeq r11,r11,#0x10000000\n"); - ot(" and r3,r3,r11,lsr #31 ;@ Undefined V behavior part II\n",op); + ot(" and r3,r3,r11,lsr #31 ;@ Undefined V behavior part II\n"); ot(" movs r1,r11,asr #24\n"); ot(" bicne r10,r10,#0x40000000 ;@ Z\n"); - ot(" orr r10,r10,r3,lsl #28 ;@ save V\n",op); + ot(" orr r10,r10,r3,lsl #28 ;@ save V\n"); ot(" orr r10,r10,#0x20000000 ;@ C\n"); ot("\n"); - EaWrite(6, 1, ea,0,0x3f,0,0); + EaWrite(6, 1, ea,0,0x3f,earwt_msb_dont_care); ot("finish%.4x%s\n",op,ms?"":":"); ot(" tst r11,r11\n"); @@ -564,14 +564,14 @@ int OpAritha(int op) // different emus act differently in this situation, I couldn't fugure which is right behaviour. //if (type == 1) { - EaCalcReadNoSE(-1,0,sea,size,0x003f); - EaCalcReadNoSE(type!=1?11:-1,1,dea,2,0x0e00); + EaCalcRead(-1,0,sea,size,0x003f,earwt_msb_dont_care); + EaCalcRead(type!=1?11:-1,1,dea,2,0x0e00,earwt_msb_dont_care); } #if 0 else { - EaCalcReadNoSE(type!=1?11:-1,1,dea,2,0x0e00); - EaCalcReadNoSE(-1,0,sea,size,0x003f); + EaCalcRead(type!=1?11:-1,1,dea,2,0x0e00,earwt_msb_dont_care); + EaCalcRead(-1,0,sea,size,0x003f,earwt_msb_dont_care); } #endif @@ -623,15 +623,15 @@ int OpAddx(int op) if (mem) { ot(";@ Get src/dest EA vals\n"); - EaCalc (0,0x000f, sea,size,1); - EaRead (0, 6, sea,size,0x000f,1); - EaCalcReadNoSE(11,0,dea,size,0x0e00); + EaCalc (0,0x000f, sea,size,earwt_shifted_up); + EaRead (0, 6, sea,size,0x000f,earwt_shifted_up); + EaCalcRead(11,0,dea,size,0x0e00,earwt_msb_dont_care); } else { ot(";@ Get src/dest reg vals\n"); - EaCalcReadNoSE(-1,6,sea,size,0x0007); - EaCalcReadNoSE(11,0,dea,size,0x0e00); + EaCalcRead(-1,6,sea,size,0x0007,earwt_msb_dont_care); + EaCalcRead(11,0,dea,size,0x0e00,earwt_msb_dont_care); if (size<2) ot(" mov r6,r6,asl #%d\n\n",size?16:24); } @@ -660,7 +660,7 @@ int OpAddx(int op) ot("\n"); ot(";@ Save result:\n"); - EaWrite(11, 1, dea,size,0x0e00,1); + EaWrite(11, 1, dea,size,0x0e00,earwt_shifted_up); ot(" ldr r6,[r7,#0x54]\n"); OpEnd(sea,dea); @@ -702,10 +702,10 @@ int OpCmpEor(int op) } ot(";@ Get EA into r11 and value into r0:\n"); - EaCalcReadNoSE(eor?11:-1,0,ea,size,0x003f); + EaCalcRead(eor?11:-1,0,ea,size,0x003f,earwt_msb_dont_care); ot(";@ Get register operand into r1:\n"); - EaCalcReadNoSE(-1,1,rea,size,0x0e00); + EaCalcRead(-1,1,rea,size,0x0e00,earwt_msb_dont_care); if (size<2) ot(" mov r0,r0,asl #%d\n\n",size?16:24); if (size<2) asl=(char *)(size?",asl #16":",asl #24"); @@ -723,7 +723,7 @@ int OpCmpEor(int op) } ot("\n"); - if (eor) EaWrite(11, 1,ea,size,0x003f,1); + if (eor) EaWrite(11, 1,ea,size,0x003f,earwt_shifted_up); OpEnd(ea); return 0; @@ -748,11 +748,11 @@ int OpCmpm(int op) OpStart(op,sea); Cycles=4; ot(";@ Get src operand into r11:\n"); - EaCalc (0,0x0007, sea,size,1); - EaRead (0, 11, sea,size,0x0007,1); + EaCalc (0,0x0007, sea,size,earwt_shifted_up); + EaRead (0, 11, sea,size,0x0007,earwt_shifted_up); ot(";@ Get dst operand into r0:\n"); - EaCalcReadNoSE(-1,0,dea,size,0x0e00); + EaCalcRead(-1,0,dea,size,0x0e00,earwt_msb_dont_care); if (size<2) asl=(char *)(size?",asl #16":",asl #24"); @@ -791,10 +791,10 @@ int OpChk(int op) OpStart(op,ea); Cycles=10; ot(";@ Get value into r0:\n"); - EaCalcReadNoSE(-1,0,ea,size,0x003f); + EaCalcRead(-1,0,ea,size,0x003f,earwt_msb_dont_care); ot(";@ Get register operand into r1:\n"); - EaCalcReadNoSE(-1,1,rea,size,0x0e00); + EaCalcRead(-1,1,rea,size,0x0e00,earwt_msb_dont_care); if (size<2) ot(" mov r0,r0,asl #%d\n",size?16:24);