+ in_keystate[0] = actions[IN_BINDTYPE_PLAYER12] & 0xffff;
+ in_keystate[1] = (actions[IN_BINDTYPE_PLAYER12] >> 16) & 0xffff;
+
+ if (tsdev) for (i = 0; i < 2; i++) {
+ int in = 0, x = 0, y = 0, trigger;;
+ if (in_type[i] != PSE_PAD_TYPE_GUN
+ && in_type[i] != PSE_PAD_TYPE_GUNCON)
+ continue;
+ trigger = in_type[i] == PSE_PAD_TYPE_GUN
+ ? (1 << DKEY_SQUARE) : (1 << DKEY_CIRCLE);
+
+ pl_gun_ts_update(tsdev, &x, &y, &in);
+ in_analog_left[i][0] = 65536;
+ in_analog_left[i][1] = 65536;
+ if (in && !(in_state_gun & (1 << SACTION_GUN_TRIGGER2))) {
+ in_analog_left[i][0] = x;
+ in_analog_left[i][1] = y;
+ if (!(g_opts & OPT_TSGUN_NOTRIGGER))
+ in_state_gun |= (1 << SACTION_GUN_TRIGGER);
+ }
+ in_keystate[i] = 0;
+ if (in_state_gun & ((1 << SACTION_GUN_TRIGGER)
+ | (1 << SACTION_GUN_TRIGGER2)))
+ in_keystate[i] |= trigger;
+ if (in_state_gun & (1 << SACTION_GUN_A))
+ in_keystate[i] |= (1 << DKEY_START);
+ if (in_state_gun & (1 << SACTION_GUN_B))
+ in_keystate[i] |= (1 << DKEY_CROSS);
+ }