The KPAD library version from before Revolution SDK 2.3 has changed names to KPADOld library starting with Revolution SDK 2.3. Read the term "KPAD Library" that appears in this manual as "KPADOld Library."
This manual was written to support UI Tool Version 3 and UI Tool Version 4.
KPAD library is a high-level library located in the upper part of the WPAD library. Compared to the use of the WPAD library directly, use of the KPAD library can get coordinates for 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 the Wii Remote controller data, but also the controller data from the Nunchuk and the Nintendo GameCube standard controller can be retrieved.
Samples are provided to test the functionality of the KPAD library in $(REVOLUTION_SDK_ROOT)/build/demos/kpadOlddemo/ (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 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/kpadOld[D].a (for UI Tool Version 4)
$(REVOLUTION_SDK_ROOT)/RVL[0]/lib/kpadEmu[D].a (for UI Tool Version 3)
Shared function declarations are in the $(REVOLUTION_SDK_ROOT)/include/revolution/kpadOld.h header file.
The KPADOld library is not linked to the application by default. By default, $(REVOLUTION_SDK_ROOT)/RVL/lib/kpad[D].a will be linked to the application. To avoid this, specify kpadOld[D].a before the library specification $(REVOLUTION_LIBS) in the application's makefile. See the kpadsample(KPADOld) sample demo, $(REVOLUTION_SDK_ROOT)/build/demos/kpadOld/makefile for reference. If CodeWarrior IDE is being used, delete kpad[D].a from the project and add kpadOld[D].a.
After this, check the MAP file that is output by the linker, and make sure "kpad.a" or "kpadD.a" (KPAD version 2) has not been mixed up and linked.
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 the WPAD library autosampling feature to get data and update its internal buffer.
Using the KPADRead function, the specified channel's controller information is read into the KPADStatus structure. When adjusting the sharpness of the Wii Remote response and the hand tremor reduction level, use the KPADSetPosParam, KPADSetHoriParam, KPADSetDistParam, and KPADSetAccParam functions. These functions can adjust the controller status retrieved 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.
The 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/kpadOld.h to increase the ring buffer and by using the rebuilt KPAD library.
Although functions were provided for the UI Tool Version 3 KPAD library to get and process data from standard Nintendo GameCube controllers, support for these functions is eliminated in the UI Tool Version 4 KPAD library.
2006/10/25 Changed the name to KPADOld library starting with Revolution SDK 2.3. This is no longer linked by default, so the link procedure was added.
2006/06/19 Support for UI Tool Version 4. Changed tentative product name to official name.
2006/05/15 Added to Notes methods to avoid loss of data when the intervals between calls of the KPADRead function become too long.
2006/03/01 Initial version.
CONFIDENTIAL