[PS3] another joystick fix attempt

This commit is contained in:
Toad King 2014-01-09 16:48:14 -05:00
parent 3dcb7dd278
commit b6480dcbe2

View File

@ -245,14 +245,14 @@ static void ps3_input_poll(void *data)
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_R2) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_R2) : 0;
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_L2) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_L2) : 0;
*state_cur |= (state_tmp.button[CELL_PAD_BTN_OFFSET_DIGITAL2] & CELL_PAD_CTRL_L2) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_L2) : 0;
uint8_t lsx = state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X];
uint8_t lsy = state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y];
uint8_t rsx = state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_X];
uint8_t rsy = state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_Y];
int16_t ls_x = ((lsx - 127) * 256);
int16_t ls_y = ((lsy - 127) * 256);
int16_t rs_x = ((rsx - 127) * 256);
int16_t rs_y = ((rsy - 127) * 256);
int16_t lsx = (int16_t) state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X];
int16_t lsy = (int16_t) state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y];
int16_t rsx = (int16_t) state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_X];
int16_t rsy = (int16_t) state_tmp.button[CELL_PAD_BTN_OFFSET_ANALOG_RIGHT_Y];
int16_t ls_x = ((lsx - 128) * 256);
int16_t ls_y = ((lsy - 128) * 256);
int16_t rs_x = ((rsx - 128) * 256);
int16_t rs_y = ((rsy - 128) * 256);
ps3->analog_state[port][RETRO_DEVICE_INDEX_ANALOG_LEFT ][RETRO_DEVICE_ID_ANALOG_X] = ls_x;
ps3->analog_state[port][RETRO_DEVICE_INDEX_ANALOG_LEFT ][RETRO_DEVICE_ID_ANALOG_Y] = ls_y;
ps3->analog_state[port][RETRO_DEVICE_INDEX_ANALOG_RIGHT][RETRO_DEVICE_ID_ANALOG_X] = rs_x;