Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Portables, case replacements, mods etc, all in here!
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Wed Dec 07, 2016 1:49 pm

I saw the project online and have no clue how it is done. I'm guessing through micro-controllers or something would it be possible to power a Arduino M0 or micro-controller using just a GameCube controller with no external power?
Does anyone have any idea how I can replicate the project for personal use, it is not in production right now. I tried thinking of just analog stuff at first (resistors/buttons) but it just seemed impossible.
The controller basically the max cardinal directions of the GameCube controller -X, X, -Y, Y to physical buttons that then uses modifiers called X1, X2, X3, Y1, Y2, Y3 to lower values on the control stick to allow small inputs such as walking. (X3, Y3 is a combination of X1 and X2 and Y1 and Y2). Those modifier buttons do nothing by themselves in-order for them to work at least one of the cardinal directions must be pressed on the controller.
Here is a video of the controllerhttps://www.youtube.com/watch?v=UM-NKXS1m2I
Any help would be greatly appreciated, I've been trying to think of ways for the past months with no resolve.
This is my first post by the way! I stumbled upon this forum looking for an answer, and it seems like you guys are the experts.
Thanks for the help. :D
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Wed Dec 07, 2016 3:43 pm

I am not entirely sure how this thing works exactly, but I think I have almost all code to replicate this thing. Perhaps it would be nice to make an open-source alternative?

I get that the analog stick is mapped to buttons now, but I am not sure how different levels of tilt are implemented etc.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Wed Dec 07, 2016 4:45 pm

Yeah @meneerbeer that would be great, and yeah that is exactly what I'm wondering too. The only viable solution I found is to either use something like microcontrollers or used normally closed switches which seems impossible due to the fact that it uses authentic sanwa buttons that only come normally open.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Wed Dec 07, 2016 4:58 pm

Mimicking a GC controller is easy enough. There is someone else on the forum that has a board for that iirc.

I would need to know how this thing works functionally. I will have a look at his videos soon.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Wed Dec 07, 2016 5:58 pm

Yeah I definitely know how to do everything except the analog tilts to digital input. I honestly think the easiest way would by to use a micro-controller. Do you know if the GC Controller can power an Arduino M0 if the rumble pack is removed, or is it to demanding on the power. Another way would be to use logic gates and resistors but I know this can get messy. (He also mentioned there would be a switch to swap different modes of the Fightpads that would allow custom tilt settings for each game, that definitely has to be microcontroller based right? Straight logic would be so messy).
novenary
Posts: 1756
Joined: Mon Dec 30, 2013 7:50 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by novenary » Wed Dec 07, 2016 8:27 pm

Pretty much any MCU you can find is negligible in terms of power consumption, you could even keep rumble with it anyway because the GC has quite a lot of headroom on the power supply side (39W brick, but it doesn't even use half).
Don't bother with discrete logic, it's a waste of time and an MCU is cheaper anyway.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Wed Dec 07, 2016 8:43 pm

I checked the video. It shouldn't be hard to make this.

Analog tilts to digital input is only a matter of checking which buttons are pressed and sending corresponding control stick values to the Cube I think.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Wed Dec 07, 2016 8:45 pm

But @Streetwalker what if I am supplying the power directly to the microcontroller directly from the controller only. Would it still work. I assume I would need an arduino that can run on 3.3v or 5v then correct?

and for @meneerbeer hmm. do you know any ways I would emulate those using the buttons just like the video provided than, super confused.
Last edited by amiinal on Wed Dec 07, 2016 8:47 pm, edited 1 time in total.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Wed Dec 07, 2016 8:46 pm

Yes, 3.3V or 5V.

I think a lot of ARM cores use 3.3V.
and for @meneerbeer hmm. do you know any ways I would emulate those using the buttons just like the video provided than, super confused.
Basic idea is, read in (arcade) button states with Microcontroller, translate these states into a response for the GameCube mimicking a GameCube controller response, reply with this response when GameCube polls for controller status.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Wed Dec 07, 2016 9:16 pm

Alright cool. And I assume the voltages would be changed using resistors to output the proper voltages that the Gamecube controller would read as the correct inputs? Say if 2v was the correct voltage to do a walk, just use resistors to limit the 3.3v line to 2v to get that perfect speed? Or is there an easier way.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Wed Dec 07, 2016 9:27 pm

The GameCube controller responds with digital data to the Cube (through a single wire, hence serial protocol). The digital data contains all values of buttons, triggers, and analog sticks. A normal GameCube controller IC reads in the analog values from triggers, buttons etc. and sends these in digitized format to the Cube. So it is a matter of implementing the serial protocol. I am pretty sure there are some Arduino examples for this, but most of them are likely restricted to a certain microcontroller (most likely 8 Bit AVR one). That is not a problem, 8 bit AVR is fast enough. :)
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Wed Dec 07, 2016 9:33 pm

