mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-21 18:21:51 +00:00
Fix subtle regression.
This commit is contained in:
parent
8d5385d1d7
commit
848a67252f
9
driver.h
9
driver.h
@ -73,7 +73,11 @@ struct snes_keybind
|
||||
bool valid;
|
||||
int id;
|
||||
enum ssnes_key key;
|
||||
uint64_t joykey; // PC only uses lower 16-bits.
|
||||
|
||||
// PC only uses lower 16-bits.
|
||||
// Full 64-bit can be used for port-specific purposes, like simplifying multiple binds, etc.
|
||||
uint64_t joykey;
|
||||
|
||||
uint32_t joyaxis;
|
||||
};
|
||||
|
||||
@ -107,11 +111,12 @@ typedef struct audio_driver
|
||||
#define AXIS_NEG(x) (((uint32_t)(x) << 16) | UINT16_C(0xFFFF))
|
||||
#define AXIS_POS(x) ((uint32_t)(x) | UINT32_C(0xFFFF0000))
|
||||
#define AXIS_NONE UINT32_C(0xFFFFFFFF)
|
||||
#define AXIS_DIR_NONE UINT16_C(0xFFFF)
|
||||
|
||||
#define AXIS_NEG_GET(x) (((uint32_t)(x) >> 16) & UINT16_C(0xFFFF))
|
||||
#define AXIS_POS_GET(x) ((uint32_t)(x) & UINT16_C(0xFFFF))
|
||||
|
||||
#define NO_BTN UINT64_C(0xFFFFFFFFFFFFFFFF) // I hope no joypad will ever have this many buttons ... ;)
|
||||
#define NO_BTN UINT16_C(0xFFFF) // I hope no joypad will ever have this many buttons ... ;)
|
||||
|
||||
#define HAT_UP_MASK (1 << 15)
|
||||
#define HAT_DOWN_MASK (1 << 14)
|
||||
|
@ -185,7 +185,7 @@ static bool sdl_key_pressed(int key)
|
||||
}
|
||||
|
||||
#ifndef HAVE_DINPUT
|
||||
static bool sdl_joykey_pressed(sdl_input_t *sdl, int port_num, uint16_t joykey)
|
||||
static bool sdl_joykey_pressed(sdl_input_t *sdl, int port_num, uint64_t joykey)
|
||||
{
|
||||
if (joykey == NO_BTN)
|
||||
return false;
|
||||
|
@ -881,12 +881,12 @@ static void save_keybind_axis(config_file_t *conf,
|
||||
|
||||
if (bind->joyaxis == AXIS_NONE)
|
||||
config_set_string(conf, map->axis, "nul");
|
||||
else if (AXIS_NEG_GET(bind->joyaxis) != NO_BTN)
|
||||
else if (AXIS_NEG_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
||||
{
|
||||
dir = '-';
|
||||
axis = AXIS_NEG_GET(bind->joyaxis);
|
||||
}
|
||||
else if (AXIS_POS_GET(bind->joyaxis) != NO_BTN)
|
||||
else if (AXIS_POS_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
||||
{
|
||||
dir = '+';
|
||||
axis = AXIS_POS_GET(bind->joyaxis);
|
||||
|
Loading…
x
Reference in New Issue
Block a user