DIY, Homebrew, Retro

DIY Apple II Gamepad

May 19, 2017

Modern gaming systems all use analog joysticks to precisely control movable components in games. Many people may not know this, but Apple built the II to accept a true analog signal from each of the paddle axis from the DB9 port on the back of the Apple II all the way back in 1977! This gave games on the II and it’s successors much smoother feeling directional control as well as more precision, which made the Apple II joysticks superior to their competition, but it made them quite a bit more expensive too. Fast-forward to today, and I can buy a vintage Apple II joystick for an average price of $33. While this price is not too steep, I never did like the feeling of those old first-gen joysticks. Here is what they looked like for those who do not remember:

e0109011_1848333
This is what an original Apple II joystick looked like.

These things sure were sweet compared to their competition, but the shorter/fatter/softer modern analog stick on console game controllers like PS2/3/4, Xbox/360/One, etc are just so much nicer and more comfortable to use. Why not build a controller for the Apple II that used that style analog stick? For that matter, why not build it in the now-common configuration of a two-handed controller where left thumb controls the stick and right thumb presses the buttons?
I set out searching Google for some answers and I quickly hit the jackpot with Quinn Dunki’s blog. Quinn (whom I have never met) is one of the hosts of the Apple II podcast ‘Open Apple’ and a very active member of the Apple II community, from what I can see. Quinn has a great blog and in one of her many awesome blog posts (http://quinndunki.com/blondihacks/?p=2225), she shares the original schematics for the DB9 game port on the back of the Apple II and she shows how she used a set of stacked capacitors to change the analog signals of the Parallax 2-axis joystick by 0.308μF so that it will feed the computer the proper signal changes that it needs when we move the joystick.

AppleIIGamePad1
Quinn Dunki’s schematic
IMG_0740
Game Port Pinout
IMG_0741
Original Apple Diagram

That’s it? That’s the only conversion needed to make a modern analog stick perform as an Apple II joystick? How could I not try it? Apple published the details on how to make your own joystick and now Quinn Dunki has written a schematic to build it with off the shelf parts? It’s on like Donkey Kong!
I don’t want to repost Quinn’s experience building this controller and I don’t want to plagiarize her blog, so I just wanted to show the schematic that she shared via her blog and the Apple source schematics that it was derived from. I also copied her BASIC code for visualizing the state of each input on the gamepad down below. (Thanks for sharing your knowledge with me Quinn. I really enjoy your blog and podcast.)
I purchased all of the components that I needed to build the Apple II controller of my dreams and I set out to build it. My parts list is as follows:
From Adafruit.com:

  1. Tactile Switch Buttons (I needed two, they only came in a ten pack) ($2.50/10, $0.25 ea) = $0.50
  2. Parallax 2-axis Analog Joystick (x1) ($6.95 ea) = $6.95
  3. Adafruit Perma-Proto Half-sized Breadboard PCB – Single ($4.50 ea) = $4.50
  4. DE-9 (DB-9) Male Plug to Terminal Block Breakout ($2.95 ea) = $2.95

From eBay.com:

  1. 1/2W 470Ω resistors (2 needed, comes in 10 pk) ($1.67/10, $0.334 ea) = $0.667
  2. 0.100μF capacitors (6 needed, comes in pack of 20) ($2.50/20, $0.125 ea) = $0.75
  3. 0.010μF capacitors (2 needed, comes in pack of 20) ($2.38/20, $0.119 ea) = $0.238

From my own stock:

  1. Misc Wire (I used wire that I had already. It is all using ethernet wire, some solid and some stranded. If I had to do it again, I would use stranded everywhere the solid didn’t really give me any benefit.) = $0.00

My cost estimate based on parts would be $16.56 to build a modern style gamepad with two buttons and two axis of analog goodness.
The first thing that I found out when I sat down to build the gamepad was that this PermaProto Breadboard from Adafruit was awesome! It was so great because it was configured like a breadboard, obviously designed for projects, yet it was made out of proper circuit board and had copper contacts designed for each hole in the breadboard to solder and make your project more permanent than a standard breadboard. It was also made with very acceptable build quality. The second thing that I noticed is that the way the analog stick was designed it had two pins at each corner that were aligned so that they would be in a common row or column on the breadboard and I would need them to be wired to separate circuits. Since the columns in the breadboard were all connected together with the copper traces on the bottom side, I would only be able to install the analog stick in one direction, and it would put the two axis in my joystick in the wrong orientation for my lay out. I decided that I would be able to overcome this mistake when I needed to and moved on. I installed the 0 and 1 buttons making sure that I would have enough room on the PCB to connect the wires and resistors to them properly. Then I installed the stick making sure that I had the same room for connections. Finally, I installed the capacitors in parallel.

IMG_5737
My gamepad is coming together nicely, but the PCB traces will not allow me to turn the joystick the way that I had designed the gamepad to work. What to do?

I held the gamepad in my hands and I just didn’t like the fact that I had to hold it vertically in order to position the joystick properly. The point of this project was to make a modern feeling controller to play games on my Apple II. After debating it for a bit, I decided that the board was also a bit smaller than I wanted it to be. So I decided to cut the board into two pieces and create a gap between them. This would allow me to rotate the half of the PCB that contained the analog stick 90 degrees and use it in the familiar horizontal layout that a console game controller is made with. I knew that it would mean that I would have to connect the positive and negative buss on the left section of the board with the right section via some jumper wires, but I didn’t think that seemed too difficult to work out.
After filing a straight line on both sides of the PCB where I wanted to separate it, I carefully started to bend the PCB, putting pressure on each side of the score mark, I separated the PCB cleanly, without destroying the remaining pieces of the board or any components on it! I rotated the left side PCB 90 degrees clockwise and my gamepad was now laid out the way that I had first designed it. Then, I added the positive and negative buss jumpers to connect the two PCBs together. With that out of the way, I connected the cable to the DB9 connector and to each circuit on the two PCBs and I tied it all down to some closed cell foam padding that I had laying around. That should keep the strain off of the connections until I can make up a proper case for it. I also added another 0.100μF capacitor to each axis circuit because my multimeter was showing that each one was closer to 0.075μF than 0.100μF. 4 * 0.075μF + 0.010μF = 0.310μF, which is what the design called for.

IMG_5763
Here is the completed gamepad prototype.

It was finally time to fire up the Apple II and test the new gamepad. Back to Quinn’s blog again to grab the BASIC code for testing the various inputs involved:

 10 A =  PDL (0)
 20 B =  PDL (1)
 30 C =  PEEK (49249)
 40 D =  PEEK (49250)
 50  PRINT "X:";A;" Y:";B;
 60  IF C > 127 THEN  PRINT " 0";
 70  IF D > 127 THEN  PRINT " 1";
 80  PRINT
 90  GOTO 10

I typed this in on the Apple II keyboard and then typed “run”:

It works great! Now to try it on a game. Donkey Kong was a game that I was trying to play via keyboard controls and seemed like a great game to test to controller on. It uses both axis of the joystick and the GAMESWITCH0 button for jumping:

Everything worked just like it was supposed to! This was a very fun project. It was not as challenging as I thought it would be when I first had the idea, and the majority of that has to do with Quinn Dunki’s design and her blog. She literally took all of the guess work out of it and by following her design, I was able to build the gamepad that I wanted. I had hoped that the Adafruit PCB was going to be the perfect size and layout for building this gamepad and it just wasn’t. That being said, the PBC project board from Adafruit was excellent to work with and I would certainly use it again for my next small project.
At some point in the future, I am going to try to design a proper case for this and print it out on a 3D printer.
Stay tuned…

You Might Also Like

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.