Posts: 1
Joined: Tue Jul 23, 2013 1:09 pm

2 joysticks cost effectively

Tue Jul 23, 2013 1:18 pm

I'm trying to make a mame coctail cabinet to play games like Ms Pacman, Galaga and Frogger with the pi, and want to keep the costs down as much as possible to still have a good end-product. I'm thinking about using the GPIO to wire 2 joysticks with 2 buttons per player, with 1p/2p buttons and a coin button. is it possible? If not, what's the best way to approach this?

Posts: 34
Joined: Fri Jun 28, 2013 1:26 pm

Re: 2 joysticks cost effectively

Tue Jul 23, 2013 2:41 pm

I have not directly used the GPIOs myself, but if I am reading this page right,, then the Pi has at least 17 usable GPIO pins.
For what you want, each joystick requires 4 pins (some might only need 2, but most use 4), and each button one.
So 2 joysticks + 4 buttons + 3 coin return/etc buttons = 15 buttons total. So in theory it should be fine, but you might want to read that webpage fully to make sure you can use at least 15.

Posts: 16
Joined: Mon Jun 24, 2013 2:20 pm

Re: 2 joysticks cost effectively

Tue Jul 23, 2013 3:42 pm

I use MAM4ALL and right now I'm having trouble using one button as both the coin button and the player1 button. My controller has 3 buttons and a joystick and I haven't yet figured out how to get 3 buttons to do everything I need.

Posts: 15
Joined: Sun Feb 24, 2013 8:29 pm

Re: 2 joysticks cost effectively

Wed Jul 31, 2013 2:10 pm

I've noticed there's a lot of discussion about having a 2 player emulator set-up the this forum. Having built a few MAME like boxes in my time I thought I'd chip in.

On the Pi there are 17 usable GPIO pins and 1 for ground. The essentials for a 2 player set up are:

An exit game button - 1 pin - you can use multiple keys to do this but I've never liked that
P1 and P2 start - 2 pins
P1 and P2 coin - 2 pins - I'd never make P1 start and P1 coin the same button
2 joysticks - 8 pins

That's 13 which only leaves 4 pins for buttons - unless you are only going to have 2 buttons per player it isn't enough.

That means a 2 player set-up, with more than 2 buttons per player, will need to use USB input for at least one player. There are a few ways to do that:
- Use an iPac - but that's expensive
- A keyboard hack - take an old keyboard and hack it up so you wire your joystick and buttons into it
- Use an old USB controller and hack it up so you wire your joystick and buttons into it

A quick look on e-bay brings up a USB joypad for about £3.50. It won't be very good but that's not the point as you'll replace the pad and buttons with something acceptable to you. It also has the advantage that you can get your emulators working with the joypad before doing the hack.

Return to “Gaming”