Don't implement input_state for input drivers that don't need it

This commit is contained in:
twinaphex 2020-09-02 17:37:01 +02:00
parent 45cb980a3d
commit 3f566fd54e
7 changed files with 10 additions and 121 deletions

View File

@ -1350,10 +1350,8 @@ static int16_t android_input_state(
}
if (binds[port][id].valid)
{
if (ANDROID_KEYBOARD_PORT_INPUT_PRESSED(binds[port], id))
return 1;
}
break;
case RETRO_DEVICE_ANALOG:
break;

View File

@ -35,21 +35,6 @@ typedef struct ctr_input
void *empty;
} ctr_input_t;
static int16_t ctr_input_state(
void *data,
const input_device_driver_t *joypad,
const input_device_driver_t *sec_joypad,
rarch_joypad_info_t *joypad_info,
const struct retro_keybind **binds,
bool keyboard_mapping_blocked,
unsigned port,
unsigned device,
unsigned idx,
unsigned id)
{
return 0;
}
static void ctr_input_free_input(void *data)
{
free(data);
@ -72,7 +57,7 @@ static uint64_t ctr_input_get_capabilities(void *data)
input_driver_t input_ctr = {
ctr_input_init,
NULL, /* poll */
ctr_input_state,
NULL, /* input_state */
ctr_input_free_input,
NULL,
NULL,

View File

@ -58,7 +58,8 @@ typedef struct gx_input
#endif
} gx_input_t;
static int16_t gx_input_state(
#ifdef HW_RVL
static int16_t rvl_input_state(
void *data,
const input_device_driver_t *joypad,
const input_device_driver_t *sec_joypad,
@ -80,7 +81,6 @@ static int16_t gx_input_state(
case RETRO_DEVICE_JOYPAD:
case RETRO_DEVICE_ANALOG:
break;
#ifdef HW_RVL
case RETRO_DEVICE_MOUSE:
{
settings_t *settings = config_get_ptr();
@ -168,11 +168,11 @@ static int16_t gx_input_state(
}
}
break;
#endif
}
return 0;
}
#endif
static void gx_input_free_input(void *data)
{
@ -282,10 +282,11 @@ input_driver_t input_gx = {
gx_input_init,
#ifdef HW_RVL
rvl_input_poll,
rvl_input_state,
#else
NULL, /* poll */
NULL, /* input_state */
#endif
gx_input_state,
gx_input_free_input,
NULL,
NULL,

View File

@ -31,21 +31,6 @@ typedef struct ps2_input
void *empty;
} ps2_input_t;
static int16_t ps2_input_state(
void *data,
const input_device_driver_t *joypad,
const input_device_driver_t *sec_joypad,
rarch_joypad_info_t *joypad_info,
const struct retro_keybind **binds,
bool keyboard_mapping_blocked,
unsigned port,
unsigned device,
unsigned idx,
unsigned id)
{
return 0;
}
static void ps2_input_free_input(void *data)
{
free(data);
@ -68,7 +53,7 @@ static uint64_t ps2_input_get_capabilities(void *data)
input_driver_t input_ps2 = {
ps2_input_initialize,
NULL, /* poll */
ps2_input_state,
NULL, /* input_state */
ps2_input_free_input,
NULL,
NULL,

View File

@ -37,21 +37,6 @@ typedef struct ps4_input
void *empty;
} ps4_input_t;
static int16_t ps4_input_state(
void *data,
const input_device_driver_t *joypad,
const input_device_driver_t *sec_joypad,
rarch_joypad_info_t *joypad_info,
const struct retro_keybind **binds,
bool keyboard_mapping_blocked,
unsigned port,
unsigned device,
unsigned idx,
unsigned id)
{
return 0;
}
static void ps4_input_free_input(void *data)
{
free(data);
@ -74,7 +59,7 @@ static uint64_t ps4_input_get_capabilities(void *data)
input_driver_t input_ps4 = {
ps4_input_initialize,
NULL, /* poll */
ps4_input_state,
NULL, /* input_state */
ps4_input_free_input,
NULL,
NULL,

View File

@ -40,21 +40,6 @@ typedef struct xdk_input
void *empty;
} xdk_input_t;
static int16_t xdk_input_state(
void *data,
const input_device_driver_t *joypad,
const input_device_driver_t *sec_joypad,
rarch_joypad_info_t *joypad_info,
const struct retro_keybind **binds,
bool keyboard_mapping_blocked,
unsigned port,
unsigned device,
unsigned index,
unsigned id)
{
return 0;
}
static void xdk_input_free_input(void *data)
{
free(data);
@ -77,7 +62,7 @@ static uint64_t xdk_input_get_capabilities(void *data)
input_driver_t input_xinput = {
xdk_input_init,
NULL, /* poll */
xdk_input_state,
NULL, /* input_state */
xdk_input_free_input,
NULL,
NULL,

View File

@ -64,56 +64,6 @@ static void xenon360_input_poll(void *data)
}
}
static int16_t xenon360_input_state(
void *data,
const input_device_driver_t *joypad,
const input_device_driver_t *sec_joypad,
rarch_joypad_info_t *joypad_info,
const struct retro_keybind **binds,
bool keyboard_mapping_blocked,
unsigned port,
unsigned device,
unsigned idx,
unsigned id)
{
if (port >= DEFAULT_MAX_PADS)
return 0;
switch (device)
{
case RETRO_DEVICE_JOYPAD:
#if 0
if (id == RETRO_DEVICE_ID_JOYPAD_MASK)
{
unsigned i;
int16_t ret = 0;
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
{
if (binds[port][i].valid)
{
if (state[port] & binds[port][i].joykey)
ret |= (1 << i);
}
}
return ret;
}
if (binds[port][id].valid)
{
if (state[port] & binds[port][id].joykey)
return 1;
}
#endif
break;
default:
break;
}
return 0;
}
static void xenon360_input_free_input(void *data)
{
free(data);
@ -132,7 +82,7 @@ static uint64_t xenon360_input_get_capabilities(void *data)
input_driver_t input_xenon360 = {
xenon360_input_init,
xenon360_input_poll,
xenon360_input_state,
NULL, /* input_state */
xenon360_input_free_input,
NULL,
NULL,