mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 18:40:09 +00:00
Add support for 64 buttons in udev gamepads
It seems only 16 were only really supported anyway due to the usage of BITS_COPY16_PTR (which only copies 16 bit states)?
This commit is contained in:
parent
4382772a79
commit
bf48757a2e
@ -49,7 +49,7 @@
|
||||
* Code adapted from SDL 2.0's implementation.
|
||||
*/
|
||||
|
||||
#define UDEV_NUM_BUTTONS 32
|
||||
#define UDEV_NUM_BUTTONS 64
|
||||
#define NUM_AXES 32
|
||||
|
||||
#ifndef NUM_HATS
|
||||
@ -638,7 +638,7 @@ static void udev_joypad_get_buttons(unsigned port, input_bits_t *state)
|
||||
|
||||
if (pad)
|
||||
{
|
||||
BITS_COPY16_PTR( state, pad->buttons );
|
||||
BITS_COPY64_PTR( state, pad->buttons );
|
||||
}
|
||||
else
|
||||
BIT256_CLEAR_ALL_PTR(state);
|
||||
|
@ -152,6 +152,13 @@ static INLINE bool bits_any_set(uint32_t* ptr, uint32_t count)
|
||||
BITS_GET_ELEM_PTR(a, 0) = (bits); \
|
||||
}
|
||||
|
||||
#define BITS_COPY64_PTR(a,bits) \
|
||||
{ \
|
||||
BIT128_CLEAR_ALL_PTR(a); \
|
||||
BITS_GET_ELEM_PTR(a, 0) = (bits); \
|
||||
BITS_GET_ELEM_PTR(a, 1) = (bits >> 32); \
|
||||
}
|
||||
|
||||
/* Helper macros and struct to keep track of many booleans. */
|
||||
/* This struct has 256 bits. */
|
||||
typedef struct
|
||||
|
Loading…
x
Reference in New Issue
Block a user