mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
MOve input_joypad_analog call to inside retroarch.c instead of the
input driver itself, and make function static
This commit is contained in:
parent
2a0c490913
commit
689ac432d6
@ -1462,9 +1462,6 @@ static int16_t android_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(android->joypad, joypad_info,
|
|
||||||
port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return (id < RETROK_LAST) && BIT_GET(android_key_state[ANDROID_KEYBOARD_PORT], rarch_keysym_lut[id]);
|
return (id < RETROK_LAST) && BIT_GET(android_key_state[ANDROID_KEYBOARD_PORT], rarch_keysym_lut[id]);
|
||||||
|
@ -48,8 +48,10 @@ int32_t cocoa_input_find_any_key(void)
|
|||||||
if (apple->joypad)
|
if (apple->joypad)
|
||||||
apple->joypad->poll();
|
apple->joypad->poll();
|
||||||
|
|
||||||
|
#ifdef HAVE_MFI
|
||||||
if (apple->sec_joypad)
|
if (apple->sec_joypad)
|
||||||
apple->sec_joypad->poll();
|
apple->sec_joypad->poll();
|
||||||
|
#endif
|
||||||
|
|
||||||
return apple_keyboard_find_any_key();
|
return apple_keyboard_find_any_key();
|
||||||
}
|
}
|
||||||
@ -89,6 +91,7 @@ int32_t cocoa_input_find_any_button(uint32_t port)
|
|||||||
if (ret != -1)
|
if (ret != -1)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
#ifdef HAVE_MFI
|
||||||
if (apple->sec_joypad)
|
if (apple->sec_joypad)
|
||||||
{
|
{
|
||||||
apple->sec_joypad->poll();
|
apple->sec_joypad->poll();
|
||||||
@ -101,6 +104,7 @@ int32_t cocoa_input_find_any_button(uint32_t port)
|
|||||||
ret = cocoa_input_find_any_button_ret(apple, &state, port);
|
ret = cocoa_input_find_any_button_ret(apple, &state, port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret != -1)
|
if (ret != -1)
|
||||||
return ret;
|
return ret;
|
||||||
@ -116,8 +120,10 @@ int32_t cocoa_input_find_any_axis(uint32_t port)
|
|||||||
if (apple && apple->joypad)
|
if (apple && apple->joypad)
|
||||||
apple->joypad->poll();
|
apple->joypad->poll();
|
||||||
|
|
||||||
|
#ifdef HAVE_MFI
|
||||||
if (apple && apple->sec_joypad)
|
if (apple && apple->sec_joypad)
|
||||||
apple->sec_joypad->poll();
|
apple->sec_joypad->poll();
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
@ -126,7 +132,9 @@ int32_t cocoa_input_find_any_axis(uint32_t port)
|
|||||||
if (abs(value) > 0x4000)
|
if (abs(value) > 0x4000)
|
||||||
return (value < 0) ? -(i + 1) : i + 1;
|
return (value < 0) ? -(i + 1) : i + 1;
|
||||||
|
|
||||||
|
#ifdef HAVE_MFI
|
||||||
value = apple->sec_joypad ? apple->sec_joypad->axis(port, i) : value;
|
value = apple->sec_joypad ? apple->sec_joypad->axis(port, i) : value;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (abs(value) > 0x4000)
|
if (abs(value) > 0x4000)
|
||||||
return (value < 0) ? -(i + 1) : i + 1;
|
return (value < 0) ? -(i + 1) : i + 1;
|
||||||
@ -190,8 +198,10 @@ static void cocoa_input_poll(void *data)
|
|||||||
|
|
||||||
if (apple->joypad)
|
if (apple->joypad)
|
||||||
apple->joypad->poll();
|
apple->joypad->poll();
|
||||||
|
#ifdef HAVE_MFI
|
||||||
if (apple->sec_joypad)
|
if (apple->sec_joypad)
|
||||||
apple->sec_joypad->poll();
|
apple->sec_joypad->poll();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int16_t cocoa_mouse_state(cocoa_input_data_t *apple,
|
static int16_t cocoa_mouse_state(cocoa_input_data_t *apple,
|
||||||
@ -345,18 +355,6 @@ static int16_t cocoa_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
{
|
|
||||||
int16_t ret = 0;
|
|
||||||
#ifdef HAVE_MFI
|
|
||||||
ret = input_joypad_analog(apple->sec_joypad, joypad_info, port,
|
|
||||||
idx, id, binds[port]);
|
|
||||||
#endif
|
|
||||||
if (!ret)
|
|
||||||
ret = input_joypad_analog(apple->joypad, joypad_info, port,
|
|
||||||
idx, id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return (id < RETROK_LAST) && apple_key_state[rarch_keysym_lut[(enum retro_key)id]];
|
return (id < RETROK_LAST) && apple_key_state[rarch_keysym_lut[(enum retro_key)id]];
|
||||||
@ -383,8 +381,10 @@ static void cocoa_input_free(void *data)
|
|||||||
if (apple->joypad)
|
if (apple->joypad)
|
||||||
apple->joypad->destroy();
|
apple->joypad->destroy();
|
||||||
|
|
||||||
|
#ifdef HAVE_MFI
|
||||||
if (apple->sec_joypad)
|
if (apple->sec_joypad)
|
||||||
apple->sec_joypad->destroy();
|
apple->sec_joypad->destroy();
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < MAX_KEYS; i++)
|
for (i = 0; i < MAX_KEYS; i++)
|
||||||
apple_key_state[i] = 0;
|
apple_key_state[i] = 0;
|
||||||
@ -429,10 +429,12 @@ static void cocoa_input_grab_mouse(void *data, bool state)
|
|||||||
|
|
||||||
static const input_device_driver_t *cocoa_input_get_sec_joypad_driver(void *data)
|
static const input_device_driver_t *cocoa_input_get_sec_joypad_driver(void *data)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_MFI
|
||||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
|
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
|
||||||
|
|
||||||
if (apple && apple->sec_joypad)
|
if (apple && apple->sec_joypad)
|
||||||
return apple->sec_joypad;
|
return apple->sec_joypad;
|
||||||
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "../../config.def.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../input_driver.h"
|
#include "../input_driver.h"
|
||||||
|
|
||||||
/* Input responder */
|
/* Input responder */
|
||||||
@ -49,7 +53,9 @@ typedef struct
|
|||||||
int16_t mouse_wl;
|
int16_t mouse_wl;
|
||||||
int16_t mouse_wr;
|
int16_t mouse_wr;
|
||||||
|
|
||||||
|
#ifdef HAVE_MFI
|
||||||
const input_device_driver_t *sec_joypad;
|
const input_device_driver_t *sec_joypad;
|
||||||
|
#endif
|
||||||
const input_device_driver_t *joypad;
|
const input_device_driver_t *joypad;
|
||||||
} cocoa_input_data_t;
|
} cocoa_input_data_t;
|
||||||
|
|
||||||
|
@ -87,9 +87,6 @@ static int16_t ctr_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(ctr->joypad,
|
|
||||||
joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,15 +634,8 @@ static int16_t dinput_input_state(void *data,
|
|||||||
di->state[rarch_keysym_lut[(enum retro_key)id]] & 0x80;
|
di->state[rarch_keysym_lut[(enum retro_key)id]] & 0x80;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
if (binds[port])
|
||||||
{
|
return dinput_pressed_analog(di, binds[port], idx, id);
|
||||||
int16_t ret = dinput_pressed_analog(di, binds[port], idx, id);
|
|
||||||
if (!ret)
|
|
||||||
ret = input_joypad_analog(di->joypad, joypad_info,
|
|
||||||
port, idx, id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
{
|
{
|
||||||
settings = config_get_ptr();
|
settings = config_get_ptr();
|
||||||
|
@ -176,9 +176,6 @@ static int16_t gx_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(gx->joypad,
|
|
||||||
joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
|
@ -162,14 +162,9 @@ static int16_t linuxraw_input_state(void *data,
|
|||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
if (binds[port])
|
||||||
{
|
return linuxraw_analog_pressed(
|
||||||
int16_t ret = linuxraw_analog_pressed(
|
|
||||||
linuxraw, binds[port], idx, id);
|
linuxraw, binds[port], idx, id);
|
||||||
if (!ret)
|
break;
|
||||||
ret = input_joypad_analog(linuxraw->joypad,
|
|
||||||
joypad_info, port, idx, id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -79,8 +79,6 @@ static int16_t ps2_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(ps2->joypad, joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,9 +135,6 @@ static int16_t ps3_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(
|
|
||||||
ps3->joypad, joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
#if 0
|
#if 0
|
||||||
case RETRO_DEVICE_SENSOR_ACCELEROMETER:
|
case RETRO_DEVICE_SENSOR_ACCELEROMETER:
|
||||||
|
@ -85,8 +85,6 @@ static int16_t ps4_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(ps4->joypad, joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,8 +251,6 @@ static int16_t ps3_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(ps3->joypad, joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return (psl1ght_keyboard_port_input_pressed(ps3, id));
|
return (psl1ght_keyboard_port_input_pressed(ps3, id));
|
||||||
|
@ -328,8 +328,6 @@ static int16_t psp_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(psp->joypad, joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
|
@ -840,10 +840,7 @@ static int16_t qnx_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
break;
|
||||||
return input_joypad_analog(qnx->joypad, joypad_info,
|
|
||||||
port, idx, id, binds[port]);
|
|
||||||
return 0;
|
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return qnx_keyboard_pressed(qnx, id);
|
return qnx_keyboard_pressed(qnx, id);
|
||||||
case RETRO_DEVICE_POINTER:
|
case RETRO_DEVICE_POINTER:
|
||||||
|
@ -566,16 +566,10 @@ static int16_t rwebinput_input_state(void *data,
|
|||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
if (binds[port])
|
||||||
{
|
return rwebinput_analog_pressed(
|
||||||
int16_t ret = rwebinput_analog_pressed(
|
|
||||||
rwebinput, joypad_info, binds[port],
|
rwebinput, joypad_info, binds[port],
|
||||||
idx, id);
|
idx, id);
|
||||||
if (!ret)
|
break;
|
||||||
ret = input_joypad_analog(
|
|
||||||
rwebinput->joypad, joypad_info, port,
|
|
||||||
idx, id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return rwebinput_key_pressed(rwebinput, id);
|
return rwebinput_key_pressed(rwebinput, id);
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
|
@ -235,13 +235,7 @@ static int16_t sdl_input_state(void *data,
|
|||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
if (binds[port])
|
||||||
{
|
return sdl_analog_pressed(sdl, binds[port], idx, id);
|
||||||
int16_t ret = sdl_analog_pressed(sdl, binds[port], idx, id);
|
|
||||||
if (!ret)
|
|
||||||
ret = input_joypad_analog(sdl->joypad,
|
|
||||||
joypad_info, port, idx, id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
if (config_get_ptr()->uints.input_mouse_index[ port ] == 0)
|
if (config_get_ptr()->uints.input_mouse_index[ port ] == 0)
|
||||||
|
@ -422,9 +422,6 @@ static int16_t switch_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(sw->joypad,
|
|
||||||
joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_LIBNX
|
#ifdef HAVE_LIBNX
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
|
@ -1049,13 +1049,8 @@ static int16_t udev_input_state(void *data,
|
|||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
if (binds[port])
|
||||||
{
|
return udev_analog_pressed(binds[port], idx, id);
|
||||||
int16_t ret = udev_analog_pressed(binds[port], idx, id);
|
break;
|
||||||
if (!ret)
|
|
||||||
ret = input_joypad_analog(udev->joypad,
|
|
||||||
joypad_info, port, idx, id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return (id < RETROK_LAST) && udev_keyboard_pressed(udev, id);
|
return (id < RETROK_LAST) && udev_keyboard_pressed(udev, id);
|
||||||
|
|
||||||
|
@ -131,13 +131,7 @@ static int16_t uwp_pressed_analog(uwp_input_t *uwp,
|
|||||||
&& uwp_keyboard_pressed(bind_plus->key))
|
&& uwp_keyboard_pressed(bind_plus->key))
|
||||||
pressed_plus = 0x7fff;
|
pressed_plus = 0x7fff;
|
||||||
|
|
||||||
pressed_keyboard = pressed_plus + pressed_minus;
|
return pressed_plus + pressed_minus;
|
||||||
if (pressed_keyboard != 0)
|
|
||||||
return pressed_keyboard;
|
|
||||||
|
|
||||||
/* Then, process the joypad bindings */
|
|
||||||
return input_joypad_analog(uwp->joypad,
|
|
||||||
joypad_info, port, idx, id, binds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int16_t uwp_input_state(void *data,
|
static int16_t uwp_input_state(void *data,
|
||||||
|
@ -334,13 +334,7 @@ static int16_t input_wl_state(void *data,
|
|||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
if (binds[port])
|
||||||
{
|
return input_wl_analog_pressed(wl, binds[port], idx, id);
|
||||||
int16_t ret = input_wl_analog_pressed(wl, binds[port], idx, id);
|
|
||||||
if (!ret)
|
|
||||||
ret = input_joypad_analog(
|
|
||||||
wl->joypad, joypad_info, port, idx, id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return input_wl_state_kb(wl, binds, port, device, idx, id);
|
return input_wl_state_kb(wl, binds, port, device, idx, id);
|
||||||
|
@ -164,9 +164,6 @@ static int16_t wiiu_input_state(void *data,
|
|||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(wiiu->joypad,
|
|
||||||
joypad_info, port, idx, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_POINTER:
|
case RETRO_DEVICE_POINTER:
|
||||||
case RARCH_DEVICE_POINTER_SCREEN:
|
case RARCH_DEVICE_POINTER_SCREEN:
|
||||||
|
@ -664,9 +664,6 @@ static int16_t winraw_input_state(void *d,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(wr->joypad, joypad_info,
|
|
||||||
port, index, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return (id < RETROK_LAST) && winraw_keyboard_pressed(wr, id);
|
return (id < RETROK_LAST) && winraw_keyboard_pressed(wr, id);
|
||||||
|
@ -352,14 +352,8 @@ static int16_t x_input_state(void *data,
|
|||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
if (binds[port])
|
||||||
{
|
return x_pressed_analog(x11, binds[port], idx, id);
|
||||||
int16_t ret = x_pressed_analog(x11, binds[port], idx, id);
|
break;
|
||||||
if (!ret)
|
|
||||||
ret = input_joypad_analog(x11->joypad, joypad_info,
|
|
||||||
port, idx,
|
|
||||||
id, binds[port]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return (id < RETROK_LAST) && x_keyboard_pressed(x11, id);
|
return (id < RETROK_LAST) && x_keyboard_pressed(x11, id);
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
|
@ -92,8 +92,6 @@ static int16_t xdk_input_state(void *data,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
if (binds[port])
|
|
||||||
return input_joypad_analog(xdk->joypad, joypad_info, port, index, id, binds[port]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,31 +312,6 @@ const input_device_driver_t *input_joypad_init_driver(
|
|||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* input_joypad_analog:
|
|
||||||
* @drv : Input device driver handle.
|
|
||||||
* @port : User number.
|
|
||||||
* @idx : Analog key index.
|
|
||||||
* E.g.:
|
|
||||||
* - RETRO_DEVICE_INDEX_ANALOG_LEFT
|
|
||||||
* - RETRO_DEVICE_INDEX_ANALOG_RIGHT
|
|
||||||
* - RETRO_DEVICE_INDEX_ANALOG_BUTTON
|
|
||||||
* @ident : Analog key identifier.
|
|
||||||
* E.g.:
|
|
||||||
* - RETRO_DEVICE_ID_ANALOG_X
|
|
||||||
* - RETRO_DEVICE_ID_ANALOG_Y
|
|
||||||
* @binds : Binds of user.
|
|
||||||
*
|
|
||||||
* Gets analog value of analog key identifiers @idx and @ident
|
|
||||||
* from user with number @port with provided keybinds (@binds).
|
|
||||||
*
|
|
||||||
* Returns: analog value on success, otherwise 0.
|
|
||||||
**/
|
|
||||||
int16_t input_joypad_analog(const input_device_driver_t *driver,
|
|
||||||
rarch_joypad_info_t *joypad_info,
|
|
||||||
unsigned port, unsigned idx, unsigned ident,
|
|
||||||
const struct retro_keybind *binds);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_joypad_set_rumble:
|
* input_joypad_set_rumble:
|
||||||
* @drv : Input device driver handle.
|
* @drv : Input device driver handle.
|
||||||
|
25
retroarch.c
25
retroarch.c
@ -2758,6 +2758,10 @@ static void driver_location_stop(void);
|
|||||||
static bool driver_location_start(void);
|
static bool driver_location_start(void);
|
||||||
static void driver_camera_stop(void);
|
static void driver_camera_stop(void);
|
||||||
static bool driver_camera_start(void);
|
static bool driver_camera_start(void);
|
||||||
|
static int16_t input_joypad_analog(const input_device_driver_t *drv,
|
||||||
|
rarch_joypad_info_t *joypad_info,
|
||||||
|
unsigned port, unsigned idx, unsigned ident,
|
||||||
|
const struct retro_keybind *binds);
|
||||||
|
|
||||||
#ifdef HAVE_ACCESSIBILITY
|
#ifdef HAVE_ACCESSIBILITY
|
||||||
static bool is_accessibility_enabled(struct rarch_state *p_rarch);
|
static bool is_accessibility_enabled(struct rarch_state *p_rarch);
|
||||||
@ -23248,6 +23252,25 @@ static int16_t input_state(unsigned port, unsigned device,
|
|||||||
p_rarch->current_input_data, &joypad_info,
|
p_rarch->current_input_data, &joypad_info,
|
||||||
p_rarch->libretro_input_binds, port, device, idx, id);
|
p_rarch->libretro_input_binds, port, device, idx, id);
|
||||||
|
|
||||||
|
if ( (device == RETRO_DEVICE_ANALOG) &&
|
||||||
|
(ret == 0))
|
||||||
|
{
|
||||||
|
const input_device_driver_t *joypad =
|
||||||
|
p_rarch->current_input->get_joypad_driver(
|
||||||
|
p_rarch->current_input_data);
|
||||||
|
const input_device_driver_t *sec_joypad =
|
||||||
|
input_driver_get_sec_joypad_driver();
|
||||||
|
if (p_rarch->libretro_input_binds[port])
|
||||||
|
{
|
||||||
|
if (sec_joypad)
|
||||||
|
ret = input_joypad_analog(sec_joypad, &joypad_info,
|
||||||
|
port, idx, id, p_rarch->libretro_input_binds[port]);
|
||||||
|
if (joypad && (ret == 0))
|
||||||
|
ret = input_joypad_analog(joypad, &joypad_info,
|
||||||
|
port, idx, id, p_rarch->libretro_input_binds[port]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( (p_rarch->input_driver_flushing_input == 0)
|
if ( (p_rarch->input_driver_flushing_input == 0)
|
||||||
&& !p_rarch->input_driver_block_libretro_input)
|
&& !p_rarch->input_driver_block_libretro_input)
|
||||||
{
|
{
|
||||||
@ -25313,7 +25336,7 @@ int16_t button_is_pressed(
|
|||||||
*
|
*
|
||||||
* Returns: analog value on success, otherwise 0.
|
* Returns: analog value on success, otherwise 0.
|
||||||
**/
|
**/
|
||||||
int16_t input_joypad_analog(const input_device_driver_t *drv,
|
static int16_t input_joypad_analog(const input_device_driver_t *drv,
|
||||||
rarch_joypad_info_t *joypad_info,
|
rarch_joypad_info_t *joypad_info,
|
||||||
unsigned port, unsigned idx, unsigned ident,
|
unsigned port, unsigned idx, unsigned ident,
|
||||||
const struct retro_keybind *binds)
|
const struct retro_keybind *binds)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user