aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexis-puska2016-05-12 20:33:06 +0200
committercbransden2016-05-13 18:30:00 +0100
commit56abf6140ec44820247d574b30b6a62221e86b0c (patch)
treeee364a267c4735536928c358a9b1b60729bbde8a
parentc663ec74b85ca464d4aecf5697505ebc79ec0f93 (diff)
downloadpcsx_rearmed-56abf6140ec44820247d574b30b6a62221e86b0c.tar.gz
pcsx_rearmed-56abf6140ec44820247d574b30b6a62221e86b0c.tar.bz2
pcsx_rearmed-56abf6140ec44820247d574b30b6a62221e86b0c.zip
fix analog value
fix analog value
-rw-r--r--frontend/libretro.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c
index 5bcbb1b..0cd724e 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -1330,22 +1330,17 @@ void retro_run(void)
if (input_state_cb(i, RETRO_DEVICE_JOYPAD, 0, j))
in_keystate[i] |= retro_psx_map[j];
}
- }
- if (in_type[0] == PSE_PAD_TYPE_ANALOGPAD)
- {
- in_analog_left[0][0] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
- in_analog_left[0][1] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
- in_analog_right[0][0] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
- in_analog_right[0][1] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
- }
- if (in_type[1] == PSE_PAD_TYPE_ANALOGPAD)
- {
- in_analog_left[1][0] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
- in_analog_left[1][1] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
- in_analog_right[1][0] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
- in_analog_right[1][1] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
+ printf("%i : %i\n",i , input_state_cb(i, RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X));
+
+ if (in_type[i] == PSE_PAD_TYPE_ANALOGPAD)
+ {
+ in_analog_left[i][0] = (input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
+ in_analog_left[i][1] = (input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
+ in_analog_right[i][0] = (input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
+ in_analog_right[i][1] = (input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
+ }
}
stop = 0;