mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Cleanups
This commit is contained in:
parent
3cbbccef52
commit
d864fd9ead
@ -38,20 +38,18 @@ struct _wiimote_state
|
||||
uint8_t type;
|
||||
};
|
||||
|
||||
/* it would be nice to use designated initializers here,
|
||||
* but those are only in C99 and newer. Oh well.
|
||||
*/
|
||||
wiimote_state wiimotes[WIIU_WIIMOTE_CHANNELS] = {
|
||||
/* static global variables */
|
||||
static bool kpad_ready = false;
|
||||
static int channel_slot_map[] = { -1, -1, -1, -1 };
|
||||
static int poll_failures[WIIU_WIIMOTE_CHANNELS] = { 0, 0, 0, 0 };
|
||||
static wiimote_state
|
||||
wiimotes[WIIU_WIIMOTE_CHANNELS] = {
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
{ 0, {{0,0},{0,0},{0,0}}, WIIMOTE_TYPE_NONE },
|
||||
};
|
||||
|
||||
/* static global variables */
|
||||
static bool kpad_ready = false;
|
||||
static int channel_slot_map[] = { -1, -1, -1, -1 };
|
||||
static int poll_failures[WIIU_WIIMOTE_CHANNELS] = { 0, 0, 0, 0 };
|
||||
|
||||
static int to_wiimote_channel(unsigned pad)
|
||||
{
|
||||
@ -78,8 +76,6 @@ static int get_slot_for_channel(unsigned channel)
|
||||
|
||||
static bool kpad_init(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
kpad_poll();
|
||||
kpad_ready = true;
|
||||
|
||||
|
@ -16,8 +16,9 @@
|
||||
|
||||
#include "wiiu/input.h"
|
||||
|
||||
enum wiiu_pad_axes {
|
||||
WIIU_AXIS_LEFT_ANALOG_X,
|
||||
enum wiiu_pad_axes
|
||||
{
|
||||
WIIU_AXIS_LEFT_ANALOG_X = 0,
|
||||
WIIU_AXIS_LEFT_ANALOG_Y,
|
||||
WIIU_AXIS_RIGHT_ANALOG_X,
|
||||
WIIU_AXIS_RIGHT_ANALOG_Y,
|
||||
|
@ -25,15 +25,17 @@
|
||||
|
||||
#define PANIC_BUTTON_MASK (VPAD_BUTTON_R | VPAD_BUTTON_L | VPAD_BUTTON_STICK_R | VPAD_BUTTON_STICK_L)
|
||||
|
||||
#define WPAD_INVALID_CHANNEL -1
|
||||
|
||||
typedef struct _drc_state drc_state;
|
||||
struct _drc_state
|
||||
{
|
||||
uint64_t button_state;
|
||||
int16_t analog_state[3][2];
|
||||
};
|
||||
static drc_state gamepads[WIIU_GAMEPAD_CHANNELS] = { 0 };
|
||||
|
||||
#define WPAD_INVALID_CHANNEL -1
|
||||
/* TODO/FIXME - static global variables */
|
||||
static drc_state gamepads[WIIU_GAMEPAD_CHANNELS] = { 0 };
|
||||
static int channel_slot_map[WIIU_GAMEPAD_CHANNELS] = { WPAD_INVALID_CHANNEL, WPAD_INVALID_CHANNEL };
|
||||
|
||||
static VPADChan to_gamepad_channel(unsigned pad)
|
||||
@ -270,7 +272,8 @@ static bool wpad_init(void *data)
|
||||
|
||||
static bool wpad_query_pad(unsigned port)
|
||||
{
|
||||
return port < MAX_USERS && (to_gamepad_channel(port) != WPAD_INVALID_CHANNEL);
|
||||
return port < MAX_USERS &&
|
||||
(to_gamepad_channel(port) != WPAD_INVALID_CHANNEL);
|
||||
}
|
||||
|
||||
static void wpad_destroy(void) { }
|
||||
@ -319,7 +322,8 @@ static int16_t wpad_axis(unsigned port, uint32_t axis)
|
||||
return 0;
|
||||
|
||||
pad_functions.read_axis_data(axis, &data);
|
||||
return pad_functions.get_axis_value(data.axis, gamepads[channel].analog_state, data.is_negative);
|
||||
return pad_functions.get_axis_value(data.axis,
|
||||
gamepads[channel].analog_state, data.is_negative);
|
||||
}
|
||||
|
||||
static int16_t wpad_state(
|
||||
|
Loading…
x
Reference in New Issue
Block a user