RetroArch
wiiuse.h
Go to the documentation of this file.
1 #ifndef __WIIUSE_H__
2 #define __WIIUSE_H__
3 
4 #if defined(_WIN32)
5  /* windows */
6  #include <windows.h>
7 #elif defined(GEKKO)
8  /* wii */
9  #include <bte/bte.h>
10 #elif defined(__linux__)
11  /* nix */
12  #include <bluetooth/bluetooth.h>
13 #endif
14 
15 #ifdef WIIUSE_INTERNAL_H_INCLUDED
16  #define WCONST
17 #else
18  #define WCONST const
19 #endif
20 
21 /* led bit masks */
22 #define WIIMOTE_LED_NONE 0x00
23 #define WIIMOTE_LED_1 0x10
24 #define WIIMOTE_LED_2 0x20
25 #define WIIMOTE_LED_3 0x40
26 #define WIIMOTE_LED_4 0x80
27 
28 /* button codes */
29 #define WIIMOTE_BUTTON_TWO 0x0001
30 #define WIIMOTE_BUTTON_ONE 0x0002
31 #define WIIMOTE_BUTTON_B 0x0004
32 #define WIIMOTE_BUTTON_A 0x0008
33 #define WIIMOTE_BUTTON_MINUS 0x0010
34 #define WIIMOTE_BUTTON_ZACCEL_BIT6 0x0020
35 #define WIIMOTE_BUTTON_ZACCEL_BIT7 0x0040
36 #define WIIMOTE_BUTTON_HOME 0x0080
37 #define WIIMOTE_BUTTON_LEFT 0x0100
38 #define WIIMOTE_BUTTON_RIGHT 0x0200
39 #define WIIMOTE_BUTTON_DOWN 0x0400
40 #define WIIMOTE_BUTTON_UP 0x0800
41 #define WIIMOTE_BUTTON_PLUS 0x1000
42 #define WIIMOTE_BUTTON_ZACCEL_BIT4 0x2000
43 #define WIIMOTE_BUTTON_ZACCEL_BIT5 0x4000
44 #define WIIMOTE_BUTTON_UNKNOWN 0x8000
45 #define WIIMOTE_BUTTON_ALL 0x1F9F
46 
47 /* nunchul button codes */
48 #define NUNCHUK_BUTTON_Z 0x01
49 #define NUNCHUK_BUTTON_C 0x02
50 #define NUNCHUK_BUTTON_ALL 0x03
51 
52 /* classic controller button codes */
53 #define CLASSIC_CTRL_BUTTON_UP 0x0001
54 #define CLASSIC_CTRL_BUTTON_LEFT 0x0002
55 #define CLASSIC_CTRL_BUTTON_ZR 0x0004
56 #define CLASSIC_CTRL_BUTTON_X 0x0008
57 #define CLASSIC_CTRL_BUTTON_A 0x0010
58 #define CLASSIC_CTRL_BUTTON_Y 0x0020
59 #define CLASSIC_CTRL_BUTTON_B 0x0040
60 #define CLASSIC_CTRL_BUTTON_ZL 0x0080
61 #define CLASSIC_CTRL_BUTTON_FULL_R 0x0200
62 #define CLASSIC_CTRL_BUTTON_PLUS 0x0400
63 #define CLASSIC_CTRL_BUTTON_HOME 0x0800
64 #define CLASSIC_CTRL_BUTTON_MINUS 0x1000
65 #define CLASSIC_CTRL_BUTTON_FULL_L 0x2000
66 #define CLASSIC_CTRL_BUTTON_DOWN 0x4000
67 #define CLASSIC_CTRL_BUTTON_RIGHT 0x8000
68 #define CLASSIC_CTRL_BUTTON_ALL 0xFEFF
69 
70 /* guitar hero 3 button codes */
71 #define GUITAR_HERO_3_BUTTON_STRUM_UP 0x0001
72 #define GUITAR_HERO_3_BUTTON_YELLOW 0x0008
73 #define GUITAR_HERO_3_BUTTON_GREEN 0x0010
74 #define GUITAR_HERO_3_BUTTON_BLUE 0x0020
75 #define GUITAR_HERO_3_BUTTON_RED 0x0040
76 #define GUITAR_HERO_3_BUTTON_ORANGE 0x0080
77 #define GUITAR_HERO_3_BUTTON_PLUS 0x0400
78 #define GUITAR_HERO_3_BUTTON_MINUS 0x1000
79 #define GUITAR_HERO_3_BUTTON_STRUM_DOWN 0x4000
80 #define GUITAR_HERO_3_BUTTON_ALL 0xFEFF
81 
82 /* guitar hero world tour touch bar codes */
83 #define GUITAR_HERO_3_TOUCH_AVAILABLE 0x1000
84 #define GUITAR_HERO_3_TOUCH_GREEN 0x1001
85 #define GUITAR_HERO_3_TOUCH_RED 0x1002
86 #define GUITAR_HERO_3_TOUCH_YELLOW 0x1004
87 #define GUITAR_HERO_3_TOUCH_BLUE 0x1008
88 #define GUITAR_HERO_3_TOUCH_ORANGE 0x1010
89 
90 /* wiimote option flags */
91 #define WIIUSE_SMOOTHING 0x01
92 #define WIIUSE_CONTINUOUS 0x02
93 #define WIIUSE_ACCEL_THRESH 0x04
94 #define WIIUSE_IR_THRESH 0x08
95 #define WIIUSE_JS_THRESH 0x10
96 #define WIIUSE_INIT_FLAGS WIIUSE_SMOOTHING
97 
98 #define WIIUSE_ORIENT_PRECISION 100.0f
99 
100 /* expansion codes */
101 #define EXP_NONE 0
102 #define EXP_NUNCHUK 1
103 #define EXP_CLASSIC 2
104 #define EXP_GUITAR_HERO_3 3
105 #define EXP_WII_BOARD 4
106 #define EXP_MOTION_PLUS 5
107 
108 /* IR correction types */
109 typedef enum ir_position_t {
112 } ir_position_t;
113 
120 #define IS_PRESSED(dev, button) ((dev->btns & button) == button)
121 
128 #define IS_HELD(dev, button) ((dev->btns_held & button) == button)
129 
139 #define IS_RELEASED(dev, button) ((dev->btns_released & button) == button)
140 
147 #define IS_JUST_PRESSED(dev, button) (IS_PRESSED(dev, button) && !IS_HELD(dev, button))
148 
155 #define WIIUSE_GET_IR_SENSITIVITY(dev, lvl) \
156  do { \
157  if ((wm->state & 0x01000) == 0x01000) *lvl = 1; \
158  else if ((wm->state & 0x02000) == 0x02000) *lvl = 2; \
159  else if ((wm->state & 0x04000) == 0x04000) *lvl = 3; \
160  else if ((wm->state & 0x08000) == 0x08000) *lvl = 4; \
161  else if ((wm->state & 0x10000) == 0x10000) *lvl = 5; \
162  else *lvl = 0; \
163  } while (0)
164 
165 #define WIIUSE_USING_ACC(wm) ((wm->state & 0x00100) == 0x00100)
166 #define WIIUSE_USING_EXP(wm) ((wm->state & 0x00200) == 0x00200)
167 #define WIIUSE_USING_IR(wm) ((wm->state & 0x00400) == 0x00400)
168 #define WIIUSE_USING_SPEAKER(wm) ((wm->state & 0x00800) == 0x00800)
169 
170 #define WIIUSE_IS_LED_SET(wm, num) ((wm->leds & WIIMOTE_LED_##num) == WIIMOTE_LED_##num)
171 
172 /*
173  * Largest known payload is 21 bytes.
174  * Add 2 for the prefix and round up to a power of 2.
175  */
176 #define MAX_PAYLOAD 32
177 
178 /*
179  * This is left over from an old hack, but it may actually
180  * be a useful feature to keep so it wasn't removed.
181  */
182 #ifdef WIN32
183  #define WIIMOTE_DEFAULT_TIMEOUT 100
184  #define WIIMOTE_EXP_TIMEOUT 100
185 #endif
186 
187 typedef unsigned char ubyte;
188 typedef char sbyte;
189 typedef unsigned short uword;
190 typedef short sword;
191 typedef unsigned int uint;
192 typedef char sint;
193 
194 
195 struct wiimote_t;
196 struct vec3b_t;
197 struct orient_t;
198 struct gforce_t;
199 
200 #ifdef GEKKO
201  typedef void (*wii_event_cb)(struct wiimote_t*, s32 event);
202 #endif
203 
217 typedef void (*wiiuse_data_cb)(struct wiimote_t* wm, ubyte* data, unsigned short len);
218 
219 typedef enum data_req_s
220 {
224 } data_req_s;
225 
230 struct data_req_t {
232  ubyte data[48];
233  unsigned int len;
236  struct data_req_t *next;
237 };
238 
239 typedef void (*cmd_blk_cb)(struct wiimote_t *wm,ubyte *data,uword len);
240 
241 typedef enum cmd_blk_s
242 {
246 } cmd_blk_s;
247 
248 struct cmd_blk_t
249 {
251 
252  ubyte data[48];
254 
257 
258  struct cmd_blk_t *next;
259 };
260 
261 
266 typedef struct vec2b_t {
268 } vec2b_t;
269 
270 
275 typedef struct vec3b_t {
276  ubyte x, y, z;
277 } vec3b_t;
278 
283 typedef struct vec3w_t {
284  uword x, y, z;
285 } vec3w_t;
286 
287 
292 typedef struct vec3f_t {
293  float x, y, z;
294 } vec3f_t;
295 
296 
303 typedef struct orient_t {
304  float roll;
305  float pitch;
306  float yaw;
307 
308  float a_roll;
309  float a_pitch;
310 } orient_t;
311 
312 
317 typedef struct gforce_t {
318  float x, y, z;
319 } gforce_t;
320 
321 
326 typedef struct accel_t {
327  struct vec3w_t cal_zero;
328  struct vec3w_t cal_g;
330  float st_roll;
331  float st_pitch;
332  float st_alpha;
333 } accel_t;
334 
335 
340 typedef struct ir_dot_t {
343  short rx;
344  short ry;
347 } ir_dot_t;
348 
349 
350 typedef struct fdot_t {
351  float x,y;
352 } fdot_t;
353 
354 typedef struct sb_t {
358  float angle;
359  float off_angle;
360  float score;
361 } sb_t;
362 
367 typedef enum aspect_t {
370 } aspect_t;
371 
372 
377 typedef struct ir_t {
378  struct ir_dot_t dot[4];
381  int state;
383  int raw_valid;
385  float ax;
386  float ay;
387  float distance;
388  float z;
389  float angle;
392  float sx;
393  float sy;
394  float error_cnt;
395  float glitch_cnt;
397  int valid;
398  float x;
399  float y;
402  unsigned int vres[2];
403  int offset[2];
405 } ir_t;
406 
407 
423 typedef struct joystick_t {
424  struct vec2b_t max;
425  struct vec2b_t min;
426  struct vec2b_t center;
427  struct vec2b_t pos;
429  float ang;
430  float mag;
431 } joystick_t;
432 
433 
438 typedef struct nunchuk_t {
440  struct joystick_t js;
442  int* flags;
449  struct vec3w_t accel;
450  struct orient_t orient;
451  struct gforce_t gforce;
452 } nunchuk_t;
453 
454 
459 typedef struct classic_ctrl_t {
460  short btns;
461  short btns_last;
462  short btns_held;
467 
468  float r_shoulder;
469  float l_shoulder;
471  struct joystick_t ljs;
472  struct joystick_t rjs;
475 
476 
481 typedef struct guitar_hero_3_t {
482  short btns;
483  short btns_last;
484  short btns_held;
488  float whammy_bar;
491  int touch_bar;
493  struct joystick_t js;
495 
500 typedef struct wii_board_t {
501  float tl; /* Interpolated */
502  float tr;
503  float bl;
504  float br; /* End interp */
505  short rtl; /* RAW */
506  short rtr;
507  short rbl;
508  short rbr; /* /RAW */
509  short ctl[3]; /* Calibration */
510  short ctr[3];
511  short cbl[3];
512  short cbr[3]; /* /Calibration */
513  float x;
514  float y;
515 } wii_board_t;
516 
517 typedef struct motion_plus_t
518 {
519  short rx, ry, rz;
522 } motion_plus_t;
523 
528 typedef struct expansion_t {
529  int type;
531  union {
535  struct wii_board_t wb;
537  };
538 } expansion_t;
539 
540 
545 typedef enum win_bt_stack_t {
550 
551 
556 typedef struct wiimote_state_t {
557  unsigned short btns;
558 
559  struct ir_t ir;
560  struct vec3w_t accel;
561  struct expansion_t exp;
563 
564 
569 typedef enum WIIUSE_EVENT_TYPE {
589 
594 typedef struct wiimote_t {
595  WCONST int unid;
597  #if defined(_WIN32)
598  WCONST HANDLE dev_handle;
599  WCONST OVERLAPPED hid_overlap;
600  WCONST enum win_bt_stack_t stack;
601  WCONST int timeout;
602  WCONST ubyte normal_timeout;
603  WCONST ubyte exp_timeout;
604  #elif defined(GEKKO)
605  WCONST lwp_queue cmdq;
606  WCONST struct bd_addr bdaddr;
607  WCONST char bdaddr_str[18];
608  WCONST struct bte_pcb *sock;
609  WCONST wii_event_cb event_cb;
610  #elif defined(unix)
611  WCONST bdaddr_t bdaddr;
612  WCONST char bdaddr_str[18];
613  WCONST int out_sock;
614  WCONST int in_sock;
615  #endif
616 
617  WCONST int state;
619 #ifdef GEKKO
621 #else
623 #endif
624 
625  WCONST int flags;
634 
642  WCONST struct ir_t ir;
644  WCONST unsigned short btns;
645  WCONST unsigned short btns_last;
646  WCONST unsigned short btns_held;
647  WCONST unsigned short btns_released;
655 } wiimote;
656 
657 #if defined(GEKKO)
658 
662 typedef struct wiimote_listen_t {
663  WCONST struct bd_addr bdaddr;
664  WCONST struct bte_pcb *sock;
665  WCONST struct wiimote_t *(*assign_cb)(struct bd_addr *bdaddr);
666  WCONST struct wiimote_t *wm;
667 } wiimote_listen;
668 #endif
669 
670 /*****************************************
671  *
672  * Include API specific stuff
673  *
674  *****************************************/
675 
676 #ifdef _WIN32
677  #define WIIUSE_EXPORT_DECL __declspec(dllexport)
678  #define WIIUSE_IMPORT_DECL __declspec(dllimport)
679 #else
680  #define WIIUSE_EXPORT_DECL
681  #define WIIUSE_IMPORT_DECL
682 #endif
683 
684 #ifdef WIIUSE_COMPILE_LIB
685  #define WIIUSE_EXPORT WIIUSE_EXPORT_DECL
686 #else
687  #define WIIUSE_EXPORT WIIUSE_IMPORT_DECL
688 #endif
689 
690 #ifdef __cplusplus
691 extern "C" {
692 #endif
693 
694 /* wiiuse.c */
695 WIIUSE_EXPORT extern const char* wiiuse_version();
696 
697 #ifndef GEKKO
698 WIIUSE_EXPORT extern struct wiimote_t** wiiuse_init(int wiimotes);
699 #else
700 WIIUSE_EXPORT extern int wiiuse_register(struct wiimote_listen_t *wml, struct bd_addr *bdaddr, struct wiimote_t *(*assign_cb)(struct bd_addr *bdaddr));
701 WIIUSE_EXPORT extern struct wiimote_t** wiiuse_init(int wiimotes, wii_event_cb event_cb);
702 WIIUSE_EXPORT extern void wiiuse_sensorbar_enable(int enable);
703 #endif
704 
705 WIIUSE_EXPORT extern void wiiuse_disconnected(struct wiimote_t* wm);
706 WIIUSE_EXPORT extern void wiiuse_cleanup(struct wiimote_t** wm, int wiimotes);
707 WIIUSE_EXPORT extern void wiiuse_rumble(struct wiimote_t* wm, int status);
708 WIIUSE_EXPORT extern void wiiuse_toggle_rumble(struct wiimote_t* wm);
709 WIIUSE_EXPORT extern void wiiuse_set_leds(struct wiimote_t* wm, int leds,cmd_blk_cb cb);
710 WIIUSE_EXPORT extern void wiiuse_motion_sensing(struct wiimote_t* wm, int status);
711 WIIUSE_EXPORT extern int wiiuse_read_data(struct wiimote_t* wm, ubyte* buffer, unsigned int offset, unsigned short len, cmd_blk_cb cb);
712 WIIUSE_EXPORT extern int wiiuse_write_data(struct wiimote_t *wm,unsigned int addr,ubyte *data,ubyte len,cmd_blk_cb cb);
713 WIIUSE_EXPORT extern void wiiuse_status(struct wiimote_t *wm,cmd_blk_cb cb);
714 WIIUSE_EXPORT extern struct wiimote_t* wiiuse_get_by_id(struct wiimote_t** wm, int wiimotes, int unid);
715 WIIUSE_EXPORT extern int wiiuse_set_flags(struct wiimote_t* wm, int enable, int disable);
716 WIIUSE_EXPORT extern float wiiuse_set_smooth_alpha(struct wiimote_t* wm, float alpha);
718 WIIUSE_EXPORT extern void wiiuse_resync(struct wiimote_t* wm);
719 WIIUSE_EXPORT extern void wiiuse_set_timeout(struct wiimote_t** wm, int wiimotes, ubyte normal_timeout, ubyte exp_timeout);
721 
722 /* connect.c */
723 WIIUSE_EXPORT extern int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout);
724 WIIUSE_EXPORT extern int wiiuse_connect(struct wiimote_t** wm, int wiimotes);
725 WIIUSE_EXPORT extern void wiiuse_disconnect(struct wiimote_t* wm);
726 
727 /* events.c */
728 WIIUSE_EXPORT extern int wiiuse_poll(struct wiimote_t** wm, int wiimotes);
729 
730 /* ir.c */
731 WIIUSE_EXPORT extern void wiiuse_set_ir_mode(struct wiimote_t *wm);
732 WIIUSE_EXPORT extern void wiiuse_set_ir(struct wiimote_t* wm, int status);
733 WIIUSE_EXPORT extern void wiiuse_set_ir_vres(struct wiimote_t* wm, unsigned int x, unsigned int y);
734 WIIUSE_EXPORT extern void wiiuse_set_ir_position(struct wiimote_t* wm, enum ir_position_t pos);
735 WIIUSE_EXPORT extern void wiiuse_set_aspect_ratio(struct wiimote_t* wm, enum aspect_t aspect);
736 WIIUSE_EXPORT extern void wiiuse_set_ir_sensitivity(struct wiimote_t* wm, int level);
737 
738 /* motion_plus.c */
739 WIIUSE_EXPORT extern void wiiuse_set_motion_plus(struct wiimote_t *wm, int status);
740 
741 /* speaker.c */
742 WIIUSE_EXPORT extern void wiiuse_set_speaker(struct wiimote_t *wm, int status);
743 
744 #ifdef __cplusplus
745 }
746 #endif
747 
748 #endif
float whammy_bar
Definition: wiiuse.h:488
Definition: wiiuse.h:354
WIIUSE_EXPORT void wiiuse_cleanup(struct wiimote_t **wm, int wiimotes)
struct ir_dot_t dot[4]
Definition: wiiuse.h:378
Definition: wiiuse.h:578
Definition: wiiuse.h:244
lwp_node node
Definition: wiiuse.h:250
float st_roll
Definition: wiiuse.h:330
Definition: wiiuse.h:584
Definition: wiiuse.h:575
WIIUSE_EXPORT void wiiuse_set_bluetooth_stack(struct wiimote_t **wm, int wiimotes, enum win_bt_stack_t type)
Definition: wiiuse.h:221
GLbitfield GLuint64 timeout
Definition: glext.h:7831
short rx
Definition: wiiuse.h:343
ubyte visible
Definition: wiiuse.h:341
ubyte btns_released
Definition: wiiuse.h:447
enum aspect_t aspect
Definition: wiiuse.h:400
int32_t s32
32bit signed integer
Definition: gctypes.h:24
WIIUSE_EXPORT void wiiuse_disconnected(struct wiimote_t *wm)
float z
Definition: wiiuse.h:318
cmd_blk_s state
Definition: wiiuse.h:255
struct wii_board_t wii_board_t
Unsigned x,y,z byte vector.
Definition: wiiuse.h:275
short rtl
Definition: wiiuse.h:505
Definition: lwp_queue.h:21
Definition: wiiuse.h:587
float x
Definition: wiiuse.h:351
char sint
Definition: wiiuse.h:192
float l_shoulder
Definition: wiiuse.h:469
Guitar Hero 3 expansion device.
Definition: wiiuse.h:481
struct wiimote_t wiimote
struct nunchuk_t nunchuk
Definition: wiiuse.h:532
Data read request structure.
Definition: wiiuse.h:230
short rz
Definition: wiiuse.h:519
short rbr
Definition: wiiuse.h:508
Definition: wiiuse.h:572
struct classic_ctrl_t classic
Definition: wiiuse.h:533
struct guitar_hero_3_t gh3
Definition: wiiuse.h:534
Definition: wiiuse.h:110
struct cmd_blk_t * next
Definition: wiiuse.h:258
float glitch_cnt
Definition: wiiuse.h:395
struct vec3w_t accel
Definition: wiiuse.h:560
WCONST struct orient_t orient
Definition: wiiuse.h:639
short btns_held
Definition: wiiuse.h:462
Wiimote structure.
Definition: wiiuse.h:594
short btns_last
Definition: wiiuse.h:483
WIIUSE_EXPORT void wiiuse_disconnect(struct wiimote_t *wm)
struct vec2b_t center
Definition: wiiuse.h:426
float a_roll
Definition: wiiuse.h:308
WCONST struct vec3w_t accel
Definition: wiiuse.h:638
Definition: wiiuse.h:581
Generic expansion device plugged into wiimote.
Definition: wiiuse.h:528
float st_pitch
Definition: wiiuse.h:331
struct ir_t ir_t
Definition: wiiuse.h:570
float y
Definition: wiiuse.h:399
ubyte wb_raw
Definition: wiiuse.h:487
float score
Definition: wiiuse.h:360
data_req_s
Definition: wiiuse.h:219
float x
Definition: wiiuse.h:513
short btns_released
Definition: wiiuse.h:463
WCONST struct ir_t ir
Definition: wiiuse.h:642
#define WCONST
Definition: wiiuse.h:18
unsigned short btns
Definition: wiiuse.h:557
float y
Definition: wiiuse.h:318
Accelerometer struct. For any device with an accelerometer.
Definition: wiiuse.h:326
WIIUSE_EXPORT int wiiuse_write_streamdata(struct wiimote_t *wm, ubyte *data, ubyte len, cmd_blk_cb cb)
Definition: wiiuse.c:298
WCONST struct data_req_t * data_req
Definition: wiiuse.h:630
struct orient_t orient_t
GLenum GLsizei len
Definition: glext.h:7389
Definition: wiiuse.h:222
Definition: wiiuse.h:585
WCONST unsigned short btns_last
Definition: wiiuse.h:645
Signed x,y,z float struct.
Definition: wiiuse.h:292
WIIUSE_EXPORT void wiiuse_status(struct wiimote_t *wm, cmd_blk_cb cb)
Definition: wiiuse.c:236
WIIUSE_EXPORT int wiiuse_connect(struct wiimote_t **wm, int wiimotes)
ubyte type
Definition: wiiuse.h:473
float sx
Definition: wiiuse.h:392
void(* wiiuse_data_cb)(struct wiimote_t *wm, ubyte *data, unsigned short len)
Callback that handles a read event.
Definition: wiiuse.h:217
Definition: wiiuse.h:243
Unsigned x,y byte vector.
Definition: wiiuse.h:266
Definition: lwp_queue.h:16
short rx
Definition: wiiuse.h:519
Definition: wiiuse.h:369
GLboolean enable
Definition: glext.h:12027
struct joystick_t js
Definition: wiiuse.h:440
struct bd_addr bdaddr
Definition: bte.h:108
struct ir_dot_t ir_dot_t
WIIUSE_EXPORT void wiiuse_set_ir_sensitivity(struct wiimote_t *wm, int level)
Set the IR sensitivity.
Definition: ir.c:316
short cbl[3]
Definition: wiiuse.h:511
float tl
Definition: wiiuse.h:501
ubyte ext
Definition: wiiuse.h:521
struct joystick_t ljs
Definition: wiiuse.h:471
struct data_req_t * next
Definition: wiiuse.h:236
WIIUSE_EXPORT const char * wiiuse_version()
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
Definition: wiiuse.h:368
uword y
Definition: wiiuse.h:284
Definition: bte.h:97
WIIUSE_EXPORT float wiiuse_set_smooth_alpha(struct wiimote_t *wm, float alpha)
WCONST ubyte event_buf[MAX_PAYLOAD]
Definition: wiiuse.h:652
Joystick calibration structure.
Definition: wiiuse.h:423
ubyte x
Definition: wiiuse.h:276
WIIUSE_EXPORT void wiiuse_set_timeout(struct wiimote_t **wm, int wiimotes, ubyte normal_timeout, ubyte exp_timeout)
struct vec3w_t cal_zero
Definition: wiiuse.h:327
struct motion_plus_t motion_plus_t
ubyte ls_raw
Definition: wiiuse.h:466
Definition: ibxm.h:9
Definition: wiiuse.h:350
struct vec3b_t vec3b_t
float ang
Definition: wiiuse.h:429
WCONST ubyte handshake_state
Definition: wiiuse.h:627
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:6303
Gravity force struct.
Definition: wiiuse.h:317
float br
Definition: wiiuse.h:504
int state
Definition: wiiuse.h:381
Definition: wiiuse.h:583
float a_pitch
Definition: wiiuse.h:309
float ay
Definition: wiiuse.h:386
Definition: wiiuse.h:283
WIIUSE_EXPORT void wiiuse_set_ir_position(struct wiimote_t *wm, enum ir_position_t pos)
Set the XY position for the IR cursor.
Definition: ir.c:251
WCONST unsigned short btns_released
Definition: wiiuse.h:647
WIIUSE_EXPORT int wiiuse_read_data(struct wiimote_t *wm, ubyte *buffer, unsigned int offset, unsigned short len, cmd_blk_cb cb)
Definition: wiiuse.c:246
struct vec3f_t vec3f_t
struct vec3w_t cal_g
Definition: wiiuse.h:328
Definition: wiiuse.h:517
float x
Definition: wiiuse.h:293
WCONST unsigned short btns
Definition: wiiuse.h:644
unsigned int uint
Definition: wiiuse.h:191
wiimote_state wiimotes[WIIU_WIIMOTE_CHANNELS]
Definition: kpad_driver.c:49
Classic controller expansion device.
Definition: wiiuse.h:459
short cbr[3]
Definition: wiiuse.h:512
WCONST int flags
Definition: wiiuse.h:625
float z
Definition: wiiuse.h:293
ubyte btns_held
Definition: wiiuse.h:446
sb_t sensorbar
Definition: wiiuse.h:384
WCONST WIIUSE_EVENT_TYPE event
Definition: wiiuse.h:651
GLenum type
Definition: glext.h:6233
float x
Definition: wiiuse.h:398
ubyte tb_raw
Definition: wiiuse.h:490
unsigned int vres[2]
Definition: wiiuse.h:402
Definition: wiiuse.h:580
IR struct. Hold all data related to the IR tracking.
Definition: wiiuse.h:377
Definition: wiiuse.h:223
ubyte status
Definition: wiiuse.h:520
enum ir_position_t pos
Definition: wiiuse.h:401
Definition: bd_addr.h:42
A single IR source.
Definition: wiiuse.h:340
struct vec3w_t accel
Definition: wiiuse.h:449
struct accel_t accel_t
float bl
Definition: wiiuse.h:503
WIIUSE_EVENT_TYPE
Events that wiiuse can generate from a poll.
Definition: wiiuse.h:569
float pitch
Definition: wiiuse.h:305
struct joystick_t rjs
Definition: wiiuse.h:472
struct guitar_hero_3_t guitar_hero_3_t
float x
Definition: wiiuse.h:318
WIIUSE_EXPORT int wiiuse_find(struct wiimote_t **wm, int max_wiimotes, int timeout)
short btns
Definition: wiiuse.h:460
WIIUSE_EXPORT void wiiuse_set_leds(struct wiimote_t *wm, int leds, cmd_blk_cb cb)
Toggle the state of the rumble.
Definition: wiiuse.c:195
struct expansion_t exp
Definition: wiiuse.h:561
Definition: wiiuse.h:573
uint len
Definition: wiiuse.h:253
int valid
Definition: wiiuse.h:397
GLenum const GLvoid * addr
Definition: glext.h:10528
WIIUSE_EXPORT void wiiuse_motion_sensing(struct wiimote_t *wm, int status)
Set if the wiimote should report motion sensing.
Definition: wiiuse.c:150
WIIUSE_EXPORT void wiiuse_toggle_rumble(struct wiimote_t *wm)
ubyte btns
Definition: wiiuse.h:444
WIIUSE_EXPORT int wiiuse_poll(struct wiimote_t **wm, int wiimotes)
win_bt_stack_t
Definition: wiiuse.h:545
cmd_blk_s
Definition: wiiuse.h:241
WCONST struct gforce_t gforce
Definition: wiiuse.h:640
ubyte y
Definition: wiiuse.h:267
Definition: wiiuse.h:571
GLint level
Definition: glext.h:6293
float y
Definition: wiiuse.h:351
fdot_t rot_dots[2]
Definition: wiiuse.h:357
float y
Definition: wiiuse.h:514
Wii Balance Board expansion device.
Definition: wiiuse.h:500
WCONST ubyte leds
Definition: wiiuse.h:618
float sy
Definition: wiiuse.h:393
ubyte x
Definition: wiiuse.h:267
struct expansion_t expansion_t
Nunchuk expansion device.
Definition: wiiuse.h:438
float tr
Definition: wiiuse.h:502
struct fdot_t fdot_t
int raw_valid
Definition: wiiuse.h:383
Definition: wiiuse.h:546
Definition: wiiuse.h:576
WCONST ubyte expansion_state
Definition: wiiuse.h:628
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
struct sb_t sb_t
fdot_t dots[2]
Definition: wiiuse.h:355
short btns
Definition: wiiuse.h:482
ubyte num_dots
Definition: wiiuse.h:379
ubyte size
Definition: wiiuse.h:346
float z
Definition: wiiuse.h:388
WCONST struct accel_t accel_calib
Definition: wiiuse.h:635
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
float y
Definition: wiiuse.h:293
short ry
Definition: wiiuse.h:519
struct wii_board_t wb
Definition: wiiuse.h:535
WIIUSE_EXPORT void wiiuse_rumble(struct wiimote_t *wm, int status)
ubyte y
Definition: wiiuse.h:276
int * flags
Definition: wiiuse.h:442
float off_angle
Definition: wiiuse.h:359
struct vec3w_t vec3w_t
short sword
Definition: wiiuse.h:190
WIIUSE_EXPORT void wiiuse_set_ir_mode(struct wiimote_t *wm)
Definition: ir.c:149
unsigned char ubyte
Definition: wiiuse.h:187
GLfloat GLfloat GLfloat alpha
Definition: glext.h:6290
unsigned int len
Definition: wiiuse.h:233
ir_position_t
Definition: wiiuse.h:109
Definition: wiiuse.h:579
data_req_s state
Definition: wiiuse.h:234
ubyte z
Definition: wiiuse.h:276
float ax
Definition: wiiuse.h:385
lwp_node node
Definition: wiiuse.h:231
WCONST int unid
Definition: wiiuse.h:595
struct gforce_t gforce_t
Definition: wiiuse.h:547
float r_shoulder
Definition: wiiuse.h:468
uword z
Definition: wiiuse.h:284
#define WIIUSE_EXPORT
Definition: wiiuse.h:687
short ry
Definition: wiiuse.h:344
struct joystick_t js
Definition: wiiuse.h:493
struct vec2b_t vec2b_t
ubyte rs_raw
Definition: wiiuse.h:465
Significant data from the previous event.
Definition: wiiuse.h:556
struct joystick_t joystick_t
Definition: wiiuse.h:245
Definition: wiiuse.h:582
char sbyte
Definition: wiiuse.h:188
Definition: wiiuse.h:574
short rbl
Definition: wiiuse.h:507
struct accel_t accel_calib
Definition: wiiuse.h:439
Definition: wiiuse.h:548
Definition: wiiuse.h:586
short btns_released
Definition: wiiuse.h:485
short ctr[3]
Definition: wiiuse.h:510
struct motion_plus_t mp
Definition: wiiuse.h:536
WIIUSE_EXPORT void wiiuse_set_ir(struct wiimote_t *wm, int status)
Definition: ir.c:161
fdot_t acc_dots[2]
Definition: wiiuse.h:356
struct vec2b_t pos
Definition: wiiuse.h:427
unsigned short uword
Definition: wiiuse.h:189
struct ir_t ir
Definition: wiiuse.h:559
float error_cnt
Definition: wiiuse.h:394
short rtr
Definition: wiiuse.h:506
struct nunchuk_t nunchuk_t
WIIUSE_EXPORT void wiiuse_set_motion_plus(struct wiimote_t *wm, int status)
Definition: motion_plus.c:60
float roll
Definition: wiiuse.h:304
float st_alpha
Definition: wiiuse.h:332
Definition: wiiuse.h:248
struct _cl_event * event
Definition: glext.h:8406
float aspect
Definition: ffmpeg_core.c:183
WIIUSE_EXPORT void wiiuse_set_speaker(struct wiimote_t *wm, int status)
Definition: speaker.c:68
float distance
Definition: wiiuse.h:387
struct orient_t orient
Definition: wiiuse.h:450
Definition: wiiuse.h:111
WCONST ubyte motion_plus_id[6]
Definition: wiiuse.h:654
float angle
Definition: wiiuse.h:389
WCONST unsigned short btns_held
Definition: wiiuse.h:646
WCONST struct cmd_blk_t * cmd_head
Definition: wiiuse.h:632
struct vec2b_t min
Definition: wiiuse.h:425
cmd_blk_cb cb
Definition: wiiuse.h:256
WIIUSE_EXPORT void wiiuse_set_ir_vres(struct wiimote_t *wm, unsigned int x, unsigned int y)
Set the virtual screen resolution for IR tracking.
Definition: ir.c:239
ubyte btns_last
Definition: wiiuse.h:445
float mag
Definition: wiiuse.h:430
struct vec2b_t max
Definition: wiiuse.h:424
int smooth_valid
Definition: wiiuse.h:391
Definition: video4linux2.c:51
GLintptr offset
Definition: glext.h:6560
WCONST int state
Definition: wiiuse.h:617
WCONST float battery_level
Definition: wiiuse.h:622
Orientation struct.
Definition: wiiuse.h:303
WIIUSE_EXPORT int wiiuse_write_data(struct wiimote_t *wm, unsigned int addr, ubyte *data, ubyte len, cmd_blk_cb cb)
Definition: wiiuse.c:271
WIIUSE_EXPORT struct wiimote_t * wiiuse_get_by_id(struct wiimote_t **wm, int wiimotes, int unid)
short btns_last
Definition: wiiuse.h:461
WCONST struct cmd_blk_t * cmd_tail
Definition: wiiuse.h:633
#define MAX_PAYLOAD
Definition: wiiuse.h:176
WCONST struct expansion_t exp
Definition: wiiuse.h:636
int touch_bar
Definition: wiiuse.h:491
WIIUSE_EXPORT struct wiimote_t ** wiiuse_init(int wiimotes)
Definition: wiiuse.c:59
WCONST struct wiimote_state_t lstate
Definition: wiiuse.h:649
uword x
Definition: wiiuse.h:284
WIIUSE_EXPORT void wiiuse_set_aspect_ratio(struct wiimote_t *wm, enum aspect_t aspect)
Set the aspect ratio of the TV/monitor.
Definition: ir.c:289
void(* cmd_blk_cb)(struct wiimote_t *wm, ubyte *data, uword len)
Definition: wiiuse.h:239
struct gforce_t gforce
Definition: wiiuse.h:451
Definition: wiiuse.h:577
struct classic_ctrl_t classic_ctrl_t
int type
Definition: wiiuse.h:529
WIIUSE_EXPORT void wiiuse_resync(struct wiimote_t *wm)
short ctl[3]
Definition: wiiuse.h:509
wiiuse_data_cb cb
Definition: wiiuse.h:235
WIIUSE_EXPORT int wiiuse_set_flags(struct wiimote_t *wm, int enable, int disable)
Set flags for the specified wiimote.
Definition: wiiuse.c:127
float yaw
Definition: wiiuse.h:306
struct wiimote_state_t wiimote_state_t
short btns_held
Definition: wiiuse.h:484
float angle
Definition: wiiuse.h:358
static int sock
Definition: ranetplayer.c:84
aspect_t
Screen aspect ratio.
Definition: wiiuse.h:367