Gamecube Protocol – Simple Controllers
Gamecube Protocol – Simple Controllers
This document is a in-depth explanation on the Gamecube Controller protocol and how it works.
2 - Red - Data
3 - Green - Ground
5 - NC (Not Connected)
6 - Blue - 3.3v
-------------------------------------------------------------------------------------------------------------------
Protocol:
Console probes:
Stop Bit
Sometimes 0xFF - 1111 1111 can be sent instead of 0000 0000, this tells the controller to recalibrate.
Controller responds:
Stop Bit
-------------------------------------------------------------------------------------------------------------------
Stop Bit
0x42 - 0100 0010 can be sent instead of 0x41, meaning the controller is being asked to recalibrate.
Controller responds origin (Number after colon represents number of bits that buttons/axis is
represented by):
0, 0 ,0 , Start : 1, Y : 1, X : 1, B : 1, A : 1
C-Stick X Value : 8
C-Stick Y Value : 8
L-Trigger : 8
R-Trigger : 8
Stop Bit
Sometimes instead of the two null bytes 0x02, is sent for both bytes and noted by NiceMitch. Unsure
what this flags but is worth noting.
-------------------------------------------------------------------------------------------------------------------
The second byte is a little tricky 0x03 is the typical value the rest are requesting special data formats
(0x00, 0x01, 0x02). Nicohood has more info in Gamecube.c, line 179.
This last byte is relatively unknown and usually deals with Rumble. Usually the bit before Rumble
will turn to a 1, if Rumbles been activated before and 0 if it has not. (Could be related to rumble
brake). Therefore typical responses are 0x03, 0x02, 0x01, 0x00.
If you are coding this I would only focus on the last 2 bits for the last two bytes (first byte should be
read as normal), ignore the rest incase of any unknown protocols/formats.
Controller responds values (Same as origin without the two null bytes):
0, 0 ,0 , Start : 1, Y : 1, X : 1, B : 1, A : 1
C-Stick X Value : 8
C-Stick Y Value : 8
L-Trigger : 8
R-Trigger : 8
Stop Bit
-------------------------------------------------------------------------------------------------------------------
The console and controller will then continue the last two sequences until a controller is
disconnected. If a controller is disconnected the console will go back to probing for a controller.
Data is transmitted via one wire and this is how it looks. High bits are 1us lows followed by 3us
highs, LOW bits are 3us lows followed by 1us highs, Stop bits are 1 us lows followed by 2us highs
The official console will report bits slightly differently where instead of 4us for a bit it will be 5us.
Meaning 3.75us and 1.25us (instead of 3, 1 and 1, 3 uS respectively).
Example on how bits would be read (Picture used is from the Sammy Keyboard Controller Protocol):
Controller data is sent as a byte, (8 bits, 0-255 in decimal). This means that 128 by default is the
center value and you can go 127 units to the right, and 128 units to the left (the Phob controller uses
127 as its center coordinate).
But depending where you controller origins (where the controller starts out at), this changes. This
means that if you were to plug in your controller and you stick as at 129, 131 (x, y). Your controllers'
values are now all offset by that amount. Meaning that 129, 131 is your new center. 130, is one unit to
the right, and 127, is two units to the left. This same thing goes for the Y value except for the fact that
in relative to its initial position (131), for it to go one unit up it would now be 132, and two units down
would be 129!
For analog triggers it is also sent as a byte (0-255), but uses normal logic of 0 is lowest value 255 is
highest.
These are good sources that were used in this document, I would highly recommend looking through
them:
http://www.int03.co.uk/crema/hardware/gamecube/gc-control.html
https://github.com/NicoHood/Nintendo
Back to blog
home
products
resources
tutorials
projects
contact
© 2024, Simple Controllers Powered by Shopify