A Game Pad For The Apple II

[Quinn Dunki] has been hard at work building a Teddy Top – an Apple IIc Plus modified for a road warrior. It has a 3.5 inch disk drive, runs at a blistering four megahertz, and has a beautiful integrated color LCD. It would be a shame to have such a great machine and no way to play games as they were intended, so [Quinn] set about building a game pad for her lovable Apple II.

The Apple II joystick port isn’t as simple as an Atari or Commodore joystick port. Where the bog-standard Atari joystick is basically just a bunch of switches connected to pins, the Apple II joystick is analog. Weird, and even weirder is the value of the pots in these joysticks: 150kΩ. Somehow or another, nobody makes pots in this value any more. Luckily the hardware in these joysticks is well documented, and shoehorning in modern components isn’t that bad.

The Apple joystick has a bit of circuitry – a 556 timer chip that reads the values of each pot and converts that into a stream of 0s and 1s for the Apple. The joystick [Quinn] found for her game pad is an analog thumb stick on a neat breakout board manufactured by Parallax. This analog joystick has 10kΩ pots in it, and that just won’t work with the 556 timer chip. However, since this is just resistors and a 556 chip, adjusting some of the values on the original schematics does the trick. [Quinn] added a few capacitors to her circuit, and everything worked beautifully.

With the electronics down, she turned her attention to the case for her Apple II road warrior enclosure. She recently picked up a 3D printer, which means she’s new to 3D printing. After spending a few hours designing a controller in 123D Design, she sent the files over to the printer. Warping happened. She tried an ABS slurry. The part was stuck to the bed. It took a few tries (purple glue sticks are awesome, [Quinn]), but she eventually got her plastic enclosure printed out, and the circuitry installed. The result is a portable computer, with a custom controller, playing Lode Runner. Can’t beat that.

1-Pixel Pacman

I usually see retro-gaming projects using tiny screens with a fair number of pixels (64×64) but what I really like is the look of making every pixel count. With this in mind I built 1-Pixel Pac-Man, the classic coin-op experience but with characters that consist of just one pixel. Playing a throw-back like this wouldn’t be the same without some vintage controls so I picked up an Atari joystick, patched it into a microcontroller, and started coding. Check it out:

Smartmatrix Bundle

This piece of hardware made the project build really easy: the Smartmatrix. [Louis Beaudioin] developed the Smartmatrix and it’s been in the Hackaday Store for a while now. The display module itself is a commodity item that is used in LED billboards. There are shrouded headers on the back of the panels, to the left and right sides, which allow them to be daisy chained. The Smartmatrix PCB plugs into one of these shields, provides a soldering footprint for the Teensy 3.1 which drives the display, and gives you the wiring to connect screw terminals from the PCB to the power terminals on the module. Why the need for beefy power jumpers? At full white the thing can draw about 3.5A — don’t worry there’s a power supply included in the bundle.

Also integral to making this look good is the diffuser panel which is frosted acrylic. The Smartmatrix is designed to be housed in a shadowbox frame; it even includes a frame backer board with a cut-out for the Teensy 3.1 so it can be programmed without opening the thing up. I like looking at the guts so I’m leaving my free floating until I come up with an interesting way to mount everything as one unit.

Programming Pac-Man from the Ground Up


If you haven’t looked into it before, the ghost AI and gameplay details for Pac-Man are absolutely brilliant. [Toru Iwatani] did a masterful job with the original, and you should take a look at all of the analysis that has been done over the years. The best collection I could find was the Pac-Man Dossier and I based most of my code on the rules described there.

Basically the ghosts have two modes, chase and scatter. The modes set the enemy targets differently; to points at the four corners of the board in scatter, and to points relative to the player in chase. The relative part is key; only the red enemy actually chases you. Another one of them looks at the red enemy’s distance and angle, and targets the reflection of that vector. Really easy, really clever, and results in enemy behavior that’s believable. It isn’t just the enemy movement, little touches like a speed penalty (1/60 of a second) for each dot the player gobbles up means the enemies can catch up if you continuously eat, but you can escape by taking the path already-eaten.

Library, DMA, and Extra Hardware

