X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2FCyclone%2FOpMove.cpp;h=78adae5bc52dffd709e51d72a8064ec3b39c5234;hb=ee05564fc7644a035ceeedba61975e46ce84af48;hp=ac2abea81eb0d46798e1b7cfc6df31f160786515;hpb=449ecf9257636348c23bf78bf502c424a48c4201;p=picodrive.git diff --git a/cpu/Cyclone/OpMove.cpp b/cpu/Cyclone/OpMove.cpp index ac2abea..78adae5 100644 --- a/cpu/Cyclone/OpMove.cpp +++ b/cpu/Cyclone/OpMove.cpp @@ -121,16 +121,18 @@ int OpMove(int op) OpStart(op,sea,tea); Cycles=4; - EaCalcRead(-1,1,sea,size,0x003f); - if (movea==0) { - ot(" adds r1,r1,#0 ;@ Defines NZ, clears CV\n"); + EaCalcRead(-1,0,sea,size,0x003f); + ot(" adds r1,r0,#0 ;@ Defines NZ, clears CV\n"); ot(" mrs r10,cpsr ;@ r10=NZCV flags\n"); ot("\n"); } - - if (movea) size=2; // movea always expands to 32-bits + else + { + EaCalcRead(-1,1,sea,size,0x003f); + size=2; // movea always expands to 32-bits + } eawrite_check_addrerr=1; #if SPLIT_MOVEL_PD @@ -149,8 +151,8 @@ int OpMove(int op) } #if CYCLONE_FOR_GENESIS && !MEMHANDLERS_CHANGE_CYCLES - // this is a bit hacky - if ((tea==0x39||(tea>=0x10&&tea<0x30))&&size>=1) + // this is a bit hacky (device handlers might modify cycles) + if (tea==0x39||((0x10<=tea&&tea<0x30)&&size>=1)) ot(" ldr r5,[r7,#0x5c] ;@ Load Cycles\n"); #endif @@ -376,23 +378,20 @@ int OpMovem(int op) OpStart(op,ea,0,1); + ot(" ldrh r11,[r4],#2 ;@ r11=register mask\n"); + ot("\n"); + 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 -#if !MEMHANDLERS_NEED_CYCLES - ot(" str r5,[r7,#0x5c] ;@ Save Cycles\n"); -#endif - ot(" ldrh r11,[r4],#2 ;@ r11=register mask\n"); ot(";@ r4=Register Index*4:\n"); if (decr) ot(" mov r4,#0x40 ;@ order reversed for -(An)\n"); else ot(" mov r4,#-4\n"); - ot("\n"); - ot(";@ Get the address into r6:\n"); - EaCalc(6,0x003f,cea,size); - ot("\n"); ot(" tst r11,r11\n"); // sanity check ot(" beq NoRegs%.4x\n",op);