mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
(input) Cleanups
This commit is contained in:
parent
ae922a9593
commit
4205b3e8f3
@ -19,7 +19,7 @@
|
||||
static const char *android_joypad_name(unsigned pad)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
return settings->input.device_names[pad];
|
||||
return settings ? settings->input.device_names[pad] : NULL;
|
||||
}
|
||||
|
||||
static bool android_joypad_init(void)
|
||||
@ -60,8 +60,8 @@ static bool android_joypad_init(void)
|
||||
|
||||
static bool android_joypad_button(unsigned port, uint16_t joykey)
|
||||
{
|
||||
uint8_t *buf = NULL;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
uint8_t *buf = NULL;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
android_input_t *android = (android_input_t*)driver->input_data;
|
||||
|
||||
if (!android || port >= MAX_PADS)
|
||||
@ -95,11 +95,11 @@ static bool android_joypad_button(unsigned port, uint16_t joykey)
|
||||
|
||||
static int16_t android_joypad_axis(unsigned port, uint32_t joyaxis)
|
||||
{
|
||||
int val = 0;
|
||||
int axis = -1;
|
||||
bool is_neg = false;
|
||||
bool is_pos = false;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
int val = 0;
|
||||
int axis = -1;
|
||||
bool is_neg = false;
|
||||
bool is_pos = false;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
android_input_t *android = (android_input_t*)driver->input_data;
|
||||
|
||||
if (!android || joyaxis == AXIS_NONE || port >= MAX_PADS)
|
||||
@ -132,7 +132,7 @@ static void android_joypad_poll(void)
|
||||
|
||||
static bool android_joypad_query_pad(unsigned pad)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
driver_t *driver = driver_get_ptr();
|
||||
android_input_t *android = (android_input_t*)driver->input_data;
|
||||
return (pad < MAX_USERS && pad < android->pads_connected);
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ static const char *gx_joypad_name_static(unsigned pad)
|
||||
static void handle_hotplug(unsigned port, uint32_t ptype)
|
||||
{
|
||||
autoconfig_params_t params = {{0}};
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
pad_type[port] = ptype;
|
||||
|
||||
@ -219,7 +219,7 @@ static bool gx_joypad_init(void)
|
||||
{
|
||||
int autoconf_pad;
|
||||
autoconfig_params_t params = {{0}};
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
SYS_SetResetCallback(reset_cb);
|
||||
#ifdef HW_RVL
|
||||
@ -269,8 +269,11 @@ static uint64_t gx_joypad_get_buttons(unsigned port)
|
||||
|
||||
static int16_t gx_joypad_axis(unsigned port, uint32_t joyaxis)
|
||||
{
|
||||
int val = 0, axis = -1;
|
||||
bool is_neg = false, is_pos = false;
|
||||
int val = 0;
|
||||
int axis = -1;
|
||||
bool is_neg = false;
|
||||
bool is_pos = false;
|
||||
|
||||
if (joyaxis == AXIS_NONE || port >= MAX_PADS)
|
||||
return 0;
|
||||
|
||||
|
@ -62,8 +62,11 @@ static uint64_t psp_joypad_get_buttons(unsigned port_num)
|
||||
|
||||
static int16_t psp_joypad_axis(unsigned port_num, uint32_t joyaxis)
|
||||
{
|
||||
int val = 0, axis = -1;
|
||||
bool is_neg = false, is_pos = false;
|
||||
int val = 0;
|
||||
int axis = -1;
|
||||
bool is_neg = false;
|
||||
bool is_pos = false;
|
||||
|
||||
if (joyaxis == AXIS_NONE || port_num >= MAX_PADS)
|
||||
return 0;
|
||||
|
||||
@ -106,7 +109,7 @@ static void psp_joypad_poll(void)
|
||||
{
|
||||
int32_t ret;
|
||||
SceCtrlData state_tmp;
|
||||
global_t *global = global_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
uint64_t *lifecycle_state = (uint64_t*)&global->lifecycle_state;
|
||||
|
||||
#ifdef PSP
|
||||
|
@ -20,7 +20,7 @@
|
||||
static const char *qnx_joypad_name(unsigned pad)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
return settings->input.device_names[pad];
|
||||
return settings ? settings->input.device_names[pad] : NULL;
|
||||
}
|
||||
|
||||
static bool qnx_joypad_init(void)
|
||||
@ -68,18 +68,16 @@ static uint64_t qnx_joypad_get_buttons(unsigned port_num)
|
||||
|
||||
static int16_t qnx_joypad_axis(unsigned port_num, uint32_t joyaxis)
|
||||
{
|
||||
int val = 0;
|
||||
int axis = -1;
|
||||
bool is_neg = false;
|
||||
bool is_pos = false;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
qnx_input_t *qnx = (qnx_input_t*)driver->input_data;
|
||||
|
||||
if (!qnx || joyaxis == AXIS_NONE || port_num >= MAX_PADS)
|
||||
return 0;
|
||||
|
||||
int val = 0;
|
||||
|
||||
int axis = -1;
|
||||
bool is_neg = false;
|
||||
bool is_pos = false;
|
||||
|
||||
if (AXIS_NEG_GET(joyaxis) < 4)
|
||||
{
|
||||
axis = AXIS_NEG_GET(joyaxis);
|
||||
|
Loading…
x
Reference in New Issue
Block a user