X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=cyclone68000.git;a=blobdiff_plain;f=OpMove.cpp;h=8022da16597c6bf788ee13dabdd75597cd69641f;hp=3d893de1c0b962846e30532b7bd8e7dbddc4b39e;hb=HEAD;hpb=65044ba9d2f08fbeeb1bd2a4d7c0fb349ea99070 diff --git a/OpMove.cpp b/OpMove.cpp index 3d893de..8022da1 100644 --- a/OpMove.cpp +++ b/OpMove.cpp @@ -96,6 +96,7 @@ void SuperChange(int op,int srh_reg) // Emit a Move opcode, 00xxdddd ddssssss int OpMove(int op) { + EaRWType eatype; int sea=0,tea=0; int size=0,use=0; int movea=0; @@ -133,13 +134,25 @@ int OpMove(int op) if (movea==0) { - EaCalcRead(-1,1,sea,size,0x003f,earwt_sign_extend,1); - OpGetFlagsNZ(1); + if (sea < 0x10 && size < 2) + { + eatype = earwt_zero_extend; + EaCalcRead(-1,1,sea,size,0x003f,eatype); + ot(" movs r2,r1,lsl #%d\n",size?16:24); + OpGetFlagsNZ(2); + } + else + { + eatype = earwt_shifted_up; + EaCalcRead(-1,1,sea,size,0x003f,eatype,1); + OpGetFlagsNZ(1); + } ot("\n"); } else { - EaCalcRead(-1,1,sea,size,0x003f,earwt_sign_extend); + eatype = earwt_sign_extend; + EaCalcRead(-1,1,sea,size,0x003f,eatype); size=2; // movea always expands to 32-bits } @@ -155,8 +168,8 @@ int OpMove(int op) else #endif { - EaCalc (0,0x0e00,tea,size,earwt_msb_dont_care); - EaWrite(0, 1,tea,size,0x0e00,earwt_msb_dont_care); + EaCalc (0,0x0e00,tea,size,eatype); + EaWrite(0, 1,tea,size,0x0e00,eatype); } #if CYCLONE_FOR_GENESIS && !MEMHANDLERS_CHANGE_CYCLES @@ -392,10 +405,8 @@ int OpMovem(int op) ot(";@ Get the address into r6:\n"); EaCalc(6,0x003f,cea,size); -#if !MEMHANDLERS_NEED_PREV_PC // must save PC, need a spare register - ot(" str r4,[r7,#0x40] ;@ Save PC\n"); -#endif + FlushPC(1); ot(";@ r4=Register Index*4:\n"); if (decr) ot(" mov r4,#0x40 ;@ order reversed for -(An)\n"); @@ -423,14 +434,14 @@ int OpMovem(int op) if (dir) { - ot(" ;@ Copy memory to register:\n",1<