diff --git a/src/ctrl.rs b/src/ctrl.rs index 7c3550b..b668fec 100644 --- a/src/ctrl.rs +++ b/src/ctrl.rs @@ -16,11 +16,11 @@ pub enum SceCtrlErrorCode { /// Enumeration for the digital controller buttons. /// /// Notes : -/// > L1/R1/L3/R3 only can bind using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2 +/// > L1/R1/L3/R3 only can bind using [sceCtrlPeekBufferPositiveExt2](crate::ctrl::sceCtrlPeekBufferPositiveExt2) and [sceCtrlReadBufferPositiveExt2](crate::ctrl::sceCtrlReadBufferPositiveExt2) /// /// > Values bigger than 0x00010000 can be intercepted only with shell privileges /// -/// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using ::sceCtrlPeekBufferPositiveExt2 and ::sceCtrlReadBufferPositiveExt2 +/// > Vita's L Trigger and R Trigger are mapped to L1 and R1 when using [sceCtrlPeekBufferPositiveExt2](crate::ctrl::sceCtrlPeekBufferPositiveExt2) and [sceCtrlReadBufferPositiveExt2](crate::ctrl::sceCtrlReadBufferPositiveExt2) #[repr(C)] pub enum SceCtrlButtons { /// Select button. @@ -102,7 +102,7 @@ pub enum SceCtrlPadInputMode { SCE_CTRL_MODE_DIGITAL = 0, /// Digital buttons + Analog support. SCE_CTRL_MODE_ANALOG = 1, - /// Same as ::SCE_CTRL_MODE_ANALOG, but with larger range for analog sticks. + /// Same as [SCE_CTRL_MODE_ANALOG](crate::ctrl::SceCtrlPadInputMode::SCE_CTRL_MODE_ANALOG), but with larger range for analog sticks. SCE_CTRL_MODE_ANALOG_WIDE = 2, } @@ -111,7 +111,7 @@ pub enum SceCtrlPadInputMode { pub struct SceCtrlData { /// The current read frame. pub timeStamp: u64, - /// Bit mask containing zero or more of ::SceCtrlButtons. + /// Bit mask containing zero or more of [SceCtrlButtons]. pub buttons: u32, /// Left analogue stick, X axis. pub lx: u8, @@ -149,7 +149,7 @@ pub struct SceCtrlData { _reserved: [u8; 4], } -/// Structure to pass as argument to ::sceCtrlSetRapidFire +/// Structure to pass as argument to [sceCtrlSetRapidFire] #[repr(C)] pub struct SceCtrlRapidFireRule { pub Mask: u32, @@ -160,7 +160,7 @@ pub struct SceCtrlRapidFireRule { pub Break: u32, } -/// Structure to pass as argument to ::sceCtrlSetActuator +/// Structure to pass as argument to [sceCtrlSetActuator] #[repr(C)] pub struct SceCtrlActuator { /// Vibration strength of the small motor @@ -171,10 +171,10 @@ pub struct SceCtrlActuator { unk: [u8; 6], } -/// Structure to pass as argument to ::sceCtrlGetControllerPortInfo +/// Structure to pass as argument to [sceCtrlGetControllerPortInfo] #[repr(C)] pub struct SceCtrlPortInfo { - /// Controller type of each port (See ::SceCtrlExternalInputMode) + /// Controller type of each port (See [SceCtrlExternalInputMode]) pub port: [u8; 5], /// Unknown unk: [u8; 11], @@ -182,37 +182,37 @@ pub struct SceCtrlPortInfo { #[cfg_attr(not(feature = "dox"), link(kind = "static", name = "SceCtrl_stub"))] extern "C" { - /// Set the controller mode. + /// Set the controller mode /// - /// * `mode` - One of ::SceCtrlPadInputMode. + /// * `mode` - One of [SceCtrlPadInputMode]. /// /// Returns he previous mode, < 0 on error. pub fn sceCtrlSetSamplingMode( mode: SceCtrlPadInputMode ) -> i32; - /// Set the controller extend mode. + /// Set the controller extend mode /// - /// * `mode` - One of ::SceCtrlPadInputMode. + /// * `mode` - One of [SceCtrlPadInputMode]. /// /// Returns the previous mode, < 0 on error. pub fn sceCtrlSetSamplingModeExt( mode: SceCtrlPadInputMode ) -> i32; - /// Get the current controller mode. + /// Get the current controller mode /// - /// * `pMode` (out) - Return value, see ::SceCtrlPadInputMode. + /// * `pMode` (out) - Return value, see [SceCtrlPadInputMode]. /// /// Returns the previous mode, < 0 on error. pub fn sceCtrlGetSamplingMode( pMode: *mut SceCtrlPadInputMode ) -> i32; - /// Get the controller state information (polling, positive logic). + /// Get the controller state information (polling, positive logic) /// /// * `port` - use 0. - /// * `*pad_data` (out) - see ::SceCtrlData. + /// * `*pad_data` (out) - see [SceCtrlData]. /// * `count` - Buffers count. Up to 64 buffers can be requested. /// /// Returns buffers count, between 1 and 'count'. < 0 on error. @@ -222,12 +222,12 @@ extern "C" { count: i32 ) -> i32; - /// Get the controller state information (polling, positive logic). + /// Get the controller state information (polling, positive logic) /// - /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER + /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER. /// /// * `port` - use 0. - /// * `*pad_data` (out) - see ::SceCtrlData. + /// * `*pad_data` (out) - see [SceCtrlData]. /// * `count` - Buffers count. Up to 64 buffers can be requested. /// /// Returns buffers count, between 1 and 'count'. < 0 on error. @@ -237,10 +237,10 @@ extern "C" { count: i32 ) -> i32; - /// Get the controller state information (polling, negative logic). + /// Get the controller state information (polling, negative logic) /// /// * `port` - use 0. - /// * `*pad_data` (out) - see ::SceCtrlData. + /// * `*pad_data` (out) - see [SceCtrlData]. /// * `count` - Buffers count. Up to 64 buffers can be requested. /// /// Returns buffers count, between 1 and 'count'. < 0 on error. @@ -250,10 +250,10 @@ extern "C" { count: i32 ) -> i32; - /// Get the controller state information (blocking, positive logic). + /// Get the controller state information (blocking, positive logic) /// /// * `port` - use 0. - /// * `*pad_data` (out) - see ::SceCtrlData. + /// * `*pad_data` (out) - see [SceCtrlData]. /// * `count` - Buffers count. Up to 64 buffers can be requested. /// /// Returns buffers count, between 1 and 'count'. < 0 on error. @@ -263,12 +263,12 @@ extern "C" { count: i32 ) -> i32; - /// Get the controller extended state information (blocking, positive logic). + /// Get the controller extended state information (blocking, positive logic) /// - /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER + /// This function will bind L/R trigger value to L1/R1 instead of LTRIGGER/RTRIGGER. /// /// * `port` - use 0. - /// * `*pad_data` (out) - see ::SceCtrlData. + /// * `*pad_data` (out) - see [SceCtrlData]. /// * `count` - Buffers count. Up to 64 buffers can be requested. /// /// Returns buffers count, between 1 and 'count'. < 0 on error. @@ -278,10 +278,10 @@ extern "C" { count: i32 ) -> i32; - /// Get the controller state information (blocking, negative logic). + /// Get the controller state information (blocking, negative logic) /// /// * `port` - use 0. - /// * `*pad_data` (out) - see ::SceCtrlData. + /// * `*pad_data` (out) - see [SceCtrlData]. /// * `count` - Buffers count. Up to 64 buffers can be requested. /// /// Returns buffers count, between 1 and 'count'. < 0 on error. @@ -291,11 +291,11 @@ extern "C" { count: i32 ) -> i32; - /// Set rules for button rapid fire. + /// Set rules for button rapid fire /// /// * `port` - use 0. - /// * `idx` - rule index between 0-15 - /// * `pRule` - structure ::SceCtrlRapidFireRule. + /// * `idx` - rule index between 0-15. + /// * `pRule` - structure [SceCtrlRapidFireRule]. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlSetRapidFire( @@ -304,10 +304,10 @@ extern "C" { pRule: *const SceCtrlRapidFireRule ); - /// Clear rules for button rapid fire. + /// Clear rules for button rapid fire /// /// * `port` - use 0. - /// * `idx` - rule index between 0-15 + /// * `idx` - rule index between 0-15. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlClearRapidFire( @@ -315,10 +315,10 @@ extern "C" { idx: i32 ) -> i32; - /// Control the actuator (vibrate) on paired controllers. + /// Control the actuator (vibrate) on paired controllers /// /// * `port` - use 1 for the first paired controller, etc. - /// * `state` - see ::SceCtrlActuator + /// * `state` - see [SceCtrlActuator]. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlSetActuator( @@ -326,12 +326,12 @@ extern "C" { pState: *const SceCtrlActuator ) -> i32; - /// Control the light bar on paired controllers. + /// Control the light bar on paired controllers /// /// * `port` - use 1 for the first paired controller, etc. - /// * `r` - red intensity - /// * `g` - green intensity - /// * `b` - blue intensity + /// * `r` - red intensity. + /// * `g` - green intensity. + /// * `b` - blue intensity. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlSetLightBar( @@ -343,17 +343,17 @@ extern "C" { /// Get controller port information. /// - /// * `info` (out) - see ::SceCtrlPortInfo + /// * `info` (out) - see [SceCtrlPortInfo]. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlGetControllerPortInfo( info: *mut SceCtrlPortInfo ) -> i32; - /// Get controller battery information. + /// Get controller battery information /// /// * `port` - use 1 for the first paired controller, etc. - /// * `batt` (out) - battery level, between 0-5, 0xEE charging, 0xEF charged + /// * `batt` (out) - battery level, between 0-5, 0xEE charging, 0xEF charged. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlGetBatteryInfo( @@ -361,30 +361,30 @@ extern "C" { batt: *mut SceUInt8 ) -> i32; - /// Sets intercept. + /// Sets intercept /// - /// If true, allows the current thread to intercept controls. The use case - /// might be, for example, a game plugin that wishes to capture input without - /// having the input sent to the game thread. + /// If true, allows the current thread to intercept controls. + /// The use case might be, for example, a game plugin that wishes to + /// capture input without having the input sent to the game thread. /// - /// * `intercept` - Boolean value + /// * `intercept` - Boolean value. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlSetButtonIntercept( intercept: i32 ) -> i32; - /// Gets intercept. + /// Gets intercept /// - /// * `intercept` (out) - Boolean value + /// * `intercept` (out) - Boolean value. /// /// Returns 0 on success, < 0 on error. pub fn sceCtrlGetButtonIntercept( intercept: *mut i32 ) -> i32; - /// Check if multi controller is supported. + /// Check if multi controller is supported /// - /// Returns 1 if yes, 0 if no + /// Returns 1 if yes, 0 if no. pub fn sceCtrlIsMultiControllerSupported() -> i32; } diff --git a/src/display.rs b/src/display.rs index 6404526..e4f0bfd 100644 --- a/src/display.rs +++ b/src/display.rs @@ -34,22 +34,22 @@ pub enum SceDisplaySetBufSync { SCE_DISPLAY_SETBUF_NEXTFRAME = 1, } -/// Structure used with ::sceDisplaySetFrameBuf to set/update +/// Structure used with [sceDisplaySetFrameBuf] to set/update /// framebuffer /// /// Original screen resolution is 960x544, but the following resolutions can also /// be supplied as width and height : 480x272, 640x368, 720x408 /// -/// > Note: This structure is returned by ::sceDisplayGetFrameBuf +/// > Note: This structure is returned by [sceDisplayGetFrameBuf] #[repr(C)] pub struct SceDisplayFrameBuf { - /// sizeof(SceDisplayFrameBuf) + /// sizeof([SceDisplayFrameBuf]) pub size: SceSize, /// Pointer to framebuffer pub base: *mut crate::void, /// Pitch pixels pub pitch: u32, - /// Pixel format (one of ::SceDisplayPixelFormat) + /// Pixel format (one of [SceDisplayPixelFormat]) pub pixelformat: u32, /// Framebuffer width pub width: u32, @@ -64,9 +64,9 @@ pub struct SceDisplayFrameBuf { extern "C" { /// Set/Update framebuffer parameters /// - /// * `pParam` (out) - Pointer to a ::SceDisplayFrameBuf + /// * `pParam` (out) - Pointer to a [SceDisplayFrameBuf] /// structure - /// * `sync` - One of ::SceDisplaySetBufSync + /// * `sync` - One of [SceDisplaySetBufSync] /// /// Returns 0 on success, < 0 on error /// @@ -78,9 +78,9 @@ extern "C" { /// Get current framebuffer parameters /// - /// * `pParam` (out) - Pointer to a ::SceDisplayFrameBuf + /// * `pParam` (out) - Pointer to a [SceDisplayFrameBuf] /// structure which will receive framebuffer parameters - /// * `sync` - One of ::SceDisplaySetBufSync + /// * `sync` - One of [SceDisplaySetBufSync] /// /// Returns 0 on success, < 0 on error pub fn sceDisplayGetFrameBuf(