Skip to content
This repository was archived by the owner on Mar 18, 2022. It is now read-only.

Commit b4b6a06

Browse files
committed
New documentation
1 parent 9357524 commit b4b6a06

1 file changed

Lines changed: 122 additions & 87 deletions

File tree

README.md

Lines changed: 122 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,123 @@
1-
![gca-node logo][logo]
2-
3-
gca-node is a NodeJS addon that adds Nintendo® Wii U GameCube™ Adapter native support for NodeJS applications.
4-
5-
## Usage
6-
7-
**gca-node currently only builds on Windows 7+ 64-bit**, although there is planned support for Linux and Mac OS.
8-
As of now, it can only be used on NW.js.
9-
10-
### Prerequisites
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.
15-
16-
### Building
17-
18-
1. Download or clone the gca-node repository.
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. Add `gca-node` to your project's `package.json` dependencies.
24-
2. Copy the included `configure.bat` to your NW.js project.
25-
3. Open the CLI inside your NW.js project, and run the `configure.bat` file to install the addon.
26-
4. **[Tip]:** 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.
27-
```
28-
var native_require = eval('require');
29-
gca_node = native_require('gca-node.node');
30-
```
31-
32-
## gca-node API
33-
To be added on Wiki pages.
34-
35-
### Setup()
36-
Detects the first Nintendo® Wii U GameCube™ Adapter connected in your computer.
37-
Returns 0 if the setup has detected one.
38-
39-
### Load()
40-
Claims the interface to be used on the NodeJS application.
41-
Returns 0 if an interface has been succesfully claimed.
42-
43-
### Process()
44-
Returns an array of 4 objects with the current status of each port of the adapter.
45-
Each object contains a status for each port, whether if there is a GameCube™ Controller connected or not.
46-
47-
### Request()
48-
Returns debug information about the current status of the GameCube controllers.
49-
50-
### RawData()
51-
Returns raw binary data of the status of the Adapter.
52-
53-
### Unload()
54-
Releases the interface so that it can be used by other applications.
55-
Returns 0 if succesful.
56-
57-
### Stop()
58-
Closes the Nintendo® Wii U GameCube™ Adapter so that it can be safely unplugged.
59-
Returns 0 if succesful.
60-
61-
## FAQ
62-
* **What is the difference between gca-node and gca+?**
63-
* gca-node and the upcoming sister project [gca+][1] share almost the same source code. gca-node is designed for NodeJS applications, and gca+ is designed for C++ applications such as Unreal Engine.
64-
* **Will gca-node support rumble?**
65-
* gca-node 2.0 will be able to send rumble commands to the controllers.
66-
* **Will gca-node support third party GameCube Controllers?**
67-
* This has not been tested, but in theory it is very likely that third party GameCube controllers are compatible with gca-node. However, their extra features (i.e. turbo mode) will most likely be not supported due to the adapter's specifications.
68-
* **Will gca-node support third party GameCube USB Adapters?**
69-
* It is very unlikely due to the structure of gca-node as of now.
70-
* **Will gca-node support connection with Game Boy Advance with GBA Link?**
71-
* No. Unfortunately, the specifications of the adapter make it incompatible with the GBA Link. Even if it were to be compatible, remotely interfacing with the Game Boy Advance is currently impossible.
72-
* **When will gca-node be cross-platform?**
73-
* We expect support in Linux in gca-node 1.4.x.
74-
* **Will gca-node br available for 32-bit platforms?**
75-
* gca-node 1.5.x will start experimenting with 32-bit platforms.
76-
* **Will gca-node support [electron][2] and apm?**
77-
* Probably not. Testings with electron have reported problems due to using a different version of NodeJS and incomaptibilities with apm. We will investigate on a workaround during gca-node 2.x.
78-
* **[Windows] Why is it necessary to use just Zadig? Can't I just use [ElMassivo's USB GameCube Adapter][3] instead?**
79-
* *ElMassivo's USB GameCube Adapter must remain inactive while gca-node is running*, as it claims the only interface available of the adapter. Without any other free interfaces, gca-node is unable to use the adapter, and viceversa.
80-
* However, you can install ElMassivo's USB GameCube Adapter and not use it, since Zadig is a component of this program.
81-
* **Why is gca-node better than HTML5 Gamepad API?**
82-
* HTML5 Gamepad API requires ElMassivo's USB GameCube Adapter, which does not bring all native capabilities that gca-node offers, like real-time input or rumble support.
83-
* Chromium's support for Nintendo® Wii U GameCube™ Adapter is currently incomplete and glitchy.
84-
85-
[logo]: http://i.imgur.com/quWt3jK.png
86-
[1]: https://github.com/yonicstudios/gca-plus
87-
[2]: https://github.com/electron/electron
1+
![gca-node logo][logo]
2+
3+
gca-node is a NodeJS addon that adds Nintendo® Wii U GameCube™ Adapter native support for NodeJS applications.
4+
5+
## Usage
6+
7+
**gca-node currently only builds on Windows 7+ 64-bit and Linux**, although there is planned support for Linux and Mac OS.
8+
As of now, it can only be used on NW.js.
9+
10+
### Windows
11+
12+
#### Prerequisites
13+
* **Visual Studio 2015** with standard C++ tools.
14+
* **Node 7.5.0** or higher, with npm installed.
15+
* **Zadig**: You must use it to replace the HID driver installed on Windows for the adapter to a generic WinUSB one.
16+
17+
### Building
18+
19+
1. Download or clone the gca-node repository.
20+
2. Install `node-gyp` globally (`npm install node-gyp -g`)
21+
3. Open the CLI inside the repository and execute `node-gyp rebuild`.
22+
23+
### Linux
24+
Tested on Arch Linux and Ubuntu, but it seems to be working for almost any Linux distro with a fairly recent linux kernel.
25+
26+
#### Prereqisites
27+
When using your system's package manager. Use the specific commands for your distro.
28+
29+
* **Make**. It can be already installed on your system. If not, install it from your system's package manager.
30+
* **libusb-1.0**. You can install it from your system's package manager. If specified, please install the -dev packages.
31+
* **Node 7.5.0** or higher, with npm installed.
32+
33+
#### Building
34+
35+
1. Download or clone the gca-node repository.
36+
2. Install `node-gyp` globally (`sudo npm install node-gyp -g`)
37+
3. Open the CLI inside the repository and execute `node-gyp rebuild`.
38+
39+
#### Configuration
40+
Like Windows, Linux distros require some special configuration. Linux fully supports the adapter's built-in drivers, but an udev rule must be added in order to allow access for gca-node.
41+
42+
1. Go to `/lib/udev/rules.d/`.
43+
2. Edit `XX-gcadapter.rules`, if there isn't one, create a file with the following `51-gcadapter.rules`.
44+
45+
Here are the contents of the file:
46+
`SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666"`
47+
48+
### test.js
49+
Once everything has been configured, you may run a test program by running `node test.js`.
50+
51+
### NW.js
52+
This is common for all operating systems.
53+
54+
1. Download NW.js SDK flavor.
55+
2. Add `gca-node` to your project's `package.json` dependencies.
56+
3. Copy the included batch program for your required OS:
57+
* **[Windows]:** `configure.bat`
58+
* **[Linux]:** `configure.sh`
59+
4. Open the CLI inside your NW.js project, and run the copied configure file to install the addon.
60+
5. **[Tip]:** 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.
61+
62+
```
63+
var native_require = eval('require');
64+
gca_node = native_require('gca-node.node');
65+
```
66+
67+
## gca-node API
68+
To be added on Wiki pages.
69+
70+
### Setup()
71+
Detects the first Nintendo® Wii U GameCube™ Adapter connected in your computer.
72+
Returns 0 if the setup has detected one.
73+
74+
### Load()
75+
Claims the interface to be used on the NodeJS application.
76+
Returns 0 if an interface has been succesfully claimed.
77+
78+
### Process()
79+
Returns an array of 4 objects with the current status of each port of the adapter.
80+
Each object contains a status for each port, whether if there is a GameCube™ Controller connected or not.
81+
82+
### Request()
83+
Returns debug information about the current status of the GameCube controllers.
84+
85+
### RawData()
86+
Returns raw binary data of the status of the Adapter.
87+
88+
### Unload()
89+
Releases the interface so that it can be used by other applications.
90+
Returns 0 if succesful.
91+
92+
### Stop()
93+
Closes the Nintendo® Wii U GameCube™ Adapter so that it can be safely unplugged.
94+
Returns 0 if succesful.
95+
96+
## FAQ
97+
* **What is the difference between gca-node and gca+?**
98+
* gca-node and the upcoming sister project [gca+][1] share almost the same source code. gca-node is designed for NodeJS applications, and gca+ is designed for C++ applications such as Unreal Engine.
99+
* **Will gca-node support rumble?**
100+
* gca-node 2.0 will be able to send rumble commands to the controllers.
101+
* **Will gca-node support third party GameCube Controllers?**
102+
* This has not been tested, but in theory it is very likely that third party GameCube controllers are compatible with gca-node. However, their extra features (i.e. turbo mode) will most likely be not supported due to the adapter's specifications.
103+
* **Will gca-node support third party GameCube USB Adapters?**
104+
* It is very unlikely due to the structure of gca-node as of now.
105+
* **Will gca-node support connection with Game Boy Advance with GBA Link?**
106+
* No. Unfortunately, the specifications of the adapter make it incompatible with the GBA Link. Even if it were to be compatible, remotely interfacing with the Game Boy Advance is currently impossible.
107+
* **When will gca-node be cross-platform?**
108+
* You can test cross-platforming support on the crossplatform branch, though it is expected to be on the master branch on gca-node 1.4.x.
109+
* **Will gca-node br available for 32-bit platforms?**
110+
* gca-node 1.5.x will start experimenting with 32-bit platforms.
111+
* **Will gca-node support [electron][2] and apm?**
112+
* Probably not. Testings with electron have reported problems due to using a different version of NodeJS and incomaptibilities with apm. We will investigate on a workaround during gca-node 2.x.
113+
* **[Windows] Why is it necessary to use just Zadig? Can't I just use [ElMassivo's USB GameCube Adapter][3] instead?**
114+
* *ElMassivo's USB GameCube Adapter must remain inactive while gca-node is running*, as it claims the only interface available of the adapter. Without any other free interfaces, gca-node is unable to use the adapter, and viceversa.
115+
* However, you can install ElMassivo's USB GameCube Adapter and not use it, since Zadig is a component of this program.
116+
* **Why is gca-node better than HTML5 Gamepad API?**
117+
* HTML5 Gamepad API requires ElMassivo's USB GameCube Adapter, which does not bring all native capabilities that gca-node offers, like real-time input or rumble support.
118+
* Chromium's support for Nintendo® Wii U GameCube™ Adapter is currently incomplete and glitchy.
119+
120+
[logo]: http://i.imgur.com/quWt3jK.png
121+
[1]: https://github.com/yonicstudios/gca-plus
122+
[2]: https://github.com/electron/electron
88123
[3]: http://m4sv.com/page/wii-u-gcn-usb-driver

0 commit comments

Comments
 (0)