Ohhh I see what you are saying now. You are talking about sending the signals as ones the cube can understand. I was thinking just taking the 3.3v line reducing it and sending it back where the controller would normally take the data of the control stick. Hmm. How would I go upon doing that and do you think it is easier at all? Gonna start looking into asap.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Thu Dec 08, 2016 9:01 am

"My" solution does not require you to destroy a controller for the PCB.
novenary
Posts: 1756
Joined: Mon Dec 30, 2013 7:50 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by novenary » Thu Dec 08, 2016 3:57 pm

Yeah I didn't quite catch that either, you don't need to destroy a controller at all. What you should actually do is make a replacement for it. You can even get a cheap extender cable from eBay for the connector.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Fri Dec 09, 2016 12:00 am

I see what you are trying to say but I honestly wouldn't know how to do it that way without some help :c
novenary
Posts: 1756
Joined: Mon Dec 30, 2013 7:50 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by novenary » Fri Dec 09, 2016 12:49 am

I'm busy with other things, but meneerbeer offered to help as far as I can tell.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Fri Dec 09, 2016 9:15 am

I just need switches... Any suggestion where to get good ones for cheap?

I have code to reply to GameCube controller requests, so all that is needed is to read out the switches and generate appropriate responses from there.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Fri Dec 09, 2016 10:24 am

I usually just get everything from amazon since I get it same day for free where I live. Sometimes it is a little more pricey though.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Fri Dec 09, 2016 12:59 pm

I will probably get the cheapest switches, since I don't think I will use it myself.

What exactly does the "shield tilt" button do?

I am going to try to target the Arduino Uno, so it can be easily replicated.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Fri Dec 09, 2016 8:31 pm

Shield Tilt is just a light shield button I believe. In other words it is bound to the lightest press of L/R. Yeah I've been looking around online for some stuff I found this
https://github.com/NicoHood/Nintendo
http://www.int03.co.uk/crema/hardware/g ... ontrol.htm

Not exactly sure how to use all of it at the second but I am working on it. Yeah, at the second I think I'm gonna try the Arduino Mega 2560 since it has ton of space and I believe it can run off the 5v yellow line in the gamecube. While Uno needs 7v to be stable as far as I know. Yet Mega 2560 is a little bigger. Im unsure though, if you can find a way for it to work on the UNO and run off GCC Power that would be amazing.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Wed Dec 14, 2016 10:58 am

@meneerbeer you have anyluck? I just received my arduino mega today and didn't get much progress so far.
patrickpf
Posts: 2
Joined: Sat Oct 12, 2013 10:32 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by patrickpf » Wed Dec 14, 2016 5:58 pm

I am currently working on the same exact thing (however postponed until next week due to finals). I wanted to try out and practice with the Smashbox myself but I couldn't justify the $200 price tag as well as I wanted to try it soon rather than later after the kickstarter. Around the end of the summer I found NicoHood's code and figured out how to send button inputs to the Gamecube via Arduino. He didn't exactly intend for the software to be used in this way so I had to dig around a little bit and figure it out. I only setup two switches to do mad dash dances and then put everything aside when school started. Here's a short sample code that does left right movement and the A,B,Y buttons:

Code: Select all

#include "Nintendo.h"

