for(i = 0; i < 12; i++) { int dev = (joypad[i] >> 12); int a = joypad[i] & 0xfff; if(dev) { dev--;  if((dev == which) && (a < 32) && ((a>>1) == axis)) { sdlButtons[i] = (a & 1) ? (value > 16384) : (value < -16384);
for(int j = 0; j < 4; j++) { for(i = 0; i < 12; i++) { int dev = (joypad[j][i] >> 12); int a = joypad[j][i] & 0xfff; if(dev) { dev--;  if((dev == which) && (a < 32) && ((a>>1) == axis)) { sdlButtons[j][i] = (a & 1) ? (value > 16384) : (value < -16384); }
void sdlUpdateJoyAxis(int which,                      int axis,                      int value){  int i;  for(i = 0; i < 12; i++) {    int dev = (joypad[i] >> 12);    int a = joypad[i] & 0xfff;    if(dev) {      dev--;      if((dev == which) && (a < 32) && ((a>>1) == axis)) {        sdlButtons[i] = (a & 1) ? (value > 16384) : (value < -16384);      }    }  }    for(i = 0; i < 4; i++) {    int dev = (motion[i] >> 12);    int a = motion[i] & 0xfff;    if(dev) {      dev--;      if((dev == which) && (a < 32) && ((a>>1) == axis)) {        sdlMotionButtons[i] = (a & 1) ? (value > 16384) : (value < -16384);      }    }  }  }