mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Cleanup input_state
This commit is contained in:
parent
724f623c8a
commit
31426b00b9
15
retroarch.c
15
retroarch.c
@ -7734,30 +7734,23 @@ static int16_t input_state(unsigned port, unsigned device,
|
|||||||
|
|
||||||
device &= RETRO_DEVICE_MASK;
|
device &= RETRO_DEVICE_MASK;
|
||||||
ret = current_input->input_state(
|
ret = current_input->input_state(
|
||||||
current_input_data, joypad_info, libretro_input_binds, port, device, idx, id);
|
current_input_data, joypad_info,
|
||||||
|
libretro_input_binds, port, device, idx, id);
|
||||||
|
|
||||||
if ( (device == RETRO_DEVICE_JOYPAD) &&
|
if ( (device == RETRO_DEVICE_JOYPAD) &&
|
||||||
(id == RETRO_DEVICE_ID_JOYPAD_MASK))
|
(id == RETRO_DEVICE_ID_JOYPAD_MASK))
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
int16_t res = 0;
|
|
||||||
|
|
||||||
if ( !input_driver_flushing_input
|
if ( !input_driver_flushing_input
|
||||||
&& !input_driver_block_libretro_input)
|
&& !input_driver_block_libretro_input)
|
||||||
{
|
{
|
||||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||||
if (input_state_device(ret, port, device, idx, i, true))
|
if (input_state_device(ret, port, device, idx, i, true))
|
||||||
res |= (1 << i);
|
result |= (1 << i);
|
||||||
}
|
}
|
||||||
if (BSV_MOVIE_IS_PLAYBACK_OFF())
|
|
||||||
{
|
|
||||||
res = swap_if_big16(res);
|
|
||||||
intfstream_write(bsv_movie_state_handle->file, &res, 1);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
else if ( !input_driver_flushing_input
|
||||||
if ( !input_driver_flushing_input
|
|
||||||
&& !input_driver_block_libretro_input)
|
&& !input_driver_block_libretro_input)
|
||||||
result = input_state_device(ret, port, device, idx, id, false);
|
result = input_state_device(ret, port, device, idx, id, false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user