Skip to content

Commit b38d014

Browse files
padscore: Add missing functions for 7-controller mode
1 parent 31943d2 commit b38d014

2 files changed

Lines changed: 56 additions & 2 deletions

File tree

include/padscore/kpad.h

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ WUT_CHECK_OFFSET(KPADStatus, 0x7C, pro.charging);
215215
WUT_CHECK_OFFSET(KPADStatus, 0x80, pro.wired);
216216
WUT_CHECK_SIZE(KPADStatus, 0xF0);
217217

218+
typedef WPADConnectCallback KPADConnectCallback;
219+
218220
/**
219221
* Initialises the KPAD library for use.
220222
*/
@@ -228,7 +230,7 @@ void
228230
KPADShutdown();
229231

230232
/**
231-
* Read data from the desired Wii Remote.
233+
* Read data from the desired controller.
232234
*
233235
* \param chan
234236
* The channel of the controller to read from.
@@ -248,7 +250,7 @@ KPADRead(KPADChan chan,
248250
uint32_t size);
249251

250252
/**
251-
* Read data from the desired Wii Remote.
253+
* Read data from the desired controller.
252254
*
253255
* \param chan
254256
* The channel of the controller to read from.
@@ -271,6 +273,52 @@ KPADReadEx(KPADChan chan,
271273
uint32_t size,
272274
KPADError *error);
273275

276+
/**
277+
* Set the maximum amount of controllers which can be connected to the system.
278+
*
279+
* \param maxControllers
280+
* The maximum amount of controllers. Must be \c 4 or \c 7.
281+
*
282+
* \return
283+
* 0 on success.
284+
*/
285+
int32_t
286+
KPADSetMaxControllers(uint32_t maxControllers);
287+
288+
/**
289+
* Get the maximum amount of controllers which can be connected to the system.
290+
*
291+
* \return
292+
* The maximum amount of controllers.
293+
*/
294+
uint32_t
295+
KPADGetMaxControllers(void);
296+
297+
/**
298+
* Get the maximum amount of controllers which can be connected, as reported by IOS-PAD.
299+
*
300+
* \return
301+
* The maximum amount of controllers.
302+
*/
303+
uint32_t
304+
KPADGetGameMaxControllers(void);
305+
306+
/**
307+
* Set a callback for when a controller connection status changes.
308+
*
309+
* \param chan
310+
* The channel of the controller to set a callback for.
311+
*
312+
* \param callback
313+
* Pointer to a callback function.
314+
*
315+
* \return
316+
* The previous connect callback.
317+
*/
318+
KPADConnectCallback
319+
KPADSetConnectCallback(KPADChan chan,
320+
KPADConnectCallback callback);
321+
274322
#ifdef __cplusplus
275323
}
276324
#endif

include/padscore/wpad.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ typedef enum WPADChan
2727
WPAD_CHAN_2 = 2,
2828
//! Channel 3.
2929
WPAD_CHAN_3 = 3,
30+
//! Channel 4.
31+
WPAD_CHAN_4 = 4,
32+
//! Channel 5.
33+
WPAD_CHAN_5 = 5,
34+
//! Channel 6.
35+
WPAD_CHAN_6 = 6,
3036
} WPADChan;
3137

3238
//! Data format.

0 commit comments

Comments
 (0)