This manual was written to support UI Tool Version 3 and UI Tool Version 4.
The KPAD library is a high-level library located in the upper part of the WPAD library. In contrast to using the WPAD library directly, the KPAD library can obtain coordinates where the Wii Remote is pointing more easily. It also provides features such as reducing the effects of hand tremor and adjusting the sensitivity of the Wii Remote. Not only can controller data for the Wii Remote Control be obtained, but controller data can also be obtained for a Nunchuk and the Nintendo GameCube standard controller.
Samples are provided to test the functionality of the KPAD library in $(REVOLUTION_SDK_ROOT)/build/demos/kpaddemo/ (for UI Tool Version 4) and in $(REVOLUTION_SDK_ROOT)/build/demos/kpadEmudemo/ (for UI Tool Version 3). When using these samples, we recommend placing the Wii Remote Control and the Sensor Bar at least 1.5 meters apart (the samples may not function well at a distance of 1.0 meter).
The KPAD library is in the following path.
$(REVOLUTION_SDK_ROOT)/RVL[0]/lib/kpad[D].a (for UI Tool Version 4)
$(REVOLUTION_SDK_ROOT)/RVL[0]/lib/kpadEmu[D].a (for UI Tool Version 3)
API functions declarations are in the $(REVOLUTION_SDK_ROOT)/include/revolution/kpad.h header file.
Initialization of the KPAD library occurs by calling the KPADInit function. For the KPAD library corresponding to UI Tool Version 4, WPADRegisterAllocator must be called to register the allocator function used to allocate and deallocate memory for the WPAD library prior to calling KPADInit. After the KPAD library is initialized, it uses its autosampling feature to obtain data and update its internal buffer.
Using the KPADRead function, the specified channel's controller information is read into a KPADStatus structure. When adjusting the Wii Remote Control reaction and the hand tremor reduction level, use KPADSetPosParam, KPADSetHoriParam, KPADSetDistParam, or KPADSetAccParam. These functions can adjust the controller status obtained with KPADRead.
In some cases, it might be effective to call the KPADReset function, such as during a change in scenes.
The coordinate system of the coordinates obtained with the KPAD library is different from that used in the WPAD library. For details, see the KPADStatus and KPADEXStatus structure pages.
KPADRead function is designed to be called once per game frame. However, if the interval between KPADRead function calls becomes too long due to, for example, a process slowdown, the ring buffer in the KPAD library may complete the cycle and result in data loss. These conditions can be sometimes improved by changing the KPAD_RING_BUFS macro value in $(REVOLUTION_SDK_ROOT)/include/revolution/kpad.h to increase the ring buffer and by using the rebuilt KPAD library.
Although APIs were provided for the UI Tool Version 3 KPAD library to get and process data from standard Nintendo GameCube controllers, in the UI Tool Version 4 KPAD library, support for these APIs is eliminated.
03/01/2006 Initial version.
5/15/2006 Added to Cautions; how to avoid a data loss when the interval between the KPADRead function becomes too long.
06/19/2006 Support for UI Tool Version 4. Changed tentative product name to official name.