CGamecubeConsole GamecubeConsole(8);      //Defines a "Gamecube Console" sending data to the console on pin 8
Gamecube_Data_t d = defaultGamecubeData;   //Structure for data to be sent to console

//Use booleans for buttons.
bool a = false;
bool b = false;
bool y = false;
int xAxis = 127;

void setup()
{
  //Set input pins to INPUT_PULLUP so you dont need a resistor
  pinMode(2, INPUT_PULLUP);   //A
  pinMode(3, INPUT_PULLUP);   //B
  pinMode(4, INPUT_PULLUP);   //Y
  pinMode(5, INPUT_PULLUP);   //Left
  pinMode(6, INPUT_PULLUP);   //Right
}

void loop()
{
  //These if statements are set up to make an "illegal press" (left and right) impossible.
  //It also prevents holding one button and fluttering the other to dash dance.
  //The values might be flipped as well.
  if (digitalRead(5) == HIGH && digitalRead(6) == LOW) {
    xAxis = 255;
  }
  if (digitalRead(5) == LOW && digitalRead(6) == HIGH) {
    xAxis = 0;
  }

  //Button if statements
  if (digitalRead(2) == LOW) {
    a = true;
  }
  if (digitalRead(3) == LOW) {
    b = true;
  }
  if (digitalRead(4) == LOW) {
    y = true;
  }

  writeGC();
}

//Write booleans/values into the controller state and send
void writeGC()
{
  d.report.a = a;
  d.report.b = b;
  d.report.y = y;
  d.report.xAxis = xAxis;
  GamecubeConsole.write(d);

  //Reset variables so the "controller" can return to neutral
  a = false;
  b = false;
  y = false;
  xAxis = 127;
}
Over Thanksgiving break I had ordered some of the same buttons they use in the Smashbox (Sanwa OBSF 24mm) and actually put together a cardboard mockup, but did not have the time to get it fully working (mainly problems with having the whole thing wired to an upside down breadboard, stuff kept falling out). I did not know about the Arduino Mega until today, I was using an Adafruit Pro Trinket 5V which only has enough inputs when you combine two buttons on each analog pin. I plan on finishing up my cardboard one next week and fastening down the wires, I have an old wooden wine box that is the same size as the cardboard box that I will eventually build it into if I like using it. If you can get the code running with a few switches hooked up to the Arduino Mega I would love to see how well it works with the Gamecube 5V supply. Though I'm on the fence if whether I would buy one because that puts it into $100+ budget territory, I kind of like the idea of the cheapy DIY Smashbox as an alternative to the $200 one.

Heres a picture of the cardboard Smashbox I made:
Spoiler
Show
Image
Heres a video of crazy easy dash dances:
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Thu Dec 15, 2016 8:58 am

I am pretty sure you can use an Arduino Uno with 5V.

Arduino Mega will most likely not work with the NintendoHood library, due to tight timing of instructions (and maybe even architecture specific), but I have not checked.

Edit: maybe it does work. I thought Arduino Mega was ARM based.
amiinal
Posts: 14
Joined: Wed Dec 07, 2016 12:48 pm

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by amiinal » Sat Dec 17, 2016 3:25 am

@patrickpf I got my mega and it can run good off the 5v supply. Tomorrow I'm receiving some Logic Converters so my mega can send and receive the signals between 5v and 3.3v. I actually have quite a similar "test" code to you. I believe I got the XY Tilt axis correct and I'll be testing it all tomorrow. Gravy actually posted the exact angles the tilt modifiers are so it's based on those.

@meneerbeer the Mega will work along with the Uno and yeah they both can run off the 5v yellow line. Just tested it.
meneerbeer
Posts: 212
Joined: Wed Sep 03, 2014 9:13 am

Re: Anyone know how to replicate Smashbox/Hitbox for Gamecube?

Post by meneerbeer » Sun Dec 18, 2016 9:04 am

You do not need a level converter. The GameCube's data line has a 3.3V pull up; you can put the Arduino data pin to input, if you want to communicate a high/3.3V value. If you want I can have a look what to change in the NicoHood code to do this.
Post Reply