wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1#pragma once
2#include <wut.h>
3#include <vpadbase/base.h>
4
11#ifdef __cplusplus
12extern "C" {
13#endif
14
18typedef struct VPADStatus VPADStatus;
21typedef struct VPADVec2D VPADVec2D;
22typedef struct VPADVec3D VPADVec3D;
23
82
95
106
121
132
141
144{
146 float x;
148 float y;
149};
150WUT_CHECK_OFFSET(VPADVec2D, 0x00, x);
151WUT_CHECK_OFFSET(VPADVec2D, 0x04, y);
152WUT_CHECK_SIZE(VPADVec2D, 0x08);
153
156{
158 float x;
160 float y;
162 float z;
163};
164WUT_CHECK_OFFSET(VPADVec3D, 0x00, x);
165WUT_CHECK_OFFSET(VPADVec3D, 0x04, y);
166WUT_CHECK_OFFSET(VPADVec3D, 0x08, z);
167WUT_CHECK_SIZE(VPADVec3D, 0x0C);
168
179WUT_CHECK_OFFSET(VPADDirection, 0x00, x);
180WUT_CHECK_OFFSET(VPADDirection, 0x0C, y);
181WUT_CHECK_OFFSET(VPADDirection, 0x18, z);
182WUT_CHECK_SIZE(VPADDirection, 0x24);
183
186{
188 uint16_t adjustX;
190 uint16_t adjustY;
192 float scaleX;
194 float scaleY;
195};
196WUT_CHECK_OFFSET(VPADTouchCalibrationParam, 0x00, adjustX);
197WUT_CHECK_OFFSET(VPADTouchCalibrationParam, 0x02, adjustY);
198WUT_CHECK_OFFSET(VPADTouchCalibrationParam, 0x04, scaleX);
199WUT_CHECK_OFFSET(VPADTouchCalibrationParam, 0x08, scaleY);
200WUT_CHECK_SIZE(VPADTouchCalibrationParam, 0x0C);
201
204{
206 uint16_t x;
208 uint16_t y;
209
211 uint16_t touched;
212
214 uint16_t validity;
215};
216WUT_CHECK_OFFSET(VPADTouchData, 0x00, x);
217WUT_CHECK_OFFSET(VPADTouchData, 0x02, y);
218WUT_CHECK_OFFSET(VPADTouchData, 0x04, touched);
219WUT_CHECK_OFFSET(VPADTouchData, 0x06, validity);
220WUT_CHECK_SIZE(VPADTouchData, 0x08);
221
229WUT_CHECK_OFFSET(VPADAccStatus, 0x00, acc);
230WUT_CHECK_OFFSET(VPADAccStatus, 0x0C, magnitude);
231WUT_CHECK_OFFSET(VPADAccStatus, 0x10, variation);
232WUT_CHECK_OFFSET(VPADAccStatus, 0x14, vertical);
233WUT_CHECK_SIZE(VPADAccStatus, 0x1c);
234
236{
238 uint32_t hold;
239
241 uint32_t trigger;
242
244 uint32_t release;
245
248
251
254
257
260
261 uint8_t error;
262
263 WUT_UNKNOWN_BYTES(0x01);
264
267
270
273
274 WUT_UNKNOWN_BYTES(0x02);
275
277
280
283
285 uint8_t slideVolume;
286
288 uint8_t battery;
289
291 uint8_t micStatus;
292
295
296 WUT_UNKNOWN_BYTES(0x8);
297};
298WUT_CHECK_OFFSET(VPADStatus, 0x00, hold);
299WUT_CHECK_OFFSET(VPADStatus, 0x04, trigger);
300WUT_CHECK_OFFSET(VPADStatus, 0x08, release);
301WUT_CHECK_OFFSET(VPADStatus, 0x0C, leftStick);
302WUT_CHECK_OFFSET(VPADStatus, 0x14, rightStick);
303WUT_CHECK_OFFSET(VPADStatus, 0x1C, accelorometer);
304WUT_CHECK_OFFSET(VPADStatus, 0x38, gyro);
305WUT_CHECK_OFFSET(VPADStatus, 0x44, angle);
306WUT_CHECK_OFFSET(VPADStatus, 0x50, error);
307WUT_CHECK_OFFSET(VPADStatus, 0x52, tpNormal);
308WUT_CHECK_OFFSET(VPADStatus, 0x5A, tpFiltered1);
309WUT_CHECK_OFFSET(VPADStatus, 0x62, tpFiltered2);
310WUT_CHECK_OFFSET(VPADStatus, 0x6C, direction);
311WUT_CHECK_OFFSET(VPADStatus, 0x94, mag);
312WUT_CHECK_OFFSET(VPADStatus, 0xA0, slideVolume);
313WUT_CHECK_OFFSET(VPADStatus, 0xA1, battery);
314WUT_CHECK_OFFSET(VPADStatus, 0xA2, micStatus);
315WUT_CHECK_OFFSET(VPADStatus, 0xA3, slideVolumeEx);
316WUT_CHECK_SIZE(VPADStatus, 0xAC);
317
318typedef void(*VPADSamplingCallback)(VPADChan chan);
319
330void
332
343void
345
375int32_t
377 VPADStatus *buffers,
378 uint32_t count,
379 VPADReadError *outError);
380
394void
396 VPADTouchCalibrationParam *outParam);
397
411void
413 const VPADTouchCalibrationParam *param);
414
436void
438 VPADTouchData *calibratedData,
439 const VPADTouchData *uncalibratedData);
440
463void
465 VPADTouchPadResolution tpResolution,
466 VPADTouchData *calibratedData,
467 const VPADTouchData *uncalibratedData);
468
469void
471 float playRadius,
472 float sensitivity);
473
474void
476 float *outPlayRadius,
477 float *outSensitivity);
478
499void
501 float delaySec,
502 float pulseSec);
503
504void
506
507void
509
510void
512 int32_t max,
513 int32_t min);
514
515void
517 int32_t max,
518 int32_t min);
519
520void
522 float *param);
523
524void
527
528void
530 int32_t *max,
531 int32_t *min);
532
533void
535 int32_t *max,
536 int32_t *min);
537
538void
540
541void
543
544void
546
547void
549
550void
552
553void
555 float rotationDegree,
556 float range,
557 float radius);
558
559void
561 float rotationDegree,
562 float range,
563 float radius);
564
565void
567 float *outRotationDegree,
568 float *outRange,
569 float *outRadius);
570
571void
573 float *outRotationDegree,
574 float *outRange,
575 float *outRadius);
576
577void
579 float ax,
580 float ay,
581 float az);
582
583void
585 VPADDirection *base);
586
587void
589 float param);
590
591void
593 VPADDirection *dir);
594
595void
597 float mag);
598
599void
601 float pitch,
602 float yaw,
603 float roll);
604
605void
608
609void
611
612void
614
615void
617
618void
620
621void
623
624void
626
627
628float
630
631float
633
634float
636
637float
639
640void
642 float radius);
643
644void
646
647void
649
650void
652
653void
655
656void
658
669void
671
685BOOL
687
701void
703 BOOL invalid);
704
715void
717
728void
730
754int32_t
756 uint8_t *pattern,
757 uint8_t length);
758
770void
772
790int32_t
792 VPADLcdMode lcdMode);
793
810int32_t
812 VPADLcdMode *outLcdMode);
813
831int32_t
833 BOOL on);
834
837 VPADSamplingCallback callback);
838
845BOOL
847
848#ifdef __cplusplus
849}
850#endif
851
VPADAccStatus accelorometer
Status of DRC accelorometer.
Definition input.h:253
VPADVec3D y
y.
Definition input.h:175
uint8_t micStatus
Status of DRC microphone.
Definition input.h:291
float scaleY
Y scale.
Definition input.h:194
uint16_t validity
Bitfield of VPADTouchPadValidity to indicate how touch sample accuracy.
Definition input.h:214
uint16_t touched
0 if screen is not currently being touched.
Definition input.h:211
VPADVec2D rightStick
Position of right analog stick.
Definition input.h:250
VPADTouchData tpNormal
Current touch position on DRC.
Definition input.h:266
VPADVec3D mag
Status of DRC magnetometer.
Definition input.h:282
uint16_t x
The x-coordinate of a touched point.
Definition input.h:206
uint16_t adjustX
X offset.
Definition input.h:188
uint8_t slideVolumeEx
Unknown volume related value.
Definition input.h:294
uint32_t hold
Indicates what VPADButtons are held down.
Definition input.h:238
float variation
Definition input.h:226
uint16_t adjustY
Y offset.
Definition input.h:190
uint8_t battery
Battery level of controller.
Definition input.h:288
float magnitude
Definition input.h:225
VPADVec2D vertical
Definition input.h:227
float y
y.
Definition input.h:148
uint32_t release
Indicates what VPADButtons have been released since last sample.
Definition input.h:244
BOOL usingHeadphones
Set to 1 if headphones are plugged in, 0 otherwise.
Definition input.h:279
VPADVec3D gyro
Status of DRC gyro.
Definition input.h:256
uint16_t y
The y-coordinate of a touched point.
Definition input.h:208
VPADTouchData tpFiltered1
Filtered touch position, first level of smoothing.
Definition input.h:269
VPADVec3D z
z.
Definition input.h:177
uint32_t trigger
Indicates what VPADButtons have been pressed since last sample.
Definition input.h:241
float x
x.
Definition input.h:146
VPADVec3D angle
Status of DRC angle.
Definition input.h:259
VPADVec3D acc
Definition input.h:224
uint8_t error
Definition input.h:261
VPADVec2D leftStick
Position of left analog stick.
Definition input.h:247
float scaleX
X scale.
Definition input.h:192
VPADTouchData tpFiltered2
Filtered touch position, second level of smoothing.
Definition input.h:272
VPADVec3D x
x.
Definition input.h:173
uint8_t slideVolume
Current volume set by the slide control.
Definition input.h:285
float z
z.
Definition input.h:162
VPADDirection direction
Definition input.h:276
void VPADInitGyroAccReviseParam(VPADChan chan)
void VPADSetGyroDirReviseParam(VPADChan chan, float param)
void VPADDisableStickCrossClamp(VPADChan chan)
int32_t VPADSetSensorBar(VPADChan chan, BOOL on)
Turn the given Gamepad's sensor bar on or off.
void VPADGetTPCalibratedPoint(VPADChan chan, VPADTouchData *calibratedData, const VPADTouchData *uncalibratedData)
Transform touch data according to the current calibration data.
VPADTouchPadValidity
Touch pad validity.
Definition input.h:85
void VPADEnableStickCrossClamp(VPADChan chan)
void VPADSetLStickClampThreshold(VPADChan chan, int32_t max, int32_t min)
void VPADEnableGyroDirRevise(VPADChan chan)
void VPADSetAccParam(VPADChan chan, float playRadius, float sensitivity)
void VPADDisablePowerButton(VPADChan chan)
Disable the power button.
int32_t VPADRead(VPADChan chan, VPADStatus *buffers, uint32_t count, VPADReadError *outError)
Read controller data from the desired Gamepad.
void VPADSetGyroMagnification(VPADChan chan, float pitch, float yaw, float roll)
void VPADShutdown()
Cleans up and frees the VPAD library.
float VPADIsEnableGyroZeroDrift(VPADChan chan)
void VPADGetGyroDirReviseParam(VPADChan chan, float *param)
void VPADEnableGyroZeroPlay(VPADChan chan)
void VPADEnableLStickZeroClamp(VPADChan chan)
void VPADStartGyroMagRevise(VPADChan chan)
void VPADDisableGyroZeroPlay(VPADChan chan)
int32_t VPADControlMotor(VPADChan chan, uint8_t *pattern, uint8_t length)
Turns on the rumble motor on the desired Gamepad.
VPADLcdMode
LCD mode.
Definition input.h:124
void VPADSetStickOrigin(VPADChan chan)
int32_t VPADGetLcdMode(VPADChan chan, VPADLcdMode *outLcdMode)
Get the current status of the given Gamepad's display.
int32_t VPADSetLcdMode(VPADChan chan, VPADLcdMode lcdMode)
Sets the current mode of the display on the given Gamepad.
void VPADSetGyroZeroPlayParam(VPADChan chan, float radius)
void VPADGetTPCalibrationParam(VPADChan chan, VPADTouchCalibrationParam *outParam)
Get touch pad calibration parameters.
void VPADSetCrossStickEmulationParamsR(VPADChan chan, float rotationDegree, float range, float radius)
void VPADDisableRStickZeroClamp(VPADChan chan)
void VPADSetRStickClampThreshold(VPADChan chan, int32_t max, int32_t min)
float VPADIsEnableGyroZeroPlay(VPADChan chan)
struct VPADGyroStatus VPADGyroStatus
Definition input.h:17
void VPADSetGyroDirReviseBase(VPADChan chan, VPADDirection *base)
void VPADDisableGyroDirRevise(VPADChan chan)
void VPADSetGyroZeroDriftMode(VPADChan chan, VPADGyroZeroDriftMode mode)
void VPADInitGyroZeroDriftMode(VPADChan chan)
Initializes the zero drift mode on the desired Gamepad.
void VPADGetTPCalibratedPointEx(VPADChan chan, VPADTouchPadResolution tpResolution, VPADTouchData *calibratedData, const VPADTouchData *uncalibratedData)
Transform touch data according to the current calibration data.
float VPADIsEnableGyroDirRevise(VPADChan chan)
void VPADSetTPCalibrationParam(VPADChan chan, const VPADTouchCalibrationParam *param)
Set touch pad calibration parameters.
void VPADGetCrossStickEmulationParamsL(VPADChan chan, float *outRotationDegree, float *outRange, float *outRadius)
VPADTouchPadResolution
Touch pad resolution.
Definition input.h:98
BOOL VPADGetButtonProcMode(VPADChan chan)
Returns the proc mode of the given Gamepad.
void VPADGetLStickClampThreshold(VPADChan chan, int32_t *max, int32_t *min)
VPADSamplingCallback VPADSetSamplingCallback(VPADChan chan, VPADSamplingCallback callback)
void VPADGetRStickClampThreshold(VPADChan chan, int32_t *max, int32_t *min)
void VPADEnableRStickZeroClamp(VPADChan chan)
void VPADInit()
Initialises the VPAD library for use.
void VPADEnablePowerButton(VPADChan chan)
Enable the power button.
VPADButtons
Wii U GamePad buttons.
Definition input.h:26
void VPADSetCrossStickEmulationParamsL(VPADChan chan, float rotationDegree, float range, float radius)
void VPADSetBtnRepeat(VPADChan chan, float delaySec, float pulseSec)
Set a repeat for held buttons - instead of appearing to be continually held, repeated presses and rel...
void VPADDisableGyroAccRevise(VPADChan chan)
void VPADStopGyroMagRevise(VPADChan chan)
void(* VPADSamplingCallback)(VPADChan chan)
Definition input.h:318
VPADGyroZeroDriftMode
Gyro zero drift mode.
Definition input.h:135
void VPADGetAccParam(VPADChan chan, float *outPlayRadius, float *outSensitivity)
void VPADStopMotor(VPADChan chan)
Stops the desired Gamepad's rumble motor and cancels any ongoing rumble pattern.
float VPADIsEnableGyroAccRevise(VPADChan chan)
void VPADGetCrossStickEmulationParamsR(VPADChan chan, float *outRotationDegree, float *outRange, float *outRadius)
void VPADSetGyroDirectionMag(VPADChan chan, float mag)
void VPADInitGyroZeroPlayParam(VPADChan chan)
void VPADInitGyroDirReviseParam(VPADChan chan)
void VPADGetGyroZeroDriftMode(VPADChan chan, VPADGyroZeroDriftMode *mode)
void VPADSetGyroAngle(VPADChan chan, float ax, float ay, float az)
void VPADSetGyroDirection(VPADChan chan, VPADDirection *dir)
void VPADDisableLStickZeroClamp(VPADChan chan)
void VPADEnableGyroAccRevise(VPADChan chan)
BOOL VPADGetTVMenuStatus(VPADChan chan)
Get the TV menu status.
void VPADSetTVMenuInvalid(VPADChan chan, BOOL invalid)
Enable or disable the TV menu.
VPADReadError
Read error.
Definition input.h:109
@ VPAD_INVALID_X
X position is inaccurate.
Definition input.h:90
@ VPAD_VALID
Both X and Y touchpad positions are accurate.
Definition input.h:87
@ VPAD_INVALID_Y
Y position is inaccurate.
Definition input.h:93
@ VPAD_LCD_ON
Display is on as normal.
Definition input.h:130
@ VPAD_LCD_STANDBY
Display is in standby and will turn back on if any buttons are pressed.
Definition input.h:126
@ VPAD_LCD_OFF
Display is completely off and will remain so until explicitly changed.
Definition input.h:128
@ VPAD_TP_1920X1080
1920 x 1080 resolution.
Definition input.h:100
@ VPAD_TP_854X480
854 x 480 resolution.
Definition input.h:104
@ VPAD_TP_1280X720
1280 x 720 resolution.
Definition input.h:102
@ VPAD_BUTTON_X
The X button.
Definition input.h:32
@ VPAD_STICK_R_EMULATION_RIGHT
The emulated right button on the right stick.
Definition input.h:68
@ VPAD_STICK_L_EMULATION_RIGHT
The emulated right button on the left stick.
Definition input.h:76
@ VPAD_BUTTON_SYNC
The SYNC button.
Definition input.h:58
@ VPAD_BUTTON_B
The B button.
Definition input.h:30
@ VPAD_BUTTON_L
The L button.
Definition input.h:48
@ VPAD_BUTTON_STICK_L
The left stick button.
Definition input.h:62
@ VPAD_BUTTON_PLUS
The + button.
Definition input.h:52
@ VPAD_BUTTON_ZR
The ZR button.
Definition input.h:46
@ VPAD_BUTTON_ZL
The ZL button.
Definition input.h:44
@ VPAD_BUTTON_LEFT
The left button of the D-pad.
Definition input.h:36
@ VPAD_STICK_L_EMULATION_UP
The emulated up button on the left stick.
Definition input.h:78
@ VPAD_STICK_L_EMULATION_LEFT
The emulated left button on the left stick.
Definition input.h:74
@ VPAD_BUTTON_MINUS
The - button.
Definition input.h:54
@ VPAD_BUTTON_UP
The up button of the D-pad.
Definition input.h:40
@ VPAD_BUTTON_A
The A button.
Definition input.h:28
@ VPAD_BUTTON_R
The R button.
Definition input.h:50
@ VPAD_BUTTON_Y
The Y button.
Definition input.h:34
@ VPAD_BUTTON_HOME
The HOME button.
Definition input.h:56
@ VPAD_STICK_R_EMULATION_DOWN
The emulated down button on the right stick.
Definition input.h:72
@ VPAD_STICK_L_EMULATION_DOWN
The emulated down button on the left stick.
Definition input.h:80
@ VPAD_BUTTON_RIGHT
The right button of the D-pad.
Definition input.h:38
@ VPAD_STICK_R_EMULATION_LEFT
The emulated left button on the right stick.
Definition input.h:66
@ VPAD_STICK_R_EMULATION_UP
The emulated up button on the right stick.
Definition input.h:70
@ VPAD_BUTTON_TV
The TV button.
Definition input.h:64
@ VPAD_BUTTON_DOWN
The down button of the D-pad.
Definition input.h:42
@ VPAD_BUTTON_STICK_R
The right stick button.
Definition input.h:60
@ VPAD_GYRO_ZERODRIFT_STANDARD
Definition input.h:137
@ VPAD_GYRO_ZERODRIFT_NONE
Definition input.h:139
@ VPAD_GYRO_ZERODRIFT_TIGHT
Definition input.h:138
@ VPAD_GYRO_ZERODRIFT_LOOSE
Definition input.h:136
@ VPAD_READ_SUCCESS
No error occurred, and data was written to the buffers.
Definition input.h:111
@ VPAD_READ_BUSY
VPAD channel is busy, perhaps being accessed by another thread.
Definition input.h:117
@ VPAD_READ_NO_SAMPLES
There was no sample new data available to write.
Definition input.h:113
@ VPAD_READ_UNINITIALIZED
VPAD is uninitialized, need to call VPADInit()
Definition input.h:119
@ VPAD_READ_INVALID_CONTROLLER
The requested controller or channel was invalid.
Definition input.h:115
Direction.
Definition input.h:171
Touch calibration parameter.
Definition input.h:186
Touch data.
Definition input.h:204
2D vector.
Definition input.h:144
3D vector.
Definition input.h:156
VPADChan
Wii U GamePad channel.
Definition base.h:16
int32_t BOOL
Definition wut_types.h:7