gca.js adds Nintendo® Wii U GameCube™ Adapter (as well as Nintendo Switch's) native asynchronous and synchronous support for Node.js applications. It uses a polyfill of the WebUSB API to interface with the adapter.
This module can only be used in Node.js applications, such as desktop applications using Electron or Nw.js.
There is no existing cross-browser solution to provide the same level of capabilities on web applications, and with the current ecosystem regarding WebUSB and WebHID APIs, this has become increasingly unlikely.
With Node.js installed into your system (either stable or latest), input this into the command line window in your Node.js project folder:
npm install gca-js
When you plug the Nintendo® Wii U GameCube™ Adapter in your computer, it will not be able to be used unless you configure your operating system to provide access to the Adapter.
Windows will fail to recognize the HID-like driver built in the kernel of the adapter, so it must be replaced with a generic WinUSB driver.
Developers can use gca-wincfg to make an automatic driver installer within their game, but it's only supported for 64-bit versions of Windows.
NOTE: From 2.0.0, gca-wincfg is an optional dependency of gca.js that may be installed on Windows systems.
Additional dependencies for Linux and macOS may be made in the future.
Gamers and consumers can run the sample script file within gca-wincfg with node to simply install it automatically, or use Zadig if they are running on a 32-bit Windows.
When using Zadig, select Options > List all devices. On the dropdown menu, select WUP-028. Finally, replace the built-in HidUsb driver with the WinUSB driver.
Additionally, the native dependencies have to be recompiled to be used in Electron or Nw.js, as some of them will download prebuilt binaries not meant to be used in either of these runtimes, and will fail to load on Windows.
electron-prebuilt
, you must specify the version that matches the apm version that your prebuilt Electron uses.udev will only give access to the adapter to the root user until a udev rule is applied.
51-gcadapter.rules
file from the repository to the /etc/udev/rules.d
directory.sudo udevadm control --reload-rules
.All HID devices (which includes the adapter) are intercepted by IOKit's HID driver. The adapter, not being designed for usage on computers, will not provide a valid report descriptor and IOKit will fail to communicate with the adapter.
Since May 2021, this can be easily solved with secretkey's GC Adapter Driver for versions of mac OS High Sierra (10.13) and newer, and is heavily recommended to install this new driver and remove the older ones.
There are two versions of that driver: A signed kext for versions 10.13 to 10.15, and an app that uses DriverKit instead of IOKit for versions 11 and newer. If you are using the app version, the app that runs the driver has to be running for the adapter to work. You can add it to the Login Item list so that it runs on startup.
The "overclocking" feature of this driver is supported, but discouraged.
WARNING: kexts for older versions (e.g. SmashEnabler) of OS X exist. However, they are unsigned and will not load from OS X El Capitan (10.11) or newer. You may bypass it by disabling SIP, but this will put your system at risk. More details about disabling SIP here.
gca.js can be used at any time by placing this line:
var gca = require('gca-js');
It stores the accesible API into a variable so that you can call any of the available methods from there.
WARNING: gca.js can only access the adapter in contexts where the Node.js runtime is accessible, although the processing of the obtained data can happen elsewhere.
There are working examples of using gca.js in the examples
folder.
The full API is included on Github Pages.
navigator.usb
). In practice, however, the only web browsers that support WebUSB natively (Chromium-based) block interaction with devices that are normally classified as HID devices despite the changes in the driver. This makes it impossible to support the GameCube adapters in Windows and mac OS.Generated using TypeDoc