mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +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)
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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