From 2ae085d528163284e323622384d35e3a783df08b Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Wed, 24 Feb 2021 02:24:41 -0500 Subject: [PATCH] Add definitions Added: * VPADDisablePowerButton * VPADEnablePowerButton * VPADBASEGetHeadphoneStatus * VPADBASEGetGameControllerMode * VPADBASESetGameControllerMode * VPADBASEGetPowerButtonPressStatus * VPADBASESetPowerButtonPressStatus * VPADBASESetPowerButtonDisableMode --- include/coreinit/time.h | 10 +++ include/vpad/input.h | 132 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) diff --git a/include/coreinit/time.h b/include/coreinit/time.h index 051d970..d591597 100644 --- a/include/coreinit/time.h +++ b/include/coreinit/time.h @@ -20,15 +20,25 @@ typedef int64_t OSTime; //! Same as std c struct tm but with msec and usec added. struct OSCalendarTime { + //! Seconds after the minute. The range is 0-59. int32_t tm_sec; + //! Minutes after the hour. The range is 0-59. int32_t tm_min; + //! Hours since midnight. The range is 0-23. int32_t tm_hour; + //! Day of the month. The range is 1-31. int32_t tm_mday; + //! Month since January. The range is 0-11. int32_t tm_mon; + //! Years in AD. The range is 1-.... int32_t tm_year; + //! Days since Sunday. The range is 0-6. int32_t tm_wday; + //! Days since January 1. The range is 0-365. int32_t tm_yday; + //! Milliseconds after the second. The range is 0-999. int32_t tm_msec; + //! Microseconds after the millisecond. The range is 0-999. int32_t tm_usec; }; WUT_CHECK_OFFSET(OSCalendarTime, 0x00, tm_sec); diff --git a/include/vpad/input.h b/include/vpad/input.h index 3641a71..9d1a894 100644 --- a/include/vpad/input.h +++ b/include/vpad/input.h @@ -737,6 +737,32 @@ void VPADSetTVMenuInvalid(VPADChan chan, BOOL invalid); +/** + * Disable the power button. + * + * \note + * Retail Wii U systems have a single Gamepad on \link VPADChan::VPAD_CHAN_0 + * VPAD_CHAN_0. \endlink + * + * \param chan + * The channel of the Gamepad to disable the power button from. + */ +void +VPADDisablePowerButton(VPADChan chan); + +/** + * Enable the power button. + * + * \note + * Retail Wii U systems have a single Gamepad on \link VPADChan::VPAD_CHAN_0 + * VPAD_CHAN_0. \endlink + * + * \param chan + * The channel of the Gamepad to enable the power button from. + */ +void +VPADEnablePowerButton(VPADChan chan); + /** * Turns on the rumble motor on the desired Gamepad. * A custom rumble pattern can be set by setting bytes in the input buffer. @@ -828,6 +854,112 @@ void VPADBASEGetSensorBarSetting(VPADChan chan, int8_t *outSetting); +/** + * Get the headphone status. + * + * \note + * Retail Wii U systems have a single Gamepad on \link VPADChan::VPAD_CHAN_0 + * VPAD_CHAN_0. \endlink + * + * \param chan + * The channel of the Gamepad to get the headphone status from. + * + * \returns + * Returns 1 if headphones are connected, 0 otherwise. + */ +int32_t +VPADBASEGetHeadphoneStatus(VPADChan chan); + +/** + * Get the controller mode. + * + * \note + * Retail Wii U systems have a single Gamepad on \link VPADChan::VPAD_CHAN_0 + * VPAD_CHAN_0. \endlink + * + * \param chan + * The channel of the Gamepad to get the controller mode from. + * + * \param mode + * Pointer to write a value of the controller mode into. + */ +void +VPADBASEGetGameControllerMode(VPADChan chan, + int32_t* mode); + +/** + * Set the controller mode. + * + * \note + * Retail Wii U systems have a single Gamepad on \link VPADChan::VPAD_CHAN_0 + * VPAD_CHAN_0. \endlink + * + * \param chan + * The channel of the Gamepad to set the controller mode to. + * + * \param mode + * Any non-zero mode will turn off the display, like the "Display Off" button under Controller Settings. + * Inputs are not disabled. + */ +void +VPADBASESetGameControllerMode(VPADChan chan, + int32_t mode); + +/** + * Get the POWER button press status. + * + * \note + * Retail Wii U systems have a single Gamepad on \link VPADChan::VPAD_CHAN_0 + * VPAD_CHAN_0. \endlink + * + * \param chan + * The channel of the Gamepad to get the POWER button press status from. + * + * \param tick + * The value given by \link OSGetTick \endlink when the button was pressed. + * + * \param status + * The status is set to 0 if the POWER button is not pressed. + */ +void +VPADBASEGetPowerButtonPressStatus(VPADChan chan, + uint32_t* tick, + uint32_t *status); + +/** + * Set the POWER button press status. + * + * \param chan + * The channel of the Gamepad to set the POWER button press status to. + * + * \param tick + * The tick value to set. + * + * \param status + * The status to set. + */ +void +VPADBASESetPowerButtonPressStatus(VPADChan chan, + uint32_t tick, + uint32_t status); + +/** + * Set the POWER button mode. + * + * \param chan + * The channel of the Gamepad to set the POWER button disable mode to. + * + * \param mode + * Set to 0 to enable and set to 1 to disable. + * + * \sa + * - \link VPADDisablePowerButton \endlink + * - \link VPADEnablePowerButton \endlink + */ +void +VPADBASESetPowerButtonDisableMode(VPADChan chan, + uint32_t mode); + /** * Turn the given Gamepad's sensor bar on or off. Enabling the sensor bar allows * any Wii Remote to position itself relative to the GamePad.