input_keys_pressed/menu_input_keys_pressed - optimizations
This commit is contained in:
parent
55b6107eb0
commit
be5985b8e6
104
retroarch.c
104
retroarch.c
|
@ -24029,6 +24029,30 @@ static void input_menu_keys_pressed(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_rarch->input_driver_block_libretro_input)
|
||||||
|
{
|
||||||
|
/* Check the libretro input first */
|
||||||
|
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
||||||
|
{
|
||||||
|
if (input_keys_pressed_other_sources(p_rarch, i, p_new_state))
|
||||||
|
{
|
||||||
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check the hotkeys */
|
||||||
|
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
BIT64_GET(lifecycle_state, i)
|
||||||
|
|| input_keys_pressed_other_sources(p_rarch, i, p_new_state)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
int16_t ret[MAX_USERS];
|
int16_t ret[MAX_USERS];
|
||||||
/* Check the libretro input first */
|
/* Check the libretro input first */
|
||||||
|
@ -24045,34 +24069,27 @@ static void input_menu_keys_pressed(
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
||||||
{
|
|
||||||
bool bit_pressed = false;
|
|
||||||
|
|
||||||
if (!p_rarch->input_driver_block_libretro_input)
|
|
||||||
{
|
{
|
||||||
for (port = 0; port < port_max; port++)
|
for (port = 0; port < port_max; port++)
|
||||||
{
|
{
|
||||||
if (binds[port][i].valid && ret[port] & (UINT64_C(1) << i))
|
if (binds[port][i].valid && ret[port] & (UINT64_C(1) << i))
|
||||||
{
|
{
|
||||||
bit_pressed = true;
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
break;
|
/* Break out of nested loop */
|
||||||
}
|
goto input_menu_keys_check_libretro_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bit_pressed || input_keys_pressed_other_sources(
|
if (input_keys_pressed_other_sources(p_rarch, i, p_new_state))
|
||||||
p_rarch, i, p_new_state))
|
|
||||||
{
|
{
|
||||||
BIT256_SET_PTR(p_new_state, i);
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
}
|
}
|
||||||
|
input_menu_keys_check_libretro_end:
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the hotkeys */
|
/* Check the hotkeys */
|
||||||
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
|
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
|
||||||
{
|
|
||||||
bool bit_pressed = false;
|
|
||||||
|
|
||||||
if (!p_rarch->input_driver_block_hotkey)
|
|
||||||
{
|
{
|
||||||
for (port = 0; port < port_max; port++)
|
for (port = 0; port < port_max; port++)
|
||||||
{
|
{
|
||||||
|
@ -24087,18 +24104,20 @@ static void input_menu_keys_pressed(
|
||||||
p_rarch->current_input_data, joypad_info,
|
p_rarch->current_input_data, joypad_info,
|
||||||
&binds[0], port, RETRO_DEVICE_JOYPAD, 0, i))
|
&binds[0], port, RETRO_DEVICE_JOYPAD, 0, i))
|
||||||
{
|
{
|
||||||
bit_pressed = true;
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
break;
|
/* Break out of nested loop */
|
||||||
}
|
goto input_menu_keys_check_hotkeys_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( bit_pressed
|
if ( BIT64_GET(lifecycle_state, i)
|
||||||
|| BIT64_GET(lifecycle_state, i)
|
|| input_keys_pressed_other_sources(p_rarch, i, p_new_state)
|
||||||
|| input_keys_pressed_other_sources(p_rarch, i, p_new_state))
|
)
|
||||||
{
|
{
|
||||||
BIT256_SET_PTR(p_new_state, i);
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
}
|
}
|
||||||
|
input_menu_keys_check_hotkeys_end:
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24179,29 +24198,50 @@ static void input_keys_pressed(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the libretro input first */
|
if (p_rarch->input_driver_block_libretro_input)
|
||||||
{
|
{
|
||||||
int16_t ret = p_rarch->current_input->input_state(
|
/* Check the libretro input first */
|
||||||
p_rarch->current_input_data,
|
|
||||||
joypad_info, &binds, 0, RETRO_DEVICE_JOYPAD, 0,
|
|
||||||
RETRO_DEVICE_ID_JOYPAD_MASK);
|
|
||||||
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
||||||
{
|
{
|
||||||
bool bit_pressed = !p_rarch->input_driver_block_libretro_input
|
if (input_keys_pressed_other_sources(p_rarch, i, p_new_state))
|
||||||
&& binds[i].valid && (ret & (UINT64_C(1) << i));
|
|
||||||
if (bit_pressed || input_keys_pressed_other_sources(p_rarch,
|
|
||||||
i, p_new_state))
|
|
||||||
{
|
{
|
||||||
BIT256_SET_PTR(p_new_state, i);
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Check the hotkeys */
|
/* Check the hotkeys */
|
||||||
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
|
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
|
||||||
{
|
{
|
||||||
bool bit_pressed = !p_rarch->input_driver_block_hotkey && binds[i].valid
|
if (
|
||||||
&& p_rarch->current_input->input_state(p_rarch->current_input_data, joypad_info,
|
BIT64_GET(lifecycle_state, i)
|
||||||
|
|| input_keys_pressed_other_sources(p_rarch, i, p_new_state))
|
||||||
|
{
|
||||||
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Check the libretro input first */
|
||||||
|
int16_t ret = p_rarch->current_input->input_state(
|
||||||
|
p_rarch->current_input_data,
|
||||||
|
joypad_info, &binds, 0, RETRO_DEVICE_JOYPAD, 0,
|
||||||
|
RETRO_DEVICE_ID_JOYPAD_MASK);
|
||||||
|
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
||||||
|
{
|
||||||
|
bool bit_pressed = binds[i].valid && (ret & (UINT64_C(1) << i));
|
||||||
|
if (bit_pressed || input_keys_pressed_other_sources(p_rarch,
|
||||||
|
i, p_new_state))
|
||||||
|
{
|
||||||
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check the hotkeys */
|
||||||
|
for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++)
|
||||||
|
{
|
||||||
|
bool bit_pressed = binds[i].valid && p_rarch->current_input->input_state(
|
||||||
|
p_rarch->current_input_data, joypad_info,
|
||||||
&binds, 0, RETRO_DEVICE_JOYPAD, 0, i);
|
&binds, 0, RETRO_DEVICE_JOYPAD, 0, i);
|
||||||
if ( bit_pressed
|
if ( bit_pressed
|
||||||
|| BIT64_GET(lifecycle_state, i)
|
|| BIT64_GET(lifecycle_state, i)
|
||||||
|
@ -24210,6 +24250,8 @@ static void input_keys_pressed(
|
||||||
BIT256_SET_PTR(p_new_state, i);
|
BIT256_SET_PTR(p_new_state, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *input_driver_get_data(void)
|
void *input_driver_get_data(void)
|
||||||
|
|
Loading…
Reference in New Issue