Game Controller Converters

I would like to know where to start in programming video game converters. My idea is to take the data sent from the serial data controller, decode it, rearrange it, and the output it to the system. I would like to start with a gamecube to wii classic controller converter, the gamecube controller is a lot easier to hold in my hands than the classic controller and you can only play some games with the wii classic controller. I would like to know where to start with the code. Thanks in advance!

This is what i would like to make bust with an arduino uno. I have see the controllers inter faced with the arduino, but not the arduino to the system, and if I had there isn't code available for me to look at.

If there is no previous code, then you will probably need all or part of the development kits for both devices to do the conversion. I did not look, but sometimes there is a special kit for just interface devices, not building the games. It may not be free.
As a start, Google "wii development kit" and "gamecube development kit".

http://www.int03.co.uk/crema/hardware/gamecube/gc-control.htm

http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Classic_Controller

I have already found the info on the controllers, so I don't think i need a dev kit. I just don't know where to start with the code.

It looks doable, but that is up to you. Looks like two serial ports, and it is 8 bytes in* from the Gamecube controller, converted to 6 bytes out to the wii. You might want to start with the interface to the wii using the usb and text input instead of a controller. Once the wii does what you think, start adding the Gamecube controller.

It will be a fun project for you.

*edit: Actually, there is a 24 bit command sent out preceding the 8 bytes in, so it will be 3 bytes out and 8 bytes in.

I what to have the code like this

serial input
serial to parallel conversion with arduino
remap in software
parallel to serial conversion with arduino
serial output

I have no idea how I would go about writing this, would I put the incoming data into an array and remap that way, or something else?

You will need to determine where in the transmissions the data should be, in and out. Find the things you want to convert first (like one of the joysticks).

Have you tried any of the example sketches included with the IDE? Maybe those will get you started.

If that page is correct, those controllers really move on the serial stuff. It says 4us per bit. That is about 250kbit/second by my math. And on the o-scope displays, it doesn’t really look like a RS232-type serial pattern either.

edit: OH! and I forgot the good part. It is a one-line serial connection. The tx and rx is the same line. Won’t that be fun? To transmit, you will need to convert your TTL to an open collector. :smiley:

I have tried by reading serial on a pin and putting it in an array with a 4u delay between each pulse, and rearranging it. putting the data into another array and outputting it with a 4u delay between each pulse. that didn’t work at all.

You can't just read either one of those. Neither device works that way, according to those pages.

The Wii console apparently doesn't send anything. It just receives 6 bytes that the Arduino must send. And there is no baud rate specified on that page, so I haven't a clue what to send that at. You need that info first.

The GameCube controller won't just send. You must send it a 24 bit command (as the GameCube console) before it will return an 8 byte data packet at about 250kb. Check out the o-scope patterns on that page. And that is open collector both ends on that rx/tx line. That will prevent damage in the event of a bus contention collision. I recognized that o-scope pattern right away.

This is going to be a timing thing, like surfing. 8)

add: Start out thinking like this

void loop()
{
   // send 24 bit command to the GameCube controller
   // get 8 byte response from the GameCube controller
   // convert from GameCube data to Wii data
   // send the 6 byte Wii packet
   delay(10);
}

this is my non-working code

#include <Wire.h>

// input pin
// put in array
// input array = buffer array
// buffer array gose thu remapping to the output array
// output array goes to the output pin

int GamecubeData = 8; // Gamecube Data
int WiiCCClock = 7; // Wii Classic Controller Clock
int WiiCCData = 6; // Wii Classic Controller Data
int GCA[63];
int BA[63];
int WCA[40];

void setup()
{
pinMode(WiiCCClock, OUTPUT);
pinMode(WiiCCData, OUTPUT);
pinMode(GamecubeData, INPUT);
}

void loop()
{

int GC=0; // Gamecube Counter
int WC=0; // Wii Classic Controller Counter
int MainX=0;
int MainY=0;
int CStickX=0;
int CStickY=0;
int WiiCCLX=0;
int WiiCCLY=0;

GCA[GC] = digitalRead(GamecubeData); // Reads Gamecube data and puts it into an array

if (GC == 63) // counter Gamecube
{
GC = 0;
}
else
{
BA[GC] = GCA[GC];
delayMicroseconds(4);
GC++;
}

//Gamecube Controller -----> Wii Classic Controller
//Buttons
WCA[37]/B+/ = BA[4];/start/
WCA[44]/X/ = BA[5];/x/
WCA[42]/Y/ = BA[6];/y/
WCA[41]/B/ = BA[7];/b/
WCA[43]/BA/ = BA[8];/a/
WCA[34]/BLT/ = BA[10];/l/
WCA[38]/BRT/ = BA[11];/r/
WCA[40]/BZL/ = BA[12];/z/

WCA[45]/BZR/ = BA[12];/z/

WCA[47]/BDU/ = BA[13];/d-up/
WCA[33]/BDD/ = BA[14];/d-down/
WCA[32]/BDR/ = BA[15];/d-right/
WCA[46]/BDL/ = BA[16];/d-left/

//Analog
MainX=(BA[17]*1)+(BA[18]*2)+(BA[19]*4)+(BA[20]*8)+(BA[21]*16)+(BA[22]*36)+(BA[23]*64);
MainY=(BA[24]*1)+(BA[25]*2)+(BA[26]*4)+(BA[27]*8)+(BA[28]*16)+(BA[29]*36)+(BA[30]*64);
CStickX=(BA[31]*1)+(BA[32]*2)+(BA[33]*4)+(BA[34]*8)+(BA[35]*16)+(BA[36]*36)+(BA[37]*64);
CStickY=(BA[38]*1)+(BA[39]*2)+(BA[40]*4)+(BA[41]*8)+(BA[42]*16)+(BA[43]*36)+(BA[44]*64);
//byte 6 l
//byte 7 r

WiiCCLX = MainX/4.05;
WiiCCLY = MainY/4.05;

/* wii temp

WCA[35]//-
WCA[36]//Home
WCA[39]// 1
7 8 15 16 24 rx
17-21 ry
22 23 lt
25-30 rt
31-33 lt
*/

if (WC == 47) // counter Wii Clasic Controler
{
WC = 0;
digitalWrite(WiiCCClock, HIGH);
}
else
{
digitalWrite(WiiCCData, WCA[WC]); //Data
delayMicroseconds(4);
WC++;
}

}

That is an ok stab at it, but I think you are trying to do too much in one step. I do this pretty good, and I wouldn't try that in one step. Since it appears the Wii is TWI (data and clock lines), that would be the easiest to start with. Send it 6 bytes, change the joystick value, send that 6 bytes, change the joystick value again, send that 6 bytes, etc...and watch the Wii console.

Good luck with that. If you break that project down into sections, you might get others here to help you.

can you see anything wrong whit it?