/*---------------------------------------------------------------------------* Project: WPAD library File: wpad.h Copyright (C) 2005-2011 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __WPAD_H__ #define __WPAD_H__ #include #include #ifdef __cplusplus extern "C" { #endif #define SENSOR_BAR_OFF 0 #define SENSOR_BAR_ON 1 #define WPAD_CHAN0 0 #define WPAD_CHAN1 1 #define WPAD_CHAN2 2 #define WPAD_CHAN3 3 #define WPAD_CHAN_INVALID -1 #define WPAD_MAX_CONTROLLERS 4 #define WPAD_MOTOR_STOP 0 #define WPAD_MOTOR_RUMBLE 1 #ifndef WPADEMU // Under construction. These definitions are subject to change. #define WPAD_BUTTON_LEFT 0x0001 #define WPAD_BUTTON_RIGHT 0x0002 #define WPAD_BUTTON_DOWN 0x0004 #define WPAD_BUTTON_UP 0x0008 #define WPAD_BUTTON_PLUS 0x0010 #define WPAD_BUTTON_2 0x0100 #define WPAD_BUTTON_1 0x0200 #define WPAD_BUTTON_B 0x0400 #define WPAD_BUTTON_A 0x0800 #define WPAD_BUTTON_MINUS 0x1000 #define WPAD_BUTTON_HOME 0x8000 #define WPAD_BUTTON_Z 0x2000 #define WPAD_BUTTON_C 0x4000 // for backward compatibility #define WPAD_BUTTON_START WPAD_BUTTON_PLUS #define WPAD_BUTTON_SELECT WPAD_BUTTON_MINUS #define WPAD_BUTTON_SMALL_A WPAD_BUTTON_1 #define WPAD_BUTTON_SMALL_B WPAD_BUTTON_2 // for Classic Controller accessory extension #define WPAD_CL_BUTTON_UP 0x0001 #define WPAD_CL_BUTTON_LEFT 0x0002 #define WPAD_CL_TRIGGER_ZR 0x0004 #define WPAD_CL_BUTTON_ZR WPAD_CL_TRIGGER_ZR #define WPAD_CL_BUTTON_X 0x0008 #define WPAD_CL_BUTTON_A 0x0010 #define WPAD_CL_BUTTON_Y 0x0020 #define WPAD_CL_BUTTON_B 0x0040 #define WPAD_CL_TRIGGER_ZL 0x0080 #define WPAD_CL_BUTTON_ZL WPAD_CL_TRIGGER_ZL #define WPAD_CL_RESERVED 0x0100 #define WPAD_CL_TRIGGER_R 0x0200 #define WPAD_CL_BUTTON_R WPAD_CL_TRIGGER_R #define WPAD_CL_BUTTON_PLUS 0x0400 #define WPAD_CL_BUTTON_HOME 0x0800 #define WPAD_CL_BUTTON_MINUS 0x1000 #define WPAD_CL_TRIGGER_L 0x2000 #define WPAD_CL_BUTTON_L WPAD_CL_TRIGGER_L #define WPAD_CL_BUTTON_DOWN 0x4000 #define WPAD_CL_BUTTON_RIGHT 0x8000 // for URCC extension #define WPAD_UC_BUTTON_UP 0x00000001 #define WPAD_UC_BUTTON_LEFT 0x00000002 #define WPAD_UC_TRIGGER_ZR 0x00000004 #define WPAD_UC_BUTTON_X 0x00000008 #define WPAD_UC_BUTTON_A 0x00000010 #define WPAD_UC_BUTTON_Y 0x00000020 #define WPAD_UC_BUTTON_B 0x00000040 #define WPAD_UC_TRIGGER_ZL 0x00000080 #define WPAD_UC_RESERVED 0x00000100 #define WPAD_UC_TRIGGER_R 0x00000200 #define WPAD_UC_BUTTON_PLUS 0x00000400 #define WPAD_UC_BUTTON_HOME 0x00000800 #define WPAD_UC_BUTTON_MINUS 0x00001000 #define WPAD_UC_TRIGGER_L 0x00002000 #define WPAD_UC_BUTTON_DOWN 0x00004000 #define WPAD_UC_BUTTON_RIGHT 0x00008000 #define WPAD_UC_BUTTON_STICK_R 0x00010000 #define WPAD_UC_BUTTON_STICK_L 0x00020000 #define WPAD_UC_BUTTON_ZL WPAD_UC_TRIGGER_ZL #define WPAD_UC_BUTTON_ZR WPAD_UC_TRIGGER_ZR #define WPAD_UC_BUTTON_L WPAD_UC_TRIGGER_L #define WPAD_UC_BUTTON_R WPAD_UC_TRIGGER_R #define WPAD_MAX_CUSTOM_BUFS 20 #define WPAD_DPD_OFF 0 #define WPAD_DPD_STD 1 #define WPAD_DPD_EXP 3 #define WPAD_DPD_FULL 5 #define WPAD_DPD_MAX_OBJECTS 4 #define WPAD_DPD_ANGLE 42.0f // viewing angle #define WPAD_DPD_IMG_RESO_WX 1024 // DPD image resolution #define WPAD_DPD_IMG_RESO_WY 768 #define WPAD_SPEAKER_OFF 0 #define WPAD_SPEAKER_ON 1 #define WPAD_SPEAKER_MUTE 2 #define WPAD_SPEAKER_MUTE_OFF 3 #define WPAD_SPEAKER_PLAY 4 #define WPAD_SPEAKER_RESET 5 #define WPAD_MPLS_OFF 0 #define WPAD_MPLS_STD 4 #define WPAD_MPLS_EXP 5 // for compatible #define WPAD_MPLS_FS 5 #define WPAD_MPLS_CL 7 #define WPAD_MPLS_ZRST 128 #define WPAD_MPLS_STAT_PLSVLD 0x80 #define WPAD_MPLS_STAT_EXTVLD 0x40 #define WPAD_MPLS_STAT_YAWSEL 0x08 #define WPAD_MPLS_STAT_PITSEL 0x04 #define WPAD_MPLS_STAT_ROLSEL 0x02 #define WPAD_MPLS_STAT_ATTACH 0x01 #define WPAD_EXTGMK_OFF 0 #define WPAD_EXTGMK_ON 1 #define WPAD_ACC_RESO 1024 // accelerometer resolution #define WPAD_ACC_MAX 3.4f // valid gravity = 3.4G #define WPAD_FS_STICK_RESO 256 // stick resolution of FreeStyle unit #define WPAD_FS_ACC_RESO 1024 // accelerometer resolution of FreeStyle unit #define WPAD_FS_ACC_MAX 2.1f // valid gravity = 2.1G #define WPAD_CL_STICK_RESO 1024 #define WPAD_CL_TRIGGER_RESO 256 #define WPAD_UC_STICK_RESO 4096 // device type #define WPAD_DEV_CORE 0 #define WPAD_DEV_FREESTYLE 1 #define WPAD_DEV_CLASSIC 2 #define WPAD_DEV_MPLS 5 #define WPAD_DEV_MPLS_FREESTYLE 6 #define WPAD_DEV_MPLS_CLASSIC 7 #define WPAD_DEV_URCC 31 #define WPAD_DEV_MPLS_FUTURE 250 #define WPAD_DEV_FUTURE 251 #define WPAD_DEV_NOT_SUPPORTED 252 #define WPAD_DEV_NOT_FOUND 253 #define WPAD_DEV_UNKNOWN 255 // data format of Core #define WPAD_FMT_CORE 0 // only buttons #define WPAD_FMT_CORE_ACC 1 // buttons, motion sensor #define WPAD_FMT_CORE_ACC_DPD 2 // buttons, motion sensor, pointing // data format of Core + Nunchaku #define WPAD_FMT_FREESTYLE 3 // buttons, nunchaku #define WPAD_FMT_FREESTYLE_ACC 4 // buttons, motion sensor, nunchaku #define WPAD_FMT_FREESTYLE_ACC_DPD 5 // buttons, motion sensor, pointing, nunchaku // data format of Core + Classic Controller accessory #define WPAD_FMT_CLASSIC 6 // buttons, classic #define WPAD_FMT_CLASSIC_ACC 7 // buttons, motion sensor, classic #define WPAD_FMT_CLASSIC_ACC_DPD 8 // buttons, motion sensor, pointing, classic // data format of Core + DPD full mode #define WPAD_FMT_CORE_ACC_DPD_FULL 9 // buttons, motion sensor, pointing #define WPAD_FMT_MPLS 16 // buttons, motion sensor, pointing, Wii MotionPlus #define WPAD_FMT_URCC 22 // buttons, URCC #define WPAD_STATE_DISABLED 0 #define WPAD_STATE_ENABLED 1 // disable channel to avoid WiFi interference. #define WPAD_DISABLE_CLEAR 0x0000 // enable all range #define WPAD_DISABLE_WIFI_CHAN_1 0x0001 #define WPAD_DISABLE_WIFI_CHAN_2 0x0002 #define WPAD_DISABLE_WIFI_CHAN_3 0x0004 #define WPAD_DISABLE_WIFI_CHAN_4 0x0008 #define WPAD_DISABLE_WIFI_CHAN_5 0x0010 #define WPAD_DISABLE_WIFI_CHAN_6 0x0020 #define WPAD_DISABLE_WIFI_CHAN_7 0x0040 #define WPAD_DISABLE_WIFI_CHAN_8 0x0080 #define WPAD_DISABLE_WIFI_CHAN_9 0x0100 #define WPAD_DISABLE_WIFI_CHAN_10 0x0200 #define WPAD_DISABLE_WIFI_CHAN_11 0x0400 #define WPAD_DISABLE_WIFI_CHAN_12 0x0800 #define WPAD_DISABLE_WIFI_CHAN_13 0x1000 #define WPAD_DISABLE_WIFI_CHAN_14 0x2000 // battery level #define WPAD_BATTERY_LEVEL_CRITICAL 0 #define WPAD_BATTERY_LEVEL_LOW 1 #define WPAD_BATTERY_LEVEL_MEDIUM 2 #define WPAD_BATTERY_LEVEL_HIGH 3 #define WPAD_BATTERY_LEVEL_MAX 4 #define WPAD_LED_CHAN_1 0x1 #define WPAD_LED_CHAN_2 0x2 #define WPAD_LED_CHAN_3 0x4 #define WPAD_LED_CHAN_4 0x8 #define WPAD_SYNC_EVT_START 0 #define WPAD_SYNC_EVT_DONE 1 #define WPAD_CLEAR_EVT_BUSY -1 #define WPAD_CLEAR_EVT_START 0 #define WPAD_CLEAR_EVT_DONE 1 #define WPAD_ADDR_LEN 6 #define WPAD_STRM_INTERVAL OSNanosecondsToTicks(6666667) // clamp algorithm for stick #define WPAD_STICK_CLAMP_OCTA_WITH_PLAY 0 #define WPAD_STICK_CLAMP_OCTA_WITHOUT_PLAY 1 #define WPAD_STICK_CLAMP_CIRCLE_WITH_PLAY 2 #define WPAD_STICK_CLAMP_CIRCLE_WITHOUT_PLAY 3 // clamp algorithm for trigger #define WPAD_TRIGGER_FIXED_BASE 0 #define WPAD_TRIGGER_INDIVIDUAL_BASE 1 // clamp algorithm for accelerometer #define WPAD_ACC_CLAMP_CUBE 0 #define WPAD_ACC_CLAMP_SPHERE 1 #define WPAD_SENSOR_BAR_POS_BOTTOM 0 #define WPAD_SENSOR_BAR_POS_TOP 1 #define WPAD_MEM_GAMEDATA_LEN 3888 #define WPAD_SYNC_TYPE_STD 0 #define WPAD_SYNC_TYPE_SMP 1 #define WPAD_MPLS_TYPE_INTEGRATED 1 #define WPAD_MPLS_TYPE_STANDARD 0 #define WPAD_MPLS_TYPE_READING -1 #else // SI-based WPAD #define WPAD_BUTTON_HOME 0x0001 #define WPAD_BUTTON_SELECT 0x0002 #define WPAD_BUTTON_A 0x0004 #define WPAD_BUTTON_B 0x0008 #define WPAD_BUTTON_SMALL_A 0x0010 #define WPAD_BUTTON_SMALL_B 0x0020 #define WPAD_BUTTON_START 0x0100 #define WPAD_BUTTON_UP 0x0200 #define WPAD_BUTTON_DOWN 0x0400 #define WPAD_BUTTON_RIGHT 0x0800 #define WPAD_BUTTON_LEFT 0x1000 #define WPAD_BUTTON_Z1 0x2000 #define WPAD_BUTTON_Z2 0x4000 #define WPAD_BUTTON_X WPAD_BUTTON_SMALL_A #define WPAD_BUTTON_Y WPAD_BUTTON_SMALL_B #define WPAD_TRIGGER_Z WPAD_BUTTON_Z1 #define WPAD_BUTTON_Z WPAD_TRIGGER_Z #define WPAD_TRIGGER_R WPAD_BUTTON_Z2 #define WPAD_BUTTON_R WPAD_TRIGGER_R #define WPAD_TRIGGER_L 0x8000 #define WPAD_BUTTON_L WPAD_TRIGGER_L #define WPAD_DPD_MAX_OBJECTS 4 #define WPAD_DPD_ANGLE 42.0f // viewing angle #define WPAD_DPD_IMG_RESO_WX 1024 // DPD image resolution #define WPAD_DPD_IMG_RESO_WY 768 #define WPAD_ACC_RESO 1024 // accelerometer resolution #define WPAD_ACC_1G_VALUE 205 // gravity value #define WPAD_FS_STICK_RESO 256 // stick resolution of FreeStyle unit #define WPAD_FS_ACC_RESO 1024 // accelerometer resolution of FreeStyle unit #define WPAD_FS_ACC_1G_VALUE 205 // gravity value of FreeStyle unit #define WPAD_DEV_CORE 0 #define WPAD_DEV_FREESTYLE 1 #define WPAD_DEV_DOLPHIN 254 #define WPAD_DEV_UNKNOWN 255 #define WPAD_DEV_NOT_FOUND 253 // For backward compatibility. do not use. #define WPAD_FMT_CORE 0 // data format of Core controller #define WPAD_FMT_FREESTYLE 1 // data format of FreeStyle controller #define WPAD_FMT_DOLPHIN 255 // data format of Dolphin controller(for debug) #endif #define WPAD_ERR_NONE 0 #define WPAD_ERR_NO_CONTROLLER -1 #define WPAD_ERR_BUSY -2 #define WPAD_ERR_TRANSFER -3 #define WPAD_ERR_INVALID -4 #define WPAD_ERR_NOPERM -5 #define WPAD_ERR_BROKEN -6 #define WPAD_ERR_CORRUPTED -7 #define WPAD_UPTO7_ERR_NONE 0 #define WPAD_UPTO7_ERR_FAIL -1 #ifdef __MWERKS__ #pragma warn_padding off #endif typedef struct DPDObject { s16 x; // 0 <= x < WPAD_DPD_IMG_RESO_WX s16 y; // 0 <= y < WPAD_DPD_IMG_RESO_WY u16 size; u8 traceId; // 1 byte padding } DPDObject; #ifdef __MWERKS__ #pragma warn_padding reset #endif #ifdef __MWERKS__ #pragma warn_padding off #endif typedef struct DPDObjEx { s16 range_x1; s16 range_y1; s16 range_x2; s16 range_y2; u16 pixel; s8 radius; // 1 byte padding } DPDObjEx; #ifdef __MWERKS__ #pragma warn_padding reset #endif typedef struct WPADStatus { u16 button; // Or-ed WPAD_BUTTON_* bits s16 accX; // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2 s16 accY; // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2 s16 accZ; // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; u8 dev; // one of WPAD_DEV_* number s8 err; // one of WPAD_ERR_* number } WPADStatus; typedef struct WPADFSStatus { u16 button; // Or-ed WPAD_BUTTON_* bits s16 accX; // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2 s16 accY; // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2 s16 accZ; // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; u8 dev; // one of WPAD_DEV_* number s8 err; // one of WPAD_ERR_* number s16 fsAccX; // -WPAD_FS_ACC_RESO/2 <= fsAccX < WPAD_ACC_RESO/2 s16 fsAccY; // -WPAD_FS_ACC_RESO/2 <= fsAccY < WPAD_ACC_RESO/2 s16 fsAccZ; // -WPAD_FS_ACC_RESO/2 <= fsAccZ < WPAD_ACC_RESO/2 s8 fsStickX; // -WPAD_FS_STICK_RESO/2 <= fsStickX < WPAD_FS_STICK_RESO/2 s8 fsStickY; // -WPAD_FS_STICK_RESO/2 <= fsStickY < WPAD_FS_STICK_RESO/2 } WPADFSStatus; typedef struct WPADCLStatus { u16 button; // Or-ed WPAD_BUTTON_* bits s16 accX; // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2 s16 accY; // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2 s16 accZ; // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; u8 dev; // one of WPAD_DEV_* number s8 err; // one of WPAD_ERR_* number u16 clButton; // Or-ed WPAD_CL_BUTTON * bits s16 clLStickX; // -WPAD_CL_STICK_RESO/2 <= clLStickX < WPAD_CL_STICK_RESO/2 s16 clLStickY; // -WPAD_CL_STICK_RESO/2 <= clLStickY < WPAD_CL_STICK_RESO/2 s16 clRStickX; // -WPAD_CL_STICK_RESO/2 <= clRStickX < WPAD_CL_STICK_RESO/2 s16 clRStickY; // -WPAD_CL_STICK_RESO/2 <= clRStickY < WPAD_CL_STICK_RESO/2 u8 clTriggerL; // legacy: will read as 0 u8 clTriggerR; // legacy: will read as 0 } WPADCLStatus; typedef struct WPADUCStatus { u16 button; // Or-ed WPAD_BUTTON_* bits s16 accX; // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2 s16 accY; // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2 s16 accZ; // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; u8 dev; // one of WPAD_DEV_* number s8 err; // one of WPAD_ERR_* number u32 ucButton; // Or-ed WPAD_UC_BUTTON * bits s16 ucLStickX; // -WPAD_UC_STICK_RESO/2 <= ucLStickX < WPAD_UC_STICK_RESO/2 s16 ucLStickY; // -WPAD_UC_STICK_RESO/2 <= ucLStickY < WPAD_UC_STICK_RESO/2 s16 ucRStickX; // -WPAD_UC_STICK_RESO/2 <= ucRStickX < WPAD_UC_STICK_RESO/2 s16 ucRStickY; // -WPAD_UC_STICK_RESO/2 <= ucRStickY < WPAD_UC_STICK_RESO/2 BOOL charge; // URCC is charging or not BOOL cable; // URCC's charger cable is plugged or not } WPADUCStatus; typedef struct WPADCMStatus { u16 button; // Or-ed WPAD_BUTTON_* bits s16 accX; // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2 s16 accY; // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2 s16 accZ; // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; u8 dev; // one of WPAD_DEV_* number s8 err; // one of WPAD_ERR_* number u16 cmButton; // Or-ed WPAD_CM_BUTTON * bits u8 custom[WPAD_MAX_CUSTOM_BUFS];// buffer for additional data } WPADCMStatus; typedef struct WPADStatusEx { u16 button; // Or-ed WPAD_BUTTON_* bits s16 accX; // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2 s16 accY; // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2 s16 accZ; // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; u8 dev; // one of WPAD_DEV_* number s8 err; // one of WPAD_ERR_* number DPDObjEx exp[WPAD_DPD_MAX_OBJECTS]; } WPADStatusEx; typedef struct WPADMpls { f32 pitch_zero; f32 pitch_scale; f32 yaw_zero; f32 yaw_scale; f32 roll_zero; f32 roll_scale; s32 degrees; } WPADMpls; typedef struct WPADMPStatus { u16 button; // Or-ed WPAD_BUTTON_* bits s16 accX; // -WPAD_ACC_RESO/2 <= accX < WPAD_ACC_RESO/2 s16 accY; // -WPAD_ACC_RESO/2 <= accY < WPAD_ACC_RESO/2 s16 accZ; // -WPAD_ACC_RESO/2 <= accZ < WPAD_ACC_RESO/2 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; u8 dev; // one of WPAD_DEV_* number s8 err; // one of WPAD_ERR_* number union { // for nunchaku struct { s16 fsAccX; s16 fsAccY; s16 fsAccZ; s8 fsStickX; s8 fsStickY; } fs; // for classic struct { u16 clButton; s16 clLStickX; s16 clLStickY; s16 clRStickX; s16 clRStickY; u8 clTriggerL; u8 clTriggerR; } cl; } ext; u8 stat; // yaw_sel, pitch_sel, roll_sel, attach2 u8 reserved; s16 pitch; // for Wii MotionPlus s16 yaw; s16 roll; } WPADMPStatus; typedef struct WPADInfo { BOOL dpd; // the active status of pointer unit BOOL speaker; // the active status of speaker unit BOOL attach; // whether an attachment is installed (=1) or not (=0) BOOL lowBat; // whether the current battery level is lower than a threshold (0x20) BOOL nearempty; // sound buffer is nearly empty u8 battery; // the current battery level (WPAD_BATTERY_LEVEL_*) u8 led; // the current pattern of 4 LEDs u8 protocol; // not used u8 firmware; // not used } WPADInfo; typedef struct WPADAcc { s16 x; s16 y; s16 z; } WPADAcc; typedef void ( *WPADExtensionCallback )( s32 chan, s32 result ); typedef void ( *WPADSamplingCallback )( s32 chan ); typedef void ( *WPADConnectCallback )( s32 chan, s32 reason ); typedef void ( *WPADCallback )( s32 chan, s32 result ); typedef void * ( *WPADAlloc )( u32 size ); typedef u8 ( *WPADFree )( void *ptr ); typedef void ( *WPADSyncDeviceCallback )( s32 result, s32 num ); typedef void ( *WPADClearDeviceCallback )( s32 result ); typedef void ( *WPADFlushCallback )( u32 result ); #define WPADButtonDown( buttonLast, button ) \ ( (u16) (((buttonLast) ^ (button)) & (button)) ) #define WPADButtonUp( buttonLast, button ) \ ( (u16) (((buttonLast) ^ (button)) & (buttonLast)) ) #define WPADURCCButtonDown( buttonLast, button ) \ ( (u32) (((buttonLast) ^ (button)) & (button)) ) #define WPADURCCButtonUp( buttonLast, button ) \ ( (u32) (((buttonLast) ^ (button)) & (buttonLast)) ) #define WPADStartMotor( chan ) WPADControlMotor( ( chan ), WPAD_MOTOR_RUMBLE ) #define WPADStopMotor( chan ) WPADControlMotor( ( chan ), WPAD_MOTOR_STOP ) void WPADInit ( void ); void WPADShutdown ( void ); // DEPRECATED void WPADRegisterAllocator ( WPADAlloc alloc, WPADFree free ); // DEPRECATED u32 WPADGetWorkMemorySize ( void ); // DEPRECATED s32 WPADProbe ( s32 chan, u32 *type ); s32 WPADGetStatus ( void ); u32 WPADGetDataFormat ( s32 chan ); s32 WPADSetDataFormat ( s32 chan, u32 fmt ); void WPADRead ( s32 chan, void *status ); void WPADSetAutoSamplingBuf ( s32 chan, void *buf, u32 length); u32 WPADGetLatestIndexInBuf ( s32 chan ); void WPADGetAccGravityUnit ( s32 chan, u32 type, WPADAcc *acc ); void WPADGetCLTriggerThreshold ( s32 chan, u8 *left, u8 *right ); // DEPRECATED #ifdef WPADEMU void WPADClampStick ( u32 fmt, void *status ); #else void WPADClampStick ( s32 chan, void *status, u32 type ); void WPADClampTrigger ( s32 chan, void *status, u32 type ); // DEPRECATED void WPADClampAcc ( s32 chan, void *status, u32 type ); #endif BOOL WPADIsDpdEnabled ( s32 chan ); u8 WPADGetDpdFormat ( s32 chan ); s32 WPADControlDpd ( s32 chan, u32 command, WPADCallback callback ); u8 WPADGetDpdSensitivity ( void ); s32 WPADControlExtGimmick ( s32 chan, u32 command, WPADCallback callback ); void WPADDisconnect ( s32 chan ); s32 WPADGetInfo ( s32 chan, WPADInfo *info ); s32 WPADGetInfoAsync ( s32 chan, WPADInfo *info, WPADCallback callback ); void WPADGetAddress ( s32 chan, u8 *addr ); u8 WPADGetRegisteredDevNum ( void ); u8 WPADGetRadioSensitivity ( s32 chan ); u8 WPADGetBatteryLevel ( s32 chan ); BOOL WPADIsSpeakerEnabled ( s32 chan ); s32 WPADControlSpeaker ( s32 chan, u32 command, WPADCallback callback ); u8 WPADGetSpeakerVolume ( void ); s32 WPADSendStreamData ( s32 chan, void *buf, u16 len ); BOOL WPADCanSendStreamData ( s32 chan ); void WPADControlMotor ( s32 chan, u32 command ); BOOL WPADIsMotorEnabled ( void ); void WPADSetAutoSleepTime ( u8 minute ); u32 WPADGetAutoSleepTimeCount ( s32 chan ); void WPADResetAutoSleepTimeCount( s32 chan ); u8 WPADGetSensorBarPosition ( void ); void WPADEnableSensorBar ( u8 sensorBar ); // DEPRECATED void WPADSetSensorBar ( BOOL on ); void WPADSetGameTitleUtf16 ( const u16 *title ); // DEPRECATED s32 WPADGetGameTitleUtf16 ( s32 chan, const u16 **title ); // DEPRECATED s32 WPADGetGameDataTimeStamp ( s32 chan, OSTime *time ); // DEPRECATED BOOL WPADSetAcceptConnection ( BOOL accept ); // DEPRECATED - use WPADDisableBluetooth instead BOOL WPADGetAcceptConnection ( void ); // DEPRECATED BOOL WPADStartSyncDevice ( void ); BOOL WPADPurgeBtDb ( void ); // DEPRECATED BOOL WPADCancelSyncDevice ( void ); BOOL WPADIsBusyForSync ( void ); s32 WPADGetSyncType ( s32 chan, u8 *type ); // DEPRECATED WPADSamplingCallback WPADSetSamplingCallback ( s32 chan, WPADSamplingCallback callback ); WPADExtensionCallback WPADSetExtensionCallback ( s32 chan, WPADExtensionCallback callback ); WPADConnectCallback WPADSetConnectCallback ( s32 chan, WPADConnectCallback callback ); WPADSyncDeviceCallback WPADSetSyncDeviceCallback ( WPADSyncDeviceCallback callback ); WPADClearDeviceCallback WPADSetClearDeviceCallback ( WPADClearDeviceCallback callback ); // These can be used in only debug build so that application can debug extension handling BOOL WPADAttachDummyExtension( s32 chan, u32 type ); BOOL WPADDetachDummyExtension( s32 chan ); // for motion plus s8 WPADIsMplsAttached ( s32 chan, BOOL *attached, WPADCallback callback ); s8 WPADIsMplsIntegrated ( s32 chan ); BOOL WPADGetCalibrationStatus ( s32 chan ); // for URCC void WPADEnableURCC ( BOOL enable ); // for other controllers void WPADEnableWiiRemote ( BOOL enable ); // for Applications that do not support WPAD void WPADDisableBluetooth ( void ); #ifdef __cplusplus } #endif #endif // __WPAD_H__