From f117b22a46e39941e4fd48b8528dfc43c98182ff Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 12 Aug 2019 17:37:17 +0200 Subject: [PATCH] Cleanups --- retroarch.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/retroarch.c b/retroarch.c index 5ff40b248e..dcaab39e3e 100644 --- a/retroarch.c +++ b/retroarch.c @@ -12324,16 +12324,6 @@ static void input_menu_keys_pressed(input_bits_t *p_new_state) } #endif -#define INPUT_KEYS_CHECK(cond1, cond2, cond3) \ - for (i = cond1; i < cond2; i++) \ - { \ - bool bit_pressed = !cond3 && binds[i].valid && current_input->input_state(current_input_data, joypad_info, &binds, 0, RETRO_DEVICE_JOYPAD, 0, i); \ - if (bit_pressed || ((i >= RARCH_FIRST_META_KEY) && BIT64_GET(lifecycle_state, i)) || input_keys_pressed_other_sources(i, p_new_state)) \ - { \ - BIT256_SET_PTR(p_new_state, i); \ - } \ - } - /** * input_keys_pressed: * @@ -12387,12 +12377,24 @@ static void input_keys_pressed(input_bits_t *p_new_state) } /* Check the libretro input first */ - INPUT_KEYS_CHECK(0, RARCH_FIRST_META_KEY, - input_driver_block_libretro_input); + for (i = 0; i < RARCH_FIRST_META_KEY; i++) + { + bool bit_pressed = !input_driver_block_libretro_input && binds[i].valid && current_input->input_state(current_input_data, joypad_info, &binds, 0, RETRO_DEVICE_JOYPAD, 0, i); + if (bit_pressed || input_keys_pressed_other_sources(i, p_new_state)) + { + BIT256_SET_PTR(p_new_state, i); + } + } /* Check the hotkeys */ - INPUT_KEYS_CHECK(RARCH_FIRST_META_KEY, RARCH_BIND_LIST_END, - input_driver_block_hotkey); + for (i = RARCH_FIRST_META_KEY; i < RARCH_BIND_LIST_END; i++) + { + bool bit_pressed = !input_driver_block_hotkey && binds[i].valid && current_input->input_state(current_input_data, joypad_info, &binds, 0, RETRO_DEVICE_JOYPAD, 0, i); + if (bit_pressed || BIT64_GET(lifecycle_state, i) || input_keys_pressed_other_sources(i, p_new_state)) + { + BIT256_SET_PTR(p_new_state, i); + } + } } int16_t input_driver_input_state(