GameCube
Controller on PC...
What
I want to do is build an adaptator to connect the GC controller on PC
(Linux or Win),
using
USB port.
If you are interested, write to m_den.mail@free.fr (
remove
one of the 'm_',
it's against web-robots
)
This
adaptator should be HID to be recognized by any modern OS as a Joystick
without any driver.
I
have prospected the internet to find some informations about GC
Controller, here's what I've found:
- 7 pins connector (external
plug):
- 1. Yellow: 5V power
supply
(used by rumble motor).
- 2. Red: DATA line:
bi-directional data to/from console, needs pull-up resistor to 3.43V
- 4. White: Ground (Skillz
interface has pins 3+4 wired as common ground).
- 5. N.C.: Unknown: not
connected by official controller, or Skillz interface.
- 6. Blue: 3.43V logic
power
supply.
- 7. Black: Cable
shielding
/ ground. Usually common ground with pin 3.
- Which pins are needed for
a homebrew interface?
- use a 7805 voltage
regulator to provide a 5V supply to pin 1.
- uses a variable voltage
regulator to provide a 3.43V (or 3.3V regulator) supply to pin 6.
- use a 1K pull-up
resistor from pin 2 to the 3.43V rail (or 3.3V).
- The ground (3) and
shield (7) are connected together.
- The Serial Data Interface:
Pin 2 (Red)
- Bidirectionnal data line
- active high 3.43V (or
3.3V) logic signal,
- pull-up resistor (1K)
holding the line high (add it in our circuit), connected to 3.43V,
- pull data line low with
an open-collector transistor when a low needs to be transmitted,
- 4µs by bit as
follow:
0 (LOW) bit : 3µs low
followed by 1µs high.
1 (HIGH) bit : 1µs low
followed by 3µs high.
- communication terminates
with a single HIGH stop bit (for 0000 you send 00001) (all
just
like N64),
- the gamecube probes for
a controller by sending the sequence 000000001 about every 12ms,
- Each update lasts around
348us,
- Sequence starts with a
24-bits COMMAND from the console: 0100 0000 0000 0011 0000 0010,
- then the RESPONSE from
controller: string of 64 bits containing state of all buttons along
with joysticks position data,
- More work is needed to
examine the initial conversation between the Gamecube and controller to
see if there is any useful information (e.g. about what type of
controller is attached?).
- Apparently, a circuit
inspired from N64 (PC parallel port) with shift registers (CD4006)
diodes (1N4148) and transistor (BC559 or 2N3906) does
work to
read all the vlues from the controller by a little program controlling
the parallel port.
here is the N64 controller circuit:

Command from the console : the last bit is the rumble motor
(Set=enable/Clear=disable).
Response from the controller :
Byte
0 |
0 |
0 |
0 |
Start |
Y |
X |
B |
A |
Byte
1 |
1 |
L |
R |
Z |
D-Up |
D-Down |
D-Right |
D-Left |
Byte
2 |
Joystick X Value (8 bit)
|
Byte
3 |
Joystick Y Value (8 bit) |
Byte
4 |
C-Stick X Value (8 bit) |
Byte
5 |
C-Stick Y Value (8 bit) |
Byte
6 |
Left Button Value (8 bit) - may be 4-bit mode also? |
Byte
7 |
Right Button Value (8 bit) - may be 4-bit mode also?
|
That's all I have for the moment!
I have seen informations about a PIC microcontroller that can handle
USB (low speed would be sufficient I think), so maybe it can be built
around this component,
There are also serial ready-to-use interfaces : USB <->
RS232 or USB <-> Parallel they are fast
(>500kbps), but a bit expensive.
And
what about HID?
I
think a specific driver must be written.
searched for YAGCD... YACD
Project
and found:
9.2 standard
Controller
- enable
all controllers in 0xcc006430
- set
Joy-channel 1-4 Command Register to 0x00400300
- clear
SI i/o buffer
- wait
until bit 31 of 0xCC006434 is 0, then set it to 1
Command
Word
0x00400000 - enable polling
0x00000300 - ?
0x00000100 - ?
0x00000001 - enable rumble motor
Commands:
0x00 - get id+status
0x40 - ?
0x41 - get origins
0x42 - calibrate ?
9.2.2 Read
Controller Status
- simply
read all Joy-channel registers and extract the info you want
first
input word |
bit(s) |
|
Description |
31 |
|
ERRSTAT - (assumed
0) |
30 |
|
ERRLATCH -
(assumed 0) |
29 |
|
unused (?) |
28 |
s |
Start Button |
27 |
y |
Y Button |
26 |
x |
X Button |
25 |
b |
B Button |
24 |
a |
A Button |
23 |
|
unused (?) |
22 |
L |
L Trigger |
21 |
R |
R Trigger |
20 |
|
Z Trigger |
19 |
u |
D-Pad Up |
18 |
d |
D-Pad Down |
17 |
r |
D-Pad Right |
16 |
l |
D-Pad Left |
8-15 |
x |
Analog Stick X
(8bit unsigned, ~32...128...~224) |
0-7 |
y |
Analog Stick Y
(8bit unsigned, ~32...128...~224) |
|
second
input word |
bit(s) |
|
Description |
24-31 |
x |
Analog C Stick X
(8bit unsigned, ~32...128...~224) |
16-23 |
y |
Analog C Stick Y
(8bit unsigned, ~32...128...~224) |
8-15 |
l |
L Trigger Analog
(8bit unsigned, ~32...~224) |
0-7 |
r |
R Trigger Analog
(8bit unsigned, ~32...~224) |
|
9.2.3 rumble
Motor On
*(volatile
unsigned long*)0xCC006400 = 0x00400001;
*(volatile unsigned long*)0xCC006438 = 0x80000000;
9.2.4 rumble
Motor Off
*(volatile
unsigned long*)0xCC006400 = 0x00400000;
*(volatile unsigned long*)0xCC006438 = 0x80000000; YACD
Project
Links and references:
http://www.int03.co.uk/crema/hardware/gamecube/gc-control.htm
thanks to you!
http://www.zen35383.zen.co.uk/stnield/usbpads.htm
http://ezhid.sourceforge.net/gcpad.html
http://home.t-online.de/home/stephan.hans/n64.htm