summaryrefslogtreecommitdiff
path: root/include/user/ctrl.h
diff options
context:
space:
mode:
authorRinnegatamante2017-06-15 11:36:33 +0200
committerSunguk Lee2017-06-15 18:36:33 +0900
commitb5646d6867a3c279e0a7f5b3db42678f84d7ff15 (patch)
treeb625c863cf3657b5901523e438bddb8330c10a74 /include/user/ctrl.h
parentRemoved next entry (diff)
downloadvds-libraries-b5646d6867a3c279e0a7f5b3db42678f84d7ff15.tar.gz
Named anonymous enums in psp2. (#179)
* Named anonymous enums in psp2. Named anonymous enums in psp2. * Properly sorted enums. * Several modifications (see desc) Added some missing info, fixed identation in some places, aligned all enums and comments with spaces as delimiters, replaced decimal negative errorcode in location.h with hexadecimal one, added some comments and fixed some documentation comments. * Minor fixes in identation. * Yet another minor identation fix. * Fixed enums in structs. * Reverted SceBool changes. * SceBool fix. * Fix for compilation with g++- * Added some doc references in jpegenc. * Fixed some references.
Diffstat (limited to 'include/user/ctrl.h')
-rw-r--r--include/user/ctrl.h84
1 files changed, 42 insertions, 42 deletions
diff --git a/include/user/ctrl.h b/include/user/ctrl.h
index f8f5679..38a0d8a 100644
--- a/include/user/ctrl.h
+++ b/include/user/ctrl.h
@@ -8,60 +8,60 @@
extern "C" {
#endif
-enum {
- SCE_CTRL_ERROR_INVALID_ARG = 0x80340001,
- SCE_CTRL_ERROR_PRIV_REQUIRED = 0x80340002,
- SCE_CTRL_ERROR_FATAL = 0x803400FF
-};
+typedef enum SceCtrlErrorCode {
+ SCE_CTRL_ERROR_INVALID_ARG = 0x80340001,
+ SCE_CTRL_ERROR_PRIV_REQUIRED = 0x80340002,
+ SCE_CTRL_ERROR_FATAL = 0x803400FF
+} SceCtrlErrorCode;
/** Enumeration for the digital controller buttons.
* L1/R1/L3/R3 only can bind using sceCtrlReadBufferPositiveExt2 */
-enum SceCtrlPadButtons {
- SCE_CTRL_SELECT = 0x000001, //!< Select button.
- SCE_CTRL_L3 = 0x000002, //!< L3 button.
- SCE_CTRL_R3 = 0x000004, //!< R3 button.
- SCE_CTRL_START = 0x000008, //!< Start button.
- SCE_CTRL_UP = 0x000010, //!< Up D-Pad button.
- SCE_CTRL_RIGHT = 0x000020, //!< Right D-Pad button.
- SCE_CTRL_DOWN = 0x000040, //!< Down D-Pad button.
- SCE_CTRL_LEFT = 0x000080, //!< Left D-Pad button.
- SCE_CTRL_LTRIGGER = 0x000100, //!< Left trigger.
- SCE_CTRL_RTRIGGER = 0x000200, //!< Right trigger.
- SCE_CTRL_L1 = 0x000400, //!< L1 button.
- SCE_CTRL_R1 = 0x000800, //!< R1 button.
- SCE_CTRL_TRIANGLE = 0x001000, //!< Triangle button.
- SCE_CTRL_CIRCLE = 0x002000, //!< Circle button.
- SCE_CTRL_CROSS = 0x004000, //!< Cross button.
- SCE_CTRL_SQUARE = 0x008000, //!< Square button.
- SCE_CTRL_INTERCEPTED = 0x010000, //!< Input not available because intercepted by another application
- SCE_CTRL_VOLUP = 0x100000, //!< Volume up button.
- SCE_CTRL_VOLDOWN = 0x200000 //!< Volume down button.
-};
+typedef enum SceCtrlButtons {
+ SCE_CTRL_SELECT = 0x000001, //!< Select button.
+ SCE_CTRL_L3 = 0x000002, //!< L3 button.
+ SCE_CTRL_R3 = 0x000004, //!< R3 button.
+ SCE_CTRL_START = 0x000008, //!< Start button.
+ SCE_CTRL_UP = 0x000010, //!< Up D-Pad button.
+ SCE_CTRL_RIGHT = 0x000020, //!< Right D-Pad button.
+ SCE_CTRL_DOWN = 0x000040, //!< Down D-Pad button.
+ SCE_CTRL_LEFT = 0x000080, //!< Left D-Pad button.
+ SCE_CTRL_LTRIGGER = 0x000100, //!< Left trigger.
+ SCE_CTRL_RTRIGGER = 0x000200, //!< Right trigger.
+ SCE_CTRL_L1 = 0x000400, //!< L1 button.
+ SCE_CTRL_R1 = 0x000800, //!< R1 button.
+ SCE_CTRL_TRIANGLE = 0x001000, //!< Triangle button.
+ SCE_CTRL_CIRCLE = 0x002000, //!< Circle button.
+ SCE_CTRL_CROSS = 0x004000, //!< Cross button.
+ SCE_CTRL_SQUARE = 0x008000, //!< Square button.
+ SCE_CTRL_INTERCEPTED = 0x010000, //!< Input not available because intercepted by another application
+ SCE_CTRL_VOLUP = 0x100000, //!< Volume up button.
+ SCE_CTRL_VOLDOWN = 0x200000 //!< Volume down button.
+} SceCtrlButtons;
/** Enumeration for the controller types. */
-enum SceCtrlExternalInputMode {
- SCE_CTRL_TYPE_UNPAIRED = 0,
+typedef enum SceCtrlExternalInputMode {
+ SCE_CTRL_TYPE_UNPAIRED = 0, //!< Unpaired controller
SCE_CTRL_TYPE_PHY = 1, //!< Physical controller for VITA
SCE_CTRL_TYPE_VIRT = 2, //!< Virtual controller for PSTV
SCE_CTRL_TYPE_DS3 = 4, //!< DualShock 3
SCE_CTRL_TYPE_DS4 = 8 //!< DualShock 4
-};
+} SceCtrlExternalInputMode;
/** Controller mode. */
-enum SceCtrlPadInputMode {
+typedef enum SceCtrlPadInputMode {
/** Digital buttons only. */
- SCE_CTRL_MODE_DIGITAL = 0,
+ SCE_CTRL_MODE_DIGITAL = 0,
/** Digital buttons + Analog support. */
- SCE_CTRL_MODE_ANALOG = 1,
+ SCE_CTRL_MODE_ANALOG = 1,
/** Same as ::SCE_CTRL_MODE_ANALOG, but with larger range for analog sticks. */
SCE_CTRL_MODE_ANALOG_WIDE = 2
-};
+} SceCtrlPadInputMode;
/** Returned controller data */
typedef struct SceCtrlData {
/** The current read frame. */
uint64_t timeStamp;
- /** Bit mask containing zero or more of ::CtrlButtons. */
+ /** Bit mask containing zero or more of ::SceCtrlButtons. */
unsigned int buttons;
/** Left analogue stick, X axis. */
unsigned char lx;
@@ -95,41 +95,41 @@ typedef struct SceCtrlRapidFireRule {
typedef struct SceCtrlActuator {
unsigned char small; //!< Vibration strength of the small motor
unsigned char large; //!< Vibration strength of the large motor
- uint8_t unk[6]; //!< Unknown
+ uint8_t unk[6]; //!< Unknown
} SceCtrlActuator;
/** Structure to pass as argument to ::sceCtrlGetControllerPortInfo */
typedef struct SceCtrlPortInfo {
- uint8_t port[5]; //!< Controller type of each ports
+ uint8_t port[5]; //!< Controller type of each port (See ::SceCtrlExternalInputMode)
uint8_t unk[11]; //!< Unknown
} SceCtrlPortInfo;
/**
* Set the controller mode.
*
- * @param[in] mode - One of ::CtrlMode.
+ * @param[in] mode - One of ::SceCtrlPadInputMode.
*
* @return The previous mode, <0 on error.
*/
-int sceCtrlSetSamplingMode(int mode);
+int sceCtrlSetSamplingMode(SceCtrlPadInputMode mode);
/**
* Set the controller extend mode.
*
- * @param[in] mode - One of ::CtrlMode.
+ * @param[in] mode - One of ::SceCtrlPadInputMode.
*
* @return The previous mode, <0 on error.
*/
-int sceCtrlSetSamplingModeExt(int mode);
+int sceCtrlSetSamplingModeExt(SceCtrlPadInputMode mode);
/**
* Get the current controller mode.
*
- * @param[out] pMode - Return value, see ::CtrlMode.
+ * @param[out] pMode - Return value, see ::SceCtrlPadInputMode.
*
* @return The current mode, <0 on error.
*/
-int sceCtrlGetSamplingMode(int *pMode);
+int sceCtrlGetSamplingMode(SceCtrlPadInputMode *pMode);
/**
* Get the controller state information (polling, positive logic).