Merge https://github.com/notaz/pcsx_rearmed
authortwinaphex <libretro@gmail.com>
Wed, 2 Mar 2016 03:03:11 +0000 (04:03 +0100)
committertwinaphex <libretro@gmail.com>
Wed, 2 Mar 2016 03:03:11 +0000 (04:03 +0100)
1  2 
frontend/menu.c
libpcsxcore/new_dynarec/assem_arm.c

diff --combined frontend/menu.c
@@@ -308,12 -308,12 +308,12 @@@ static void menu_sync_config(void
  
        switch (in_type_sel1) {
        case 1:  in_type1 = PSE_PAD_TYPE_ANALOGPAD; break;
 -      case 2:  in_type1 = PSE_PAD_TYPE_GUNCON;    break;
 +      case 2:  in_type1 = PSE_PAD_TYPE_NEGCON;    break;
        default: in_type1 = PSE_PAD_TYPE_STANDARD;
        }
        switch (in_type_sel2) {
        case 1:  in_type2 = PSE_PAD_TYPE_ANALOGPAD; break;
 -      case 2:  in_type2 = PSE_PAD_TYPE_GUNCON;    break;
 +      case 2:  in_type2 = PSE_PAD_TYPE_NEGCON;    break;
        default: in_type2 = PSE_PAD_TYPE_STANDARD;
        }
        if (in_evdev_allow_abs_only != allow_abs_only_old) {
@@@ -903,8 -903,6 +903,6 @@@ static void get_line(char *d, size_t si
                len = size - 1;
        strncpy(d, s, len);
        d[len] = 0;
-       mystrip(d);
  }
  
  static void keys_write_all(FILE *f)
@@@ -1011,7 -1009,10 +1009,10 @@@ static void keys_load_all(const char *c
        while (p != NULL && (p = strstr(p, "binddev = ")) != NULL) {
                p += 10;
  
+               // don't strip 'dev' because there are weird devices
+               // with names with space at the end
                get_line(dev, sizeof(dev), p);
                dev_id = in_config_parse_dev(dev);
                if (dev_id < 0) {
                        printf("input: can't handle dev: %s\n", dev);
@@@ -30,9 -30,7 +30,9 @@@
  #endif
  #include "arm_features.h"
  
 -#if !BASE_ADDR_FIXED
 +#ifdef VITA
 +char* translation_cache = 0;
 +#elif !BASE_ADDR_FIXED
  char translation_cache[1 << TARGET_SIZE_2] __attribute__((aligned(4096)));
  #endif
  
@@@ -1169,18 -1167,30 +1169,30 @@@ void emit_addimm(u_int rs,int imm,u_in
      }else if(genimm(-imm,&armval)) {
        assem_debug("sub %s,%s,#%d\n",regname[rt],regname[rs],-imm);
        output_w32(0xe2400000|rd_rn_rm(rt,rs,0)|armval);
-     }else if(imm<0) {
-       assert(imm>-65536);
+     #ifdef HAVE_ARMV7
+     }else if(rt!=rs&&(u_int)imm<65536) {
+       emit_movw(imm&0x0000ffff,rt);
+       emit_add(rs,rt,rt);
+     }else if(rt!=rs&&(u_int)-imm<65536) {
+       emit_movw(-imm&0x0000ffff,rt);
+       emit_sub(rs,rt,rt);
+     #endif
+     }else if((u_int)-imm<65536) {
        assem_debug("sub %s,%s,#%d\n",regname[rt],regname[rs],(-imm)&0xFF00);
        assem_debug("sub %s,%s,#%d\n",regname[rt],regname[rt],(-imm)&0xFF);
        output_w32(0xe2400000|rd_rn_imm_shift(rt,rs,(-imm)>>8,8));
        output_w32(0xe2400000|rd_rn_imm_shift(rt,rt,(-imm)&0xff,0));
-     }else{
-       assert(imm<65536);
-       assem_debug("add %s,%s,#%d\n",regname[rt],regname[rs],imm&0xFF00);
-       assem_debug("add %s,%s,#%d\n",regname[rt],regname[rt],imm&0xFF);
-       output_w32(0xe2800000|rd_rn_imm_shift(rt,rs,imm>>8,8));
-       output_w32(0xe2800000|rd_rn_imm_shift(rt,rt,imm&0xff,0));
+     }else {
+       do {
+         int shift = (ffs(imm) - 1) & ~1;
+         int imm8 = imm & (0xff << shift);
+         genimm_checked(imm8,&armval);
+         assem_debug("add %s,%s,#0x%x\n",regname[rt],regname[rs],imm8);
+         output_w32(0xe2800000|rd_rn_rm(rt,rs,0)|armval);
+         rs = rt;
+         imm &= ~imm8;
+       }
+       while (imm != 0);
      }
    }
    else if(rs!=rt) emit_mov(rs,rt);