(Input) reorder structs, alignment
This commit is contained in:
parent
13604b047f
commit
e6b9420a15
|
@ -141,29 +141,27 @@ typedef struct state_device
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
int port;
|
int port;
|
||||||
char name[256];
|
|
||||||
uint16_t rumble_last_strength_strong;
|
uint16_t rumble_last_strength_strong;
|
||||||
uint16_t rumble_last_strength_weak;
|
uint16_t rumble_last_strength_weak;
|
||||||
uint16_t rumble_last_strength;
|
uint16_t rumble_last_strength;
|
||||||
|
char name[256];
|
||||||
} state_device_t;
|
} state_device_t;
|
||||||
|
|
||||||
typedef struct android_input
|
typedef struct android_input
|
||||||
{
|
{
|
||||||
|
int64_t quick_tap_time;
|
||||||
const input_device_driver_t *joypad;
|
const input_device_driver_t *joypad;
|
||||||
|
state_device_t pad_states[MAX_USERS]; /* int alignment */
|
||||||
state_device_t pad_states[MAX_USERS];
|
int mouse_x_delta, mouse_y_delta;
|
||||||
|
int mouse_l, mouse_r, mouse_m, mouse_wu, mouse_wd;
|
||||||
|
unsigned pads_connected;
|
||||||
|
unsigned pointer_count;
|
||||||
|
sensor_t accelerometer_state; /* float alignment */
|
||||||
|
float mouse_x_prev, mouse_y_prev;
|
||||||
|
struct input_pointer pointer[MAX_TOUCH]; /* int16_t alignment */
|
||||||
int16_t analog_state[MAX_USERS][MAX_AXIS];
|
int16_t analog_state[MAX_USERS][MAX_AXIS];
|
||||||
int8_t hat_state[MAX_USERS][2];
|
int8_t hat_state[MAX_USERS][2];
|
||||||
char device_model[256];
|
char device_model[256];
|
||||||
|
|
||||||
unsigned pads_connected;
|
|
||||||
sensor_t accelerometer_state;
|
|
||||||
struct input_pointer pointer[MAX_TOUCH];
|
|
||||||
unsigned pointer_count;
|
|
||||||
int mouse_x_delta, mouse_y_delta;
|
|
||||||
float mouse_x_prev, mouse_y_prev;
|
|
||||||
int mouse_l, mouse_r, mouse_m, mouse_wu, mouse_wd;
|
|
||||||
int64_t quick_tap_time;
|
|
||||||
} android_input_t;
|
} android_input_t;
|
||||||
|
|
||||||
static void frontend_android_get_version_sdk(int32_t *sdk);
|
static void frontend_android_get_version_sdk(int32_t *sdk);
|
||||||
|
|
|
@ -51,13 +51,13 @@ typedef struct
|
||||||
|
|
||||||
typedef struct ps3_input
|
typedef struct ps3_input
|
||||||
{
|
{
|
||||||
|
const input_device_driver_t *joypad;
|
||||||
|
int connected[MAX_KB_PORT_NUM];
|
||||||
#ifdef HAVE_MOUSE
|
#ifdef HAVE_MOUSE
|
||||||
unsigned mice_connected;
|
unsigned mice_connected;
|
||||||
#endif
|
#endif
|
||||||
const input_device_driver_t *joypad;
|
|
||||||
KbInfo kbinfo;
|
KbInfo kbinfo;
|
||||||
KbData kbdata[MAX_KB_PORT_NUM];
|
KbData kbdata[MAX_KB_PORT_NUM];
|
||||||
int connected[MAX_KB_PORT_NUM];
|
|
||||||
} ps3_input_t;
|
} ps3_input_t;
|
||||||
|
|
||||||
static int mod_table[] = {
|
static int mod_table[] = {
|
||||||
|
|
|
@ -76,18 +76,16 @@ typedef struct psp_input
|
||||||
const input_device_driver_t *joypad;
|
const input_device_driver_t *joypad;
|
||||||
#ifdef VITA
|
#ifdef VITA
|
||||||
int keyboard_hid_handle;
|
int keyboard_hid_handle;
|
||||||
uint8_t prev_keys[6];
|
|
||||||
bool keyboard_state[VITA_MAX_SCANCODE + 1];
|
|
||||||
|
|
||||||
int mouse_hid_handle;
|
int mouse_hid_handle;
|
||||||
int32_t mouse_x;
|
int32_t mouse_x;
|
||||||
int32_t mouse_y;
|
int32_t mouse_y;
|
||||||
int32_t mouse_x_delta;
|
int32_t mouse_x_delta;
|
||||||
int32_t mouse_y_delta;
|
int32_t mouse_y_delta;
|
||||||
|
uint8_t prev_keys[6];
|
||||||
|
bool keyboard_state[VITA_MAX_SCANCODE + 1];
|
||||||
bool mouse_button_left;
|
bool mouse_button_left;
|
||||||
bool mouse_button_right;
|
bool mouse_button_right;
|
||||||
bool mouse_button_middle;
|
bool mouse_button_middle;
|
||||||
|
|
||||||
bool sensors_enabled;
|
bool sensors_enabled;
|
||||||
#endif
|
#endif
|
||||||
} psp_input_t;
|
} psp_input_t;
|
||||||
|
|
|
@ -49,26 +49,24 @@ typedef struct
|
||||||
int type;
|
int type;
|
||||||
int analogCount;
|
int analogCount;
|
||||||
int buttonCount;
|
int buttonCount;
|
||||||
char id[64];
|
|
||||||
char vid[64];
|
|
||||||
char pid[64];
|
|
||||||
|
|
||||||
int device;
|
int device;
|
||||||
int port;
|
int port;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
/* Current state. */
|
/* Current state. */
|
||||||
int buttons;
|
int buttons;
|
||||||
int analog0[3];
|
int analog0[3];
|
||||||
int analog1[3];
|
int analog1[3];
|
||||||
|
char id[64];
|
||||||
|
char vid[64];
|
||||||
|
char pid[64];
|
||||||
} qnx_input_device_t;
|
} qnx_input_device_t;
|
||||||
|
|
||||||
struct input_pointer
|
struct input_pointer
|
||||||
{
|
{
|
||||||
int16_t x, y;
|
|
||||||
int16_t full_x, full_y;
|
|
||||||
int contact_id;
|
int contact_id;
|
||||||
int map;
|
int map;
|
||||||
|
int16_t x, y;
|
||||||
|
int16_t full_x, full_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define QNX_MAX_KEYS (65535 + 7) / 8
|
#define QNX_MAX_KEYS (65535 + 7) / 8
|
||||||
|
@ -77,25 +75,24 @@ struct input_pointer
|
||||||
|
|
||||||
typedef struct qnx_input
|
typedef struct qnx_input
|
||||||
{
|
{
|
||||||
unsigned pads_connected;
|
uint64_t pad_state[DEFAULT_MAX_PADS];
|
||||||
|
|
||||||
|
const input_device_driver_t *joypad;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The first pointer_count indices of touch_map will be a valid,
|
* The first pointer_count indices of touch_map will be a valid,
|
||||||
* active index in pointer array.
|
* active index in pointer array.
|
||||||
* Saves us from searching through pointer array when polling state.
|
* Saves us from searching through pointer array when polling state.
|
||||||
*/
|
*/
|
||||||
struct input_pointer pointer[MAX_TOUCH];
|
struct input_pointer pointer[MAX_TOUCH]; /* int alignment */
|
||||||
unsigned pointer_count;
|
|
||||||
int touch_map[MAX_TOUCH];
|
int touch_map[MAX_TOUCH];
|
||||||
|
int trackpad_acc[2];
|
||||||
|
unsigned pointer_count;
|
||||||
|
unsigned pads_connected;
|
||||||
|
|
||||||
qnx_input_device_t devices[DEFAULT_MAX_PADS];
|
qnx_input_device_t devices[DEFAULT_MAX_PADS];
|
||||||
const input_device_driver_t *joypad;
|
|
||||||
|
|
||||||
uint8_t keyboard_state[QNX_MAX_KEYS];
|
uint8_t keyboard_state[QNX_MAX_KEYS];
|
||||||
|
|
||||||
uint64_t pad_state[DEFAULT_MAX_PADS];
|
|
||||||
|
|
||||||
int trackpad_acc[2];
|
|
||||||
} qnx_input_t;
|
} qnx_input_t;
|
||||||
|
|
||||||
extern screen_context_t screen_ctx;
|
extern screen_context_t screen_ctx;
|
||||||
|
|
|
@ -54,13 +54,17 @@ typedef struct rwebinput_keyboard_event
|
||||||
|
|
||||||
typedef struct rwebinput_keyboard_event_queue
|
typedef struct rwebinput_keyboard_event_queue
|
||||||
{
|
{
|
||||||
|
rwebinput_keyboard_event_t *events;
|
||||||
size_t count;
|
size_t count;
|
||||||
size_t max_size;
|
size_t max_size;
|
||||||
rwebinput_keyboard_event_t *events;
|
|
||||||
} rwebinput_keyboard_event_queue_t;
|
} rwebinput_keyboard_event_queue_t;
|
||||||
|
|
||||||
typedef struct rwebinput_mouse_states
|
typedef struct rwebinput_mouse_states
|
||||||
{
|
{
|
||||||
|
double pending_scroll_x;
|
||||||
|
double pending_scroll_y;
|
||||||
|
double scroll_x;
|
||||||
|
double scroll_y;
|
||||||
signed x;
|
signed x;
|
||||||
signed y;
|
signed y;
|
||||||
signed pending_delta_x;
|
signed pending_delta_x;
|
||||||
|
@ -68,18 +72,14 @@ typedef struct rwebinput_mouse_states
|
||||||
signed delta_x;
|
signed delta_x;
|
||||||
signed delta_y;
|
signed delta_y;
|
||||||
uint8_t buttons;
|
uint8_t buttons;
|
||||||
double pending_scroll_x;
|
|
||||||
double pending_scroll_y;
|
|
||||||
double scroll_x;
|
|
||||||
double scroll_y;
|
|
||||||
} rwebinput_mouse_state_t;
|
} rwebinput_mouse_state_t;
|
||||||
|
|
||||||
typedef struct rwebinput_input
|
typedef struct rwebinput_input
|
||||||
{
|
{
|
||||||
bool keys[RETROK_LAST];
|
rwebinput_mouse_state_t mouse; /* double alignment */
|
||||||
rwebinput_mouse_state_t mouse;
|
|
||||||
rwebinput_keyboard_event_queue_t keyboard;
|
|
||||||
const input_device_driver_t *joypad;
|
const input_device_driver_t *joypad;
|
||||||
|
rwebinput_keyboard_event_queue_t keyboard; /* ptr alignment */
|
||||||
|
bool keys[RETROK_LAST];
|
||||||
} rwebinput_input_t;
|
} rwebinput_input_t;
|
||||||
|
|
||||||
/* KeyboardEvent.keyCode has been deprecated for a while and doesn't have
|
/* KeyboardEvent.keyCode has been deprecated for a while and doesn't have
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
typedef struct sdl_input
|
typedef struct sdl_input
|
||||||
{
|
{
|
||||||
const input_device_driver_t *joypad;
|
const input_device_driver_t *joypad;
|
||||||
|
|
||||||
int mouse_x, mouse_y;
|
int mouse_x, mouse_y;
|
||||||
int mouse_abs_x, mouse_abs_y;
|
int mouse_abs_x, mouse_abs_y;
|
||||||
int mouse_l, mouse_r, mouse_m, mouse_b4, mouse_b5, mouse_wu, mouse_wd, mouse_wl, mouse_wr;
|
int mouse_l, mouse_r, mouse_m, mouse_b4, mouse_b5, mouse_wu, mouse_wd, mouse_wl, mouse_wr;
|
||||||
|
|
|
@ -114,14 +114,13 @@ typedef struct
|
||||||
|
|
||||||
struct udev_input_device
|
struct udev_input_device
|
||||||
{
|
{
|
||||||
int fd;
|
|
||||||
dev_t dev;
|
|
||||||
void (*handle_cb)(void *data,
|
void (*handle_cb)(void *data,
|
||||||
const struct input_event *event, udev_input_device_t *dev);
|
const struct input_event *event, udev_input_device_t *dev);
|
||||||
char devnode[PATH_MAX_LENGTH];
|
int fd;
|
||||||
enum udev_input_dev_type type;
|
dev_t dev;
|
||||||
|
|
||||||
udev_input_mouse_t mouse;
|
udev_input_mouse_t mouse;
|
||||||
|
enum udev_input_dev_type type;
|
||||||
|
char devnode[PATH_MAX_LENGTH];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*device_handle_cb)(void *data,
|
typedef void (*device_handle_cb)(void *data,
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include "wiiu_dbg.h"
|
#include "wiiu_dbg.h"
|
||||||
|
|
||||||
|
/* TODO/FIXME - static global variables */
|
||||||
static uint8_t keyboard_channel = 0x00;
|
static uint8_t keyboard_channel = 0x00;
|
||||||
static bool keyboard_state[RETROK_LAST] = { 0 };
|
static bool keyboard_state[RETROK_LAST] = { 0 };
|
||||||
|
|
||||||
|
|
|
@ -39,11 +39,10 @@ typedef struct x11_input
|
||||||
Display *display;
|
Display *display;
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
char state[32];
|
|
||||||
bool mouse_l, mouse_r, mouse_m;
|
|
||||||
int mouse_x, mouse_y;
|
int mouse_x, mouse_y;
|
||||||
int mouse_last_x, mouse_last_y;
|
int mouse_last_x, mouse_last_y;
|
||||||
|
char state[32];
|
||||||
|
bool mouse_l, mouse_r, mouse_m;
|
||||||
bool grab_mouse;
|
bool grab_mouse;
|
||||||
} x11_input_t;
|
} x11_input_t;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
/* TODO/FIXME -
|
/* TODO/FIXME -
|
||||||
* fix game focus toggle */
|
* fix game focus toggle */
|
||||||
|
|
||||||
|
/* TODO/FIXME - static global variable */
|
||||||
static uint64_t state[DEFAULT_MAX_PADS];
|
static uint64_t state[DEFAULT_MAX_PADS];
|
||||||
|
|
||||||
static void xenon360_input_poll(void *data)
|
static void xenon360_input_poll(void *data)
|
||||||
|
|
Loading…
Reference in New Issue