The hardware and software running the Smartmatrix made the display portions of the project really simple. First off, the Teensy 3.1 is fast, running at 96MHz in this case. Second, it has Direct Memory Access (DMA) which [Louis] used in the Smartmatrix library. This means that driving the display takes almost no CPU time at all, leaving the rest for your own use. This example of a game is under-utilizing this power… it’s totally capable of full-motion video and calculating amazing visualizations on the fly.

The PCB hosting the Teensy 3.1 breaks out several pins to one side. I’m not sure what I’ll add in the future so I actually used the extra surface-mount IO pins on the bottom of the Teensy to connect the Atari joystick (which is simply a set of switches). The are enough pads for two joysticks so I used pin sockets to interface the Teensy to the PCB so that I can get to it again later.

The kit also includes an IR receiver and remote, and also a microSD card to loading animations (there’s an SD socket on the PCB). The bundle in the Hackaday Store is a kit you solder yourself, but [Louis’] company, Pixelmatix, has a Kickstarter running for fully-assembled versions that come with a black remote and sound-visualization hardware.

Future Improvements

The game is fully working, but there are a few key things that I really want to add. The Teensy 3.1 has a single DAC pin available. I’m fairly certain the original coin-op game had mono audio. It should be possible to reproduce the sound quite accurately with this board. That would really make the project pop.

There are also a bunch of touch-ups that need to happen. I’d like to add an animation when the player is eaten by an enemy, and a countdown before the level restarts. The score, shown in binary on the right column, should be scrolled out in decimal when the game ends, and what’s a coin-op recreation without a high-score screen?

Inexpensively Replace A Worn Out N64 Joystick

The Nintendo 64 is certainly a classic video game system, with amazing titles like Mario Kart 64 and Super Smash Bros that are still being played across the world today. But, like finding new parts for a classic car, finding an original controller that doesn’t have a sad, wobbly, worn-out joystick is getting to be quite the task. A common solution to this problem is to replace the joystick with one from a Gamecube controller, but the kits to do this are about $20USD, and if that’s too expensive then [Frenetic Rapport] has instructions for doing this hack for about $2.

The first iteration of using a Gamecube stick on an N64 controller was a little haphazard. The sensitivity was off and the timing wasn’t exactly right (very important for Smash Bros.) but the first kit solved these problems. This was the $20 kit that basically had a newer PCB/microcontroller that handled the Gamecube hardware better. The improvement which drove the costs down to $2 involves modifying the original PCB directly rather than replacing it.

While this solution does decrease the cost, it sacrifices the new potentiometer and some of the easier-to-work-with jumpers, but what was also driving this project (in addition to cost) was the fact that the new PCBs were becoming harder to get. It essentially became more feasible to simply modify the existing hardware than to try to source one of the new parts.

Either way you want to go, it’s now very easy to pwn your friends in Smash with a superior controller, rather than using a borked N64 controller you’ve had for 15 years. It’s also great to see hacks like this that come together through necessity and really get into the meat of the hardware. Perhaps we’ll see this controller ported to work with other versions of Super Smash Bros, too!

Optimized Molds With 3D Printing

[Florian] has a few arcade games and MAME machines, and recently he’s been trying to embed objects in those hard plastic spheres on the end of joysticks. A common suggestion is to 3D print some molds, but even though that’s a great idea in theory the reality is much different: you’re going to get layer lines on the casting, and a mirror finish is impossible.

No, a silicone mold is the way to do this, but here 3D printing can be used to create the mold for the silicone. Instead of a few pieces of hot glued cardboard or a styrofoam cup, [Florian] is 3D printing a a container to hold the liquid silicone around the master part.

After printing a two-piece part to hold both halves of a silicon mold, [Florian] put the master part in, filled it up with silicone, and took everything apart. There were minimal seam lines, but the end result looks great.

In addition to making a 3D printed mold container, [Florian] is also experimenting with putting 3D printed parts inside these joystick balls. The first experiment was a small 3D printed barrel emblazoned with the Donkey Kong logo. This turned out great, but there’s a fair bit of refraction that blows out all the proportions. Further experiments will include a Pac-Man, a skull, and a rose, to be completed whenever [Florian] gets a vacuum chamber.

