From 1da31a84ab0ff8e52f43e309114b9eef6e492f02 Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 26 Apr 2013 13:32:11 +0200 Subject: [PATCH] Prompt user to "reset" joypad state. Many joypad drivers have "stale state" lying around and need some events to be fired to normalize. Broken initial state will break joypad configure like this. --- tools/retroarch-joyconfig.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/retroarch-joyconfig.c b/tools/retroarch-joyconfig.c index 47e4ff4dc6..f3d40c6b6a 100644 --- a/tools/retroarch-joyconfig.c +++ b/tools/retroarch-joyconfig.c @@ -113,6 +113,7 @@ static void get_binds(config_file_t *conf, config_file_t *auto_conf, int player, if (joypad_name && auto_conf) config_set_string(auto_conf, "input_device", joypad_name); + int16_t initial_axes[MAX_AXES] = {0}; struct poll_data old_poll = {{0}}; struct poll_data new_poll = {{0}}; @@ -120,6 +121,9 @@ static void get_binds(config_file_t *conf, config_file_t *auto_conf, int player, int last_axis = -1; bool block_axis = false; + poll_joypad(driver, joypad, &old_poll); + fprintf(stderr, "\nJoypads tend to have stale state after opened.\nPress some buttons and move some axes around to make sure joypad state is reset properly.\nWhen done, press Enter ... "); + getchar(); poll_joypad(driver, joypad, &old_poll); for (int i = 0; i < MAX_AXES; i++)