[Garrett Greenwood] plays Smash Brothers, and apparently quite seriously. So seriously that he needed to modify his controller with five Neopixels so that it flashed different color animations according to the combo he’s playing on the controller; tailored to match the colors of the moves of his favorite character, naturally.
All of this happens with an ATtiny85 as the brains, which we find quite ambitious. Indeed, [Garrett] started out thinking he could simply read each of the inputs from the controller directly into the microcontroller at the heart of the whole thing, but then counted up how many wires that would be, and looked at how many pins he had free (six), and thought up a better solution.
[Garrett]’s routine instead reads the single line that the Gamecube controller uses to send back to the console. The protocol is well understood, using long-short and short-long signals to encode bits. The only trick is that each bit is sent in four microseconds, so the decoding routine has to be fairly speedy. To make it work he had to do quite a bit of work. More about that, and the demo video, after the break.
[Garrett]’s current post only covers the hardware and use of the thing. We’re waiting with baited breath for the software writeup. To whet your own whistle, check out [Garrett]’s Github and browse through the code yourself. Our cursory read-through includes the following highlights:
- Gamecube protocol handled in an interrupt routine written in assembler
- Animations handled using the Protothreads library for lightweight microcontroller threads
- Generally sexy coding, including a nice hand-built Makefile (the way we like ’em)
We don’t know how much free space you have, [Garrett], but we think it’d be cool if you could squeeze a serial bootloader into the chip, so that you can update it more easily without opening and closing the case. TinySafeBoot or (going old-school) [Peter Dannegger / “Danni”]’s fastboot might do you well.
Oh, and [Garrett] emailed us to say he’s looking around for a plastics company to manufacture transparent backs for Gamecube controllers like his, and is thinking of running a Kickstarter if he can find one. Keep your eyes out.
Thanks [Bigjosh2] for the tip!
Nice work!
He mentions that his character of choice unleashes a blue flashing hexagon when he pushes down+special, so he must be a Fox / Falco / StarWolf player.
Why guess? He straight up says it was designed around Falco at the start of the video.
Couldn’t watch the video: my sound is muted here.
Good mod, I like that it decodes the same signal the console is seeing rather than wires soldered to buttons everywhere, also somewhat modular.
Suggestions
firing the laser and over dashing should trigger a ‘scan’ effect across the addressable chain though since that functionality is wasted atm. For extra nerd cred. Also you should know which way your character is facing to do these effects in the right direction, sans mario cap-flipping you.
There’s really no practical way to tell facing in a Smash game from the controller end of things. It has no way of knowing if you’re grounded, tracking turnarounds and shield state and everything… there are too many corner cases that are literally impossible to detect just from controller input. It’ll likely be wrong more often than it’d be right.
Well done nice video production as well, quick, nice explanation, thanks!
this is what those afterglow controllers should really do