From 3516b7ac3fd6ec6e113ef097b0fec040a2f44c1f Mon Sep 17 00:00:00 2001 From: "Daniel K. O. (dkosmari)" Date: Mon, 4 May 2026 19:43:21 -0300 Subject: [PATCH] - `KPAD_BUTTON_REPEAT` is now a macro. - Replaced snake_case vars with camelCase. - Removed leftover comment. - Fixed `WPADClearDeviceCallback` to take a `uint32_t` argument. - Fixed second argument of `WPADSyncDeviceCallback` to be uknown `uint32_t`. - Fixed return type of `WPADiControllerInfoInNand` to be `BOOL`. --- include/padscore/kpad.h | 46 +++++++++++++++++++++++------------------ include/padscore/wpad.h | 16 +++++++------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/include/padscore/kpad.h b/include/padscore/kpad.h index 34ecedac..0a0a83de 100644 --- a/include/padscore/kpad.h +++ b/include/padscore/kpad.h @@ -15,6 +15,16 @@ extern "C" { #endif +/** + * Button repeat flag. + * + * \sa + * - `KPADRead()` + * - `KPADReadEx()` + * - `KPADSetBtnRepeat()` + */ +#define KPAD_BUTTON_REPEAT 0x80000000u + //! Wii Remote channel. typedef enum WPADChan KPADChan; //! Data format. @@ -39,10 +49,6 @@ typedef enum KPADButtonProcMode KPAD_BUTTON_PROC_MODE_TIGHT = 1, } KPADButtonProcMode; -typedef enum KPADButtonRepeatType { - KPAD_BUTTON_REPEAT = 0x80000000u, -} KPADButtonRepeatType; - //! Status codes for `KPADControlDpdCallback`. typedef enum KPADControlDpdStatus { KPAD_CONTROL_DPD_STATUS_STARTED = 0, @@ -944,7 +950,7 @@ KPADGetButtonProcMode(KPADChan chan); * * \param chan The target wiimote. * \param rotation Pointer to store the rotation. - * \param dir_angle Pointer to store direction angle. + * \param dirAngle Pointer to store direction angle. * \param neutral Pointer to store the neutral radius. * * \sa @@ -955,7 +961,7 @@ KPADGetButtonProcMode(KPADChan chan); void KPADGetCrossStickEmulationParamsL(KPADChan chan, float *rotation, - float *dir_angle, + float *dirAngle, float *neutral); /** @@ -963,7 +969,7 @@ KPADGetCrossStickEmulationParamsL(KPADChan chan, * * \param chan The target wiimote. * \param rotation Pointer to store the rotation. - * \param dir_angle Pointer to store the direction angle. + * \param dirAngle Pointer to store the direction angle. * \param neutral Pointer to store the neutral radius. * * \sa @@ -974,7 +980,7 @@ KPADGetCrossStickEmulationParamsL(KPADChan chan, void KPADGetCrossStickEmulationParamsR(KPADChan chan, float *rotation, - float *dir_angle, + float *dirAngle, float *neutral); /** @@ -1146,7 +1152,7 @@ KPADGetPosPlayMode(KPADChan chan); * \param dst Pointer to store the calculated position. * \param src Pointer to the normalized (between -1 and 1) source point. * \param screen Pointer to a rectangle representing the screen boundary. - * \param pixel_ratio Correction factor for pixel ratio (1.0f for square pixels). + * \param pixelRatio Correction factor for pixel ratio (1.0f for square pixels). * * \sa * - `KPADDisableAimingMode()` @@ -1158,7 +1164,7 @@ void KPADGetProjectionPos(KPADVec2D *dst, const KPADVec2D *src, const KPADRect *screen, - float pixel_ratio); + float pixelRatio); /** * Gets the pitch angle offset for the Nunchuk's orientation. @@ -1439,7 +1445,7 @@ KPADSetControlDpdCallback(KPADChan chan, * * \param chan The target wiimote. * \param rotation The rotation parameter, in degrees. - * \param dir_angle The direction angle parameter, as degrees, in `[0, 90]`. + * \param dirAngle The direction angle parameter, as degrees, in `[0, 90]`. * \param neutral The neutral radius parameter, in `[0, 1]`. * * \sa @@ -1450,7 +1456,7 @@ KPADSetControlDpdCallback(KPADChan chan, void KPADSetCrossStickEmulationParamsL(KPADChan chan, float rotation, - float dir_angle, + float dirAngle, float neutral); /** @@ -1458,7 +1464,7 @@ KPADSetCrossStickEmulationParamsL(KPADChan chan, * * \param chan The target wiimote. * \param rotation The rotation parameter, in degrees. - * \param dir_angle The direction angle parameter, as degrees, in `[0, 90]`. + * \param dirAngle The direction angle parameter, as degrees, in `[0, 90]`. * \param neutral The neutral radius parameter, in `[0, 1]`. * * \sa @@ -1469,7 +1475,7 @@ KPADSetCrossStickEmulationParamsL(KPADChan chan, void KPADSetCrossStickEmulationParamsR(KPADChan chan, float rotation, - float dir_angle, + float dirAngle, float neutral); /** @@ -1647,15 +1653,15 @@ KPADSetMplsDpdReviseParam(KPADChan chan, * Sets the MotionPlus angular speed scales. * * \param chan The target wiimote. - * \param scale_pitch Scale applied to the pitch speed. - * \param scale_yaw Scale applied to the yaw speed. - * \param scale_roll Scale applied to the roll speed. + * \param scalePitch Scale applied to the pitch speed. + * \param scaleYaw Scale applied to the yaw speed. + * \param scaleRoll Scale applied to the roll speed. */ void KPADSetMplsMagnification(KPADChan chan, - float scale_pitch, - float scale_yaw, - float scale_roll); + float scalePitch, + float scaleYaw, + float scaleRoll); /** * Sets the MotionPlus zero drift mode. diff --git a/include/padscore/wpad.h b/include/padscore/wpad.h index af78e85e..0a2265f1 100644 --- a/include/padscore/wpad.h +++ b/include/padscore/wpad.h @@ -777,7 +777,7 @@ struct WPADiMplsCalibration { float rollZero; float rollScale; - int32_t degrees; // size 0x04, offset 0x18 + int32_t degrees; }; WUT_CHECK_OFFSET(WPADiMplsCalibration, 0x00, pitchZero); WUT_CHECK_OFFSET(WPADiMplsCalibration, 0x04, pitchScale); @@ -807,9 +807,9 @@ typedef void (*WPADSamplingCallback)(WPADChan channel); */ typedef void (*WPADExtensionCallback)(WPADChan channel, WPADExtensionType ext); -typedef void (*WPADClearDeviceCallback)(void*); +typedef void (*WPADClearDeviceCallback)(uint32_t status); -typedef void (*WPADSyncDeviceCallback)(WPADSyncDeviceEvent event, WPADChan chan); +typedef void (*WPADSyncDeviceCallback)(WPADSyncDeviceEvent event, uint32_t unk); /** * Initializes the WPAD library for use. @@ -1665,9 +1665,9 @@ WPADGetWorkMemorySize(void); void WPADiClearMemBlock(WPADChan chan, - void *wiimote_context); + void *wiimoteContext); -void +BOOL WPADiControllerInfoInNand(void); void @@ -1735,8 +1735,8 @@ void WPADRecalibrate(WPADChan chan); void -WPADRegisterAllocator(const void *alloc_func, - const void *free_func); +WPADRegisterAllocator(const void *allocFunc, + const void *freeFunc); void WPADRegisterBLCWorkarea(void); @@ -1747,7 +1747,7 @@ WPADResetAutoSleepTimeCount(WPADChan chan); void WPADRestoreDpdData(uint32_t unknown1, uint32_t unknown2, - BOOL ir_enabled, + BOOL irEnabled, WPADChan chan); void