|
1 | | -<center>![gca-node logo][logo]</center> |
| 1 | +![gca-node logo][logo] |
2 | 2 |
|
3 | | -gca-node is a NodeJS addon that adds Nintendo™ Wii U GameCube™ Adapter native support for NodeJS applications. |
| 3 | +gca-node is a NodeJS addon that adds Nintendo® Wii U GameCube™ Adapter native support for NodeJS applications. |
4 | 4 |
|
5 | | -Currently, gca-node is under testing and the final code development has not started. |
| 5 | +## Usage |
6 | 6 |
|
7 | | -## Build guide |
8 | | - |
9 | | -**gca-node's initial_tests only build on Windows Vista and later versions.** |
10 | | - |
11 | | -gca-node final code will be able to be compiled on Windows 7 and later versions, OS X 10.8+ and most recent versions of Linux distros. |
12 | | - |
13 | | -*Windows XP and Windows Vista are not officially supported by gca-node, but it is possible to build the initial_tests directory by installing Windows XP C++ support on Visual Studio 2015.* |
14 | | -*OS X 10.7 is not supported by gca-node, as well.* |
| 7 | +**gca-node currently only builds on Windows 7+**, although there is planned support for Linux and Mac OS. |
| 8 | +As of now, it can only be used on NW.js. |
15 | 9 |
|
16 | 10 | ### Prerequisites |
17 | | - * **Visual Studio 2015** with standard C++ tools. **[Windows XP, Windows Vista]**: Windows XP C++ Support must also be installed. |
18 | | - * A built DLL of **[libusb 1.0.21][1]** or higher. It can be built from source on Visual Studio 2015 by opening the solution `libusb_2015.sln` within the `msvc` folder and building the project `libusb1.0 (dll)`. |
19 | | - * You can also download a prebuilt DLL from the [libusb repository][2]. |
20 | | - * **ElMassivo's Wii U GCN USB Driver**, either [downloding the latest release][3] or [building it from source][4]. Carefully follow all the instructions to install a new driver for the Wii U GameCube™ Adapter so that Windows may correctly configure it. |
| 11 | + * **Visual Studio 2015** with standard C++ tools. |
| 12 | + * **Node 7.5.0** or higher, with npm installed. |
| 13 | + * **NW.js SDK version.** |
| 14 | + * **Zadig**: You must use it to replace the HID driver installed on Windows for the adapter to a generic WinUSB one. |
21 | 15 |
|
22 | | -### Build procedure |
| 16 | +### Building |
23 | 17 |
|
24 | 18 | 1. Download or clone the gca-node repository. |
25 | | - 2. Create two directories within the `initial_tests\LibUSBTest<X>` folder called `lib` and `include`, where `<X>` is the number of test you want to try. |
26 | | - 3. Copy both `libusb-1.0.dll` and `libusb-1.0.lib` you've just built inside the `lib` folder. |
27 | | - 4. Copy the `libusb.h` from the downloaded libusb files to the `include` folder. |
28 | | - 5. Open `LibUSBTest<X>.sln` and compile it. |
29 | | - 6. The program should automatically copy the `libusb-1.0.dll` file within the executable program's folder. If it doesn't, Windows will report that the DLL is missing. You'll have to copy it manually to the folder where the executable is located. |
30 | | - |
31 | | -### Pre-execution setup |
32 | | -1. Make sure you've installed **ElMassivo's Wii U GCN USB Driver** and changed the driver of the Wii U GameCube™ Adapter to WinUSB. |
33 | | -2. However, **do *not* execute the built test program** while the driver is running, since the driver will have claimed the interface to connect with the adapter. If you have start it for testing purposes, please turn it off. |
34 | | - |
35 | | -[1]: https://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.21/libusb-1.0.21.tar.bz2/download |
36 | | -[2]: https://github.com/libusb/libusb/releases/download/v1.0.21/libusb-1.0.21.tar.bz2 |
37 | | -[3]: https://bitbucket.org/elmassivo/gcn-usb-adapter/downloads/WiiU-UsbSetup%202015-09-02.exe |
38 | | -[4]: https://bitbucket.org/elmassivo/gcn-usb-adapter/src |
| 19 | + 2. Install `node-gyp` globally (`npm install node-gyp -g`) |
| 20 | + 3. Open the CLI inside the repository and execute `node-gyp rebuild`. |
| 21 | + |
| 22 | +### NW.js |
| 23 | +1. Open the CLI inside your NW.js project, and run the included `configure.bat` file to install the addon. |
| 24 | +2. Whenever you need to use gca-node, use an alias for require so that other NodeJS tools like webpack do not mistake it as a NodeJS module. |
| 25 | + ``` |
| 26 | + var native_require = eval('require'); |
| 27 | + gca_node = native_require('gca-node.node') |
| 28 | + ``` |
| 29 | + |
| 30 | +## gca-node API |
| 31 | + |
| 32 | +### Setup() |
| 33 | +Detects the first Nintendo® Wii U GameCube™ Adapter connected in your computer. |
| 34 | +Returns 0 if the setup has detected one. |
| 35 | + |
| 36 | +### Load() |
| 37 | +Claims the interface to be used on the NodeJS application. |
| 38 | +Returns 0 if an interface has been succesfully claimed. |
| 39 | + |
| 40 | +### Read() |
| 41 | +TODO. Returns an object with the current status of the GameCube controller. |
| 42 | + |
| 43 | +### Request() |
| 44 | +Obtains debug information about the current status of the GameCube controllers. |
| 45 | + |
| 46 | + |
| 47 | +### Unload() |
| 48 | +Releases the interface so that it can be used by other applications. |
| 49 | +Returns 0 if succesful. |
| 50 | + |
| 51 | +### Shutdown() |
| 52 | +Closes the Nintendo® Wii U GameCube™ Adapter so that it can be safely unplugged. |
| 53 | +Returns 0 if succesful. |
| 54 | + |
39 | 55 | [logo]: http://i.imgur.com/quWt3jK.png |
0 commit comments