Arduino as GameCube controller (for GBA)

Discussion in 'Repair, Restoration, Conservation and Preservation' started by Bearking, Mar 28, 2018.

  1. Bearking

    Bearking Konsolkongen

    Joined:
    Aug 2, 2010
    Messages:
    856
    Likes Received:
    100
    Now that the Game Boy Interface makes GBA games actually playable on GameCube I have been playing it quite a bit over the last few days. Unfortunately, while functional, the GameCube controlers d-pad isn't very good for prolonged gaming sessions, so I wanted something better.

    I had an extra Super Famicom controller that I wanted to use, but no suitable donor GameCube-controller that could fit inside. So I decided to examine the possibility of using an Arduino instead, and found that a guy called Nicohood had made a library that allows GameCube controllers to be connected to PC, but more importantly allows the Arduino to act as a controller on the GameCube.

    Unfortunately he hadn't created an example code for the latter to work, and understanding how his library works is still quite a bit too difficult for me. To my luck, a guy who goes by the name Simple Controllers had made this work for a project where he made a Hit box-style controller for Smash Box, so it was pretty simple to alter his code to fit an Arduino Pro Mini and make it work with a SNES controller.

    IMG_1083.JPG

    This does work very well but I have run into the strangest bug. The Qoob BIOS hates this controller for whatever reason. Using bios v1.3 the GameCube will refuse to boot with the controller plugged in. In 1.2 it does boot, but it repeatedly presses the A, button which means that if I press B to go to the DOL-launcher it immediately launches the first item on the list. This is not a big deal for me as I only have Swiss installed anyway.
    If I flash the quite old GCoS to the chip, it works perfectly fine, and so do every game or homebrew program once booted.
    I have no idea what is going on with the Qoob BIOS, and why it's behaving like this. I suspected that it didn't like that the analog sticks weren't assigned, so I tried assigning them to the unused pins on the Arduino, but that didn't make any difference.
    I'm using 3.3v to power the Arduino, and thus the data pin outputs 3.3v as well, so that's not it either :)

    I also considered that the installed GCHDMI was causing this issue as that's connected to controller port 1, but given the change in behaviour when changing the BIOS I think this can be ruled out.

    Works perfectly fine on an unmodified GameCube.

    Anyway, below are the install pics.

    IMG_1078.JPG
    211B22FB-CE15-44E7-B55F-3F2B1F7F5379.jpg

    Removed the multiplexer/switch register or whatever it is from the controller PCB and superglued the Arduino to the back. Ran coated copperwire from the Arduino to the pads on the controller. The GameCube controllers only need three wires to work, 3.3v, GND and Data.

    Arduino sketch is attached to this post.

    EDIT: Whooops, meant to post this in the modding forum. Would appreciate it if a moderator would be kind enough to move the thread :)
     

    Attached Files:

    Nully, sa1, element18592 and 2 others like this.
  2. MonkeyBoyJoey

    MonkeyBoyJoey 70's Robot Anime GEPPY-X (PS1) Fanatic

    Joined:
    Mar 1, 2015
    Messages:
    1,742
    Likes Received:
    318
    Wait, the GBA to GC link cable doesn't work in GBI? I figured it would let you use a GBA as a controller just like with the official GBP software. The GBA as a controller is my preferred method since it is the original GBA controls. Regardless, that's pretty cool.
     
  3. Bearking

    Bearking Konsolkongen

    Joined:
    Aug 2, 2010
    Messages:
    856
    Likes Received:
    100
    I'm pretty sure you can use a GBA as a controller in GBI. Haven't tried it though as my link cable is buried in a box somewhere in the basement. But yes, that would also be an excellent way to play :)
     
  4. MonkeyBoyJoey

    MonkeyBoyJoey 70's Robot Anime GEPPY-X (PS1) Fanatic

    Joined:
    Mar 1, 2015
    Messages:
    1,742
    Likes Received:
    318
    Ah, I'll have to try it once I get another modchip. I really want to try out this mod for the SFC controller as I prefer that over my GBA's mushy buttons.
     
  5. DeChief

    DeChief Rustled.

    Joined:
    Jan 25, 2014
    Messages:
    1,704
    Likes Received:
    713
    [​IMG]

    Is the d-pad on this thing any good? Looks like there are also straight-up converters for SNES/SFC controllers to GC ports.

    But nice job, your controller is cool too. :p
     
    Bearking likes this.
  6. Bearking

    Bearking Konsolkongen

    Joined:
    Aug 2, 2010
    Messages:
    856
    Likes Received:
    100
    I’ve only hears good things about that Hori controller, but it’s crazy expensive now :/
    Getting the D-pad right is usually where third party controllers fail in my experience.

    Though I should say that I’ve never actually been that fond of the SNES controller to begin with. Although it works perfectly every time, I find the D-pad incredibly stiff on it. I would actually have liked it a bit more mushy with slightly longer travel. But it’s not horrible by any means :)
    For comparison I think the Saturn and Mega Drive 6b controllers has the best d-pads ever made by quite a wide margin.
    But the button mapping makes the most sense with a SNES-controller, and it makes it more official when using other Nintendo-branded stuff, which I always strive for when doing my mods :)

    Besides I had this extra Japanese controller with an incredible short lead that I never used, and the Arduino is like $1 on ebay, and for some reason I had kept a GameCube lead from some crappy 3rd party controller I had once. So this was by far the cheapest and fastest way for me play GBA properly :p
     
  7. Bearking

    Bearking Konsolkongen

    Joined:
    Aug 2, 2010
    Messages:
    856
    Likes Received:
    100
    Works fine on the Nintendo Switch using the Wii U Smash Bros. Adapter :)
     
    MonkeyBoyJoey and DeChief like this.
  8. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    755
    Likes Received:
    49
    Very nice - I'm just getting into Arduino coding and will look at giving this a go at some point. I'm currently working on a wireless Neo Geo controller, just because it seemed the easiest to start with given there's no logic between the buttons and the console, but this sort of code would definitely make it viable for the Gamecube as well.
     
    sa1 likes this.
  9. Bearking

    Bearking Konsolkongen

    Joined:
    Aug 2, 2010
    Messages:
    856
    Likes Received:
    100
    I wish you the best of luck. What will you use for the wireless transmitting and receiving?
     
  10. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    755
    Likes Received:
    49
    I'm using a pair of NRF24L01+ modules; there's a pretty well-documented Arduino library for them. I've got everything working on a stripboard, just working on adding a couple of flourishes like charging status LEDs and a soft latching power button. It's does have about 20ms of lag, so about a frame at 60fps - still trying to work out if that makes the slightest bit of difference when I'm gaming.
     
  11. Gunstar

    Gunstar Member

    Joined:
    Apr 9, 2014
    Messages:
    20
    Likes Received:
    4
    This is a great looking project, thanks for sharing this!

    Can I ask which Arduino pro mini you used, the 3.3v or 5v?
     
  12. Bearking

    Bearking Konsolkongen

    Joined:
    Aug 2, 2010
    Messages:
    856
    Likes Received:
    100
    I use the 5V 16MHz version.
     
    Gunstar likes this.
  13. Gunstar

    Gunstar Member

    Joined:
    Apr 9, 2014
    Messages:
    20
    Likes Received:
    4
    Thanks, Bearking! I have ordered one now I was confused by the part where it said you powered it via 3.3v so I thought it might have been the 3.3v - 8mhz version.

    I hope I can follow your footsteps in making this although I have no experience in programming/flashing lol
     
  14. AndehX

    AndehX You got boost power!

    Joined:
    Apr 7, 2016
    Messages:
    356
    Likes Received:
    68
    I am definitely going to do this mod. I have a spare arduino nano sitting in the drawer. Need to find a SNES and Gamecube controller to use as donors now :D

    Edit: Do you think you could throw together a quick schematic for this mod, just to make it easier for myself and anyone else in future to follow?
     
    Last edited: Dec 22, 2018
    Gunstar likes this.
  15. Gunstar

    Gunstar Member

    Joined:
    Apr 9, 2014
    Messages:
    20
    Likes Received:
    4
    Some additional notes:

    Arduino Pro Mini 16mhz/5v can be powered by 3.3v (a possibility that it downclocks) source: Link

    SNES controllers use 5 volts (although could be fine with 3.3v?) Quote from the Raphnet page:
    Those Gamecube Smash box controllers use a bi-directional logic controller 3.3v to 5v and a 1k resistor to pull up the line:
    [​IMG]
    I'm guessing the logic controller is small enough to fit inside the SNES controller too. Using only 3.3v like Bearking seems easiest to make this mod and he's only had issues with a Qoob bios. The Raphnet info has me thinking if I should add a logic controller if the SNES controller prefers 5v though.
     
    sa1 likes this.
  16. Gunstar

    Gunstar Member

    Joined:
    Apr 9, 2014
    Messages:
    20
    Likes Received:
    4
    Looking at the sketch file and how Bearking has wired his I think this is the wiring layout. Let me know if there any mistakes!
    [​IMG]
    [​IMG]
     
    sa1 and AndehX like this.
  17. AndehX

    AndehX You got boost power!

    Joined:
    Apr 7, 2016
    Messages:
    356
    Likes Received:
    68
    Excellent. That will be perfect for when i get the stuff together to do mine
     
  18. AndehX

    AndehX You got boost power!

    Joined:
    Apr 7, 2016
    Messages:
    356
    Likes Received:
    68
    ok, I have an Arduino Nano 3 spare. I assume that would work fine?

    One of these:

    [​IMG]
     
  19. Gunstar

    Gunstar Member

    Joined:
    Apr 9, 2014
    Messages:
    20
    Likes Received:
    4
    I think it should be interchangeable going by this thread: Link but I don't know for sure.
     
  20. Bearking

    Bearking Konsolkongen

    Joined:
    Aug 2, 2010
    Messages:
    856
    Likes Received:
    100
    If it has enough IO and runs at 16MHz it should work. You may have to change the IO pins in the code so it matches the pinout of the Nano.
    Then just select Arduino Nano as the target decvice in the IDE, compile and upload and it should work for you :)
     
    Gunstar likes this.

Share This Page