diff --git a/config.def.h b/config.def.h index 63175e98a9..f41dc6033d 100644 --- a/config.def.h +++ b/config.def.h @@ -224,7 +224,7 @@ static const bool netplay_client_swap_input = true; // Axis threshold (between 0.0 and 1.0) // How far an axis must be tilted to result in a button press -#define AXIS_THRESHOLD 0.5 +static const float axis_threshold = 0.5; // To figure out which joypad buttons to use, check jstest or similar. // SDL sometimes reverses the axes for some odd reason, but hey. :D diff --git a/driver.h b/driver.h index 743a58347a..7c14b5abf7 100644 --- a/driver.h +++ b/driver.h @@ -27,7 +27,7 @@ enum { - SSNES_FAST_FORWARD_KEY = 0x666, // Hurr, durr + SSNES_FAST_FORWARD_KEY = 12, // SNES has 12 buttons from 0-11 (libsnes.hpp) SSNES_FAST_FORWARD_HOLD_KEY, SSNES_LOAD_STATE_KEY, SSNES_SAVE_STATE_KEY, @@ -47,7 +47,9 @@ enum SSNES_CHEAT_INDEX_MINUS, SSNES_CHEAT_TOGGLE, SSNES_SCREENSHOT, - SSNES_DSP_CONFIG + SSNES_DSP_CONFIG, + + SSNES_BIND_LIST_END }; diff --git a/general.h b/general.h index 8d49ec2ccf..fb55983144 100644 --- a/general.h +++ b/general.h @@ -55,7 +55,7 @@ #endif #define MAX_PLAYERS 5 -#define MAX_BINDS 34 // Needs to be increased every time there are new binds added. +#define MAX_BINDS (SSNES_BIND_LIST_END + 1) #define SSNES_NO_JOYPAD 0xFFFF enum ssnes_shader_type diff --git a/settings.c b/settings.c index fba459da70..302ec0a603 100644 --- a/settings.c +++ b/settings.c @@ -176,7 +176,7 @@ static void set_defaults(void) for (unsigned i = 1; i < 5; i++) memcpy(g_settings.input.binds[i], snes_keybinds_rest, sizeof(snes_keybinds_rest)); - g_settings.input.axis_threshold = AXIS_THRESHOLD; + g_settings.input.axis_threshold = axis_threshold; g_settings.input.netplay_client_swap_input = netplay_client_swap_input; for (int i = 0; i < MAX_PLAYERS; i++) g_settings.input.joypad_map[i] = i;