Aleksandar Krstikj.com

BarTop Arcade Cabinet running MAME32 (convering analog joysticks to digital d-pads)

by on Jun.12, 2014, under Gaming, Hardware, IT

Well, I finally got around to documenting a project that was started a while back, and has been on hold ever since. I’m talking about my attempt at building myself a Bar-top Arcade Cabinet. The important parts of the project (mainly controls) are done, and the thing functions perfectly. What remains to be done is to build an enclosure and put everything inside so that the thing actually starts looking like an Arcade Machine. Right now, it looks like a transformer that has trouble shape-shifting 🙂

Before you read further on, I suggest you watch the YouTube video I made showing it off. Afterwards, feel free to move on and read how the controls were done, as this is the main custom part of the arcade itself.

Ok, so I take it you watched the video. And I also take it you didn’t listen to my advice of getting digital game-pads and not bothering with analog joysticks. Or maybe, just like me, you had analog joysticks laying around and just want to replicate the same thing I did. Whatever the case, read on.

First thing’s first. I want to give credit where credit is due. I read a couple of interesting things regarding joysticks, and their conversion to digital d-pads on the following pages:

http://www.epanorama.net/documents/joystick/pc_circuits.html#atari_pc_converter
and
http://www.allpinouts.org/index.php/Joystick_PC_Gameport

The second page is where I saw the circuit I needed, in order to do the signal conversion. I’ll copy the ‘important’ schematic here just in case the original link disappears:
Digital Joystick

What you see on this schematic is what I’ve placed on the brown PCB. So let’s go through it:

The buttons: As you can see, they function in a very simple manner in which a button press is just shorted to ground. And depending on which pin on the connector is shorted, the corresponding button is fired. In this example, the button pins are 2, 7, 10 and 14.

The joystick (movement): I cannot think of a better way to explain this than what’s already on the ‘allpinouts’ site: “These pins are analog inputs and must be between 0 and 5 volts, 0 volts represents 0 (00000000 in binary) and 5 volts represents 255 (11111111 in binary). When a digital joystick is used, they generaly send a 2.5 volts signal when no buttons are pressed, go down to 0 volts when the up or left button is pressed and 5 volts when the down or right button is pressed.”


And that’s about it. You build the simple circuit and you’ve essentially turned an analog joystick into a digital d-pad. There’s just one more thing. If you remember from the video, I actually had 6 transistor/resistor pairs. Two for player 1 movement, two for player 2, and another two on top of that. And I also mentioned they function as button clicks. So let me explain what I mean.

Regular joystick movement goes on the x-axis and y-axis (horizontal and vertical / left-right and up-down). Some joysticks also have a z-axis, and perhaps even one more on top of that (think of these additional axes as the analog trigger buttons on modern day controllers). This is sometimes used as throttle control in airplane simulator games. What I did was apply the same principle as before to these axes’ variable resistors. So in my airplane example, if your throttle is completely down, I register it as 5 volts (button click), and if the throttle is completely up I register it as 0 volts (another button click). If the throttle is in the middle (2.5 volts) I consider both buttons not pressed. It’s a bit weird, but it made sense to me as I really didn’t have a need for an analog ‘switch’ while playing old arcade games. This way, I got four extra buttons out of two analog dials.

That’s pretty much it. After you’ve done all this, your analog joysticks will behave as a digital game-pad. Or you can just buy a game-pad in the first place, the choice is yours 🙂

Feel free to post questions and/or comments. I’ll try to get to them whenever possible. Thanks for reading!

:, , , , , , , ,

Leave a Reply