diff --git a/gfx/drivers_tracker/video_state_python.c b/gfx/drivers_tracker/video_state_python.c index 3c8b725619..3a62a911bb 100644 --- a/gfx/drivers_tracker/video_state_python.c +++ b/gfx/drivers_tracker/video_state_python.c @@ -394,9 +394,6 @@ float py_state_get(py_state_t *handle, const char *id, if (dpad_mode == ANALOG_DPAD_NONE) continue; - input_push_analog_dpad_pre(general_binds); - input_push_analog_dpad_pre(auto_binds); - input_push_analog_dpad(general_binds, dpad_mode); input_push_analog_dpad(auto_binds, dpad_mode); } diff --git a/input/input_driver.c b/input/input_driver.c index c546a93a2c..cf277ec503 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -513,9 +513,6 @@ void state_tracker_update_input(uint16_t *input1, uint16_t *input2) if (dpad_mode == ANALOG_DPAD_NONE) continue; - input_push_analog_dpad_pre(general_binds); - input_push_analog_dpad_pre(auto_binds); - input_push_analog_dpad(general_binds, dpad_mode); input_push_analog_dpad(auto_binds, dpad_mode); } @@ -733,7 +730,6 @@ uint64_t input_menu_keys_pressed(void) { struct retro_keybind *auto_binds = settings->input.autoconf_binds[i]; - input_push_analog_dpad_pre(auto_binds); input_push_analog_dpad(auto_binds, ANALOG_DPAD_LSTICK); } diff --git a/input/input_driver.h b/input/input_driver.h index 13ce1a9655..4355983a84 100644 --- a/input/input_driver.h +++ b/input/input_driver.h @@ -181,6 +181,19 @@ bool input_translate_coord_viewport(int mouse_x, int mouse_y, #define inherit_joyaxis(binds) (((binds)[x_plus].joyaxis == (binds)[x_minus].joyaxis) || ( (binds)[y_plus].joyaxis == (binds)[y_minus].joyaxis)) +/** + * input_pop_analog_dpad: + * @binds : Binds to modify. + * + * Restores binds temporarily overridden by input_push_analog_dpad(). + **/ +#define input_pop_analog_dpad(binds) \ +{ \ + unsigned j; \ + for (j = RETRO_DEVICE_ID_JOYPAD_UP; j <= RETRO_DEVICE_ID_JOYPAD_RIGHT; j++) \ + (binds)[j].joyaxis = (binds)[j].orig_joyaxis; \ +} + /** * input_push_analog_dpad: * @binds : Binds to modify. @@ -205,6 +218,8 @@ bool input_translate_coord_viewport(int mouse_x, int mouse_y, x_minus = RARCH_ANALOG_LEFT_X_MINUS; \ y_minus = RARCH_ANALOG_LEFT_Y_MINUS; \ } \ + for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \ + (binds)[k].orig_joyaxis = (binds)[k].joyaxis; \ if (!inherit_joyaxis(binds)) \ { \ unsigned j = x_plus + 3; \ @@ -214,26 +229,6 @@ bool input_translate_coord_viewport(int mouse_x, int mouse_y, } \ } -#define input_push_analog_dpad_pre(binds) \ -{ \ - unsigned k; \ - for (k = RETRO_DEVICE_ID_JOYPAD_UP; k <= RETRO_DEVICE_ID_JOYPAD_RIGHT; k++) \ - (binds)[k].orig_joyaxis = (binds)[k].joyaxis; \ -} - -/** - * input_pop_analog_dpad: - * @binds : Binds to modify. - * - * Restores binds temporarily overridden by input_push_analog_dpad(). - **/ -#define input_pop_analog_dpad(binds) \ -{ \ - unsigned j; \ - for (j = RETRO_DEVICE_ID_JOYPAD_UP; j <= RETRO_DEVICE_ID_JOYPAD_RIGHT; j++) \ - (binds)[j].joyaxis = (binds)[j].orig_joyaxis; \ -} - /** * input_poll: * diff --git a/runloop.c b/runloop.c index fad7a51ac8..448497b095 100644 --- a/runloop.c +++ b/runloop.c @@ -1247,9 +1247,6 @@ int runloop_iterate(unsigned *sleep_ms) if (dpad_mode == ANALOG_DPAD_NONE) continue; - input_push_analog_dpad_pre(general_binds); - input_push_analog_dpad_pre(auto_binds); - input_push_analog_dpad(general_binds, dpad_mode); input_push_analog_dpad(auto_binds, dpad_mode); }