Arduino Synth Guitar Really Rocks

[Gr4yhound] has been rocking out on his recently completed synth guitar. The guitar was built mostly from scratch using an Arduino, some harvested drum pads, and some ribbon potentiometers. The video below shows that not only does it sound good, but [Gr4yhound] obviously knows how to play it.

The physical portion of the build consists of two main components. The body of the guitar is made from a chunk of pine that was routed out by [Gr4yhound’s] own home-made CNC. Three circles were routed out to make room for the harvested Yamaha drum pads, some wiring, and a joystick shield. The other main component is the guitar neck. This was actually a Squire Affinity Strat neck with the frets removed.

For the electronics, [Gr4yhound] has released a series of schematics on Imgur. Three SoftPot membrane potentiometers were added to the neck to simulate strings. This setup allows [Gr4yhound] to adjust the finger position after the note has already been started. This results in a sliding sound that you can’t easily emulate on a keyboard. The three drum pads act as touch sensors for each of the three strings. [Gr4yhound] is able to play each string simultaneously, forming harmonies.

The joystick shield allows [Gr4yhound] to add additional effects to the overall sound. In one of his demo videos you can see him using the joystick to add an effect. An Arduino Micro acts as the primary controller and transmits the musical notes as MIDI commands. [Gr4yhound] is using a commercial MIDI to USB converter in order to play the music on a computer. The converter also allows him to power the Arduino via USB, eliminating the need for batteries.

Continue reading “Arduino Synth Guitar Really Rocks”

Custom Controllers For Kerbal Space Program

kerbalKerbal Space Program is already a runaway indie video game hit, and if you ask some people, they’ll tell you it is the way to learn all about orbital dynamics, how spaceships actually fly, the challenges of getting to the mün. The controls in KSP are primarily keyboard and mouse, something that really breaks the immersion for a space flight simulator. We’ve seen a few before, but now custom controllers well suited for a Kerbal command pod can be made at home, with all the blinkey LEDs, gauges, and buttons you could want.

[Freshmeat] over on the KSP forums began his space adventures with a keyboard but found the fine control lacking. An old Logitech Dual Shock controller offered better control, but this gamepad doesn’t come with a throttle, and USB throttles for flight sims are expensive. He found a neat plugin for KSP made for interfacing an Arduino, and with a few modifications, turned his controller into a control panel, complete with sliders, pots, gauges, and all the other goodies a proper command pod should have.

[Freshmeat]’s work is not the only custom Kerbal controller. There’s a whole thread of them, with implementations that would look great in everything from a modern spaceplane to kerbalkind’s first steps into the milky abyss of space. There’s even one over on the Hackaday projects site, ready to fly Bill, Bob, and Jeb to the mün or a fiery explosion. Either one works.

Thanks [drago] for the tip.

The 128 Button, 6 Axis, 17 Slider, 4 POV Hat Switch Joystick Controller


[Paul Stoffregen], creator of the Teensy series of dev boards, previously implemented a six-axis joystick for Teensyduino, the Arduino library for the Teensy. He had originally tried 8 axes, but a few problems cropped up, deadlines approached, and he left it as is. A few recent projects gave him some insight into how to implement a joystick with more than six axes as a USB HID device, so he started looking at how to read an improbable amount of pots and buttons for a USB joystick.

So far, the biggest problem is figuring out what software can actually use an HID joystick with this many controls. The answer to that question is none. The Linux-based jstest-gtk is able to read 6+17 pots, the four hat switches, but only 64 of the 128 buttons. A user on the Teensy forums, [Pointy], has been working on his own joystick test app that works on Linux Windows, but testing the joystick on Windows is an exercise in futility for reasons no one can figure out.

As for why anyone would want a six-axis, 17-slider, 128-button joystick, think about this: with this much control, it would be relatively simple to build the MIDI controller to end all MIDI controllers, or a cockpit simulator for everything from a C172, 737, to a Kerbal interplanetary cruiser. That’s an impressive amount of control, and all from a $20 Teensy dev board.

Further testing of this Teensy joystick is desperately needed, so if you’re able to help out drop a note in the forum thread.