-
Notifications
You must be signed in to change notification settings - Fork 0
GCA API 2.0 Reference
GCA-Node and GCA+ share the same GCA API, although they have some minor differences.
This version of GCA API, to be released on gca-node 2.x, was designed to make the procedures simpler and reduce the amount of functions. GCA-JS uses an asynchronous version of this API.
Detects all Nintendo® Wii U GameCube™ Adapter connected in your computer.
- Returns all compatible adapters detected in an array.
Claims the usage of the adapter and enables the communication with a given adapter and sends a command to it so that it can begin polling data.
- Returns 0 if done succesfully.
- Returns any other value associated with the libusb API otherwise.
Returns a list of 37 bytes in binary format about the adapter's current state (9 status bytes * 4 ports + 1 header byte = 37 bytes) The list contains the following information (using LSB 0 bit numbering). Multiply the byte number by the port number you want to use to get the element of the list that contains the same information for said port):
- Byte 0: GameCube Adapter header
- Byte 1: Port connection status.
- High nibble: Least significant bit is 1 when a controller is connected to said port, 0 when nothing is connected.
- Low nibble: Not used.
- Byte 2: Main buttons and D-Pad status.
- High nibble:
- Bit 7: D-Pad Left
- Bit 6: D-Pad Right
- Bit 5: D-Pad Down
- Bit 4: D-Pad Up
- Low nibble:
- Bit 3: Y button
- Bit 2: X button
- Bit 1: B button
- Bit 0: A button
- High nibble:
- Byte 3: Auxiliar buttons
- High nibble: Not used
- Low nibble:
- Bit 3: Start button
- Bit 2: Z button
- Bit 1: R trigger button
- Bit 0: L trigger button
- Byte 4: Main stick horizontal axis (left-right)
- Byte 5: Main stick vertical axis (up-down)
- Byte 6: C-Stick horizontal axis (left-right)
- Byte 7: C-Stick vertical axis (left-right)
- Byte 8: L trigger axis
- Byte 9: R trigger axis
Processes the data obtained in a formatted object form.
- Returns an Object in GCA-Node
Sends a rumble command to the adapter to toggle the rumble on all controllers of the adapter.
- Returns an array indicating the state of rumble if succesful
- Returns any other value associated with the libusb API otherwise.
Stops the communication with the adapter and makes it available for other processes.
- Returns 0 if succesful
- Returns any other value associated with the libusb API otherwise.