[BUILD] MAME4ALL DTV box
  • http://imageshack.us/photo/my-images/818/uawh.jpg/

    http://imageshack.us/photo/my-images/577/oz8m.jpg/

    See some of my posts on this board for info on how it was put together.

    Essentially a 4-way suzo-happ joystick with 5 buttons, 2 player buttons, a coin button, escape button, and a button to access the ingame menu.

    A lot of effort went into selecting games that would work with the 4 way joystick and button layout.

    Buttons and joystick holes on the box required drills of various sizes. For the joystick and buttons on top, a hole saw was used along with a power-drill. I used a dremel with an engraving attachment to carve out a slot for the HDMI cable. Holes for the joystick were made so that flat head screws would be flush with the case. I used a step drill bit to manually create a gap for the flat head to fit. I did this by hand because it was a careful operation.
    Bought some rubber feet to stick under the box for grip on a table.

    A microusb cable was hacked up a bit to fit in the box and into the Pi's power socket, and the positive and negative wires from the cable were soldered to a 2.5mm barrel plug - negative tip, positive outer. This allowed the unit to be powered with a 5V DC 1.5A wallwort you typically get from electronics hobbyist shops.

    Joystick and all buttons are connected to GPIO holes on an adafruit cobbler breakout board which has a breakout cable over the Pi's GPIO pins.
    I screwed the pi through the base of the box. For some reason I needed to drill the Pi's board holes a bit with a 3mm drill to make the screw fit through. For some reason, the holes on the pi motherboard are a bit small for normal size screws. Go figure.

    The adafruit retrogame daemon was compiled, and programmed to give each of the joystick and buttons a representative key-press. uinput kernel module was called to start at boot time. Mostly I left the default MAME keyboard layout intact. I used all the available GPIO pins. If I were to have a six button (ala streetfighter), I would have had to remove one of the other buttons (maybe the player 2 button, or the in-game menu button)
    The adafruit mame page proved to be an inspiration:- http://www.adafruit.com/blog/2013/06/04/retro-gaming-on-raspberry-pi/

    the Pi boots into MAME directly with no keyboard intervention necessary (edited /home/pi/.profile to achieve this). Initially it starts the retrogame daemon, and then it starts a small sleep script with message to give me an opportunity to hit CTRL-C and break the autobooting do to maintenance on the box (should a keyboard be connected to the USB on the pi). Then it boots the emulator. When finished playing the game, you can hit the escape button to exit the emulator (which is programmed to ESC), and from there the profile file then executes a shutdown of the pi.

    Actually the entire unit proved to be a little expensive, but the end result was well worth it. The arcade parts being the expensive bits, then the pi, the project box, and then the power wallwort. Also I needed to get some of the tools required (such as the dremel).

    In any case, it made a good present for a family member who has a pacman addiction. Plus it plays a lot of other games that you can get away with a 4-way joystick and 5 buttons. The in-game menu button let me program the controls for each game without requiring a keyboard, but I did have to manually set it up first with a keyboard to allow one of the buttons to be the UI select button.
    Some games I put in needed some trickery with the button layouts. Racing games had a button per gearshift (eg. sprint 1, sprint 2). Time Pilot and gyruss are playable with 4-way joystick (mostly). Battlezone, toobin', and vindicators required the 4 buttons for movement controls and they needed to be set up especially. Karate champ is doable if you are comfortable with the button layout instead of a second joystick. etc. etc.
    Some games - mainly racing games - are barely playable without a dial though. (spy hunter is a prime example)

    If I attempt this again, I will attempt to use 8-way joystick Sanwa arcade parts, and go for a 6 button model for the full street fighter experience.... and find a way to add a dial for the racing games. I might try a different board other than the pi (maybe the cubieboard) so I can get the full AdvanceMAME experience working at a decent speed.
  • That is awesome! Great job, nayphee! And yes, the dreaded ~3mm holes. They are in fact 2.9mm holes. Makes all the damn difference. =P

    http://www.raspberrypi-spy.co.uk/wp-content/uploads/2012/11/Raspberry-Pi-Mounting-Hole-Template.pdf
  • That is really great looking nayphee. Great writeup! PM me your address and I'll send out a PiMAME sticker.
  • Only real failure of this unit is the GPIO wiring to the joystick and buttons. For some reason it feels "slow", and a dedicated USB to controller wiring board, such as the xin-mo or I-pac2 would have been a better fit.

    I hope to improve on this with a change of joysticks (Australian MCA units!), an i-pac interface, and a cubieboard instead of a pi. Not yet known if the pimame builds will work on a different board, but I think it's worth trying. Will keep all posted.
  • Ive heard reports that the standalone builds work on other boards, but I have yet to personally confirm that. A cubieboard and beaglebone black are two devices id like to play with and port pimame to.
  • I managed to do a standalone build on a cubieboard2 based on "Cubian", and I had AdvanceMENU work, but for some reason when I try to start a game from the menu and run AdvanceMAME, the TV I'm using for HDMI loses connection and I can't see what's going on. No sound either.

    I'm pilfering your Pimame advmame.rc and advmenu.rc files for my cubie, but I'm hitting a wall here.

    Essentially both the pi and cubian use arm7l builds don't they? I will try creating a pi user on the cubie to try and trick it into loading Pimame. I'll then see what happens.
  • I tricked the cubieboard into loading pimame with the script, but there are issues

    Firstly, cubian needs to have unzip installed, a user named pi created and given sudo rights, and also the framebuffer device needs the right permissions:-

    $ sudo nano /etc/udev/my-rules.d/framebuffer.rules
    Then put a line in it like this
    KERNEL=="fb0", OWNER="root", MODE="0660"
    and add cubie to the video group
    $ sudo usermod -a -G video cubie

    That's all well and good, but mame4all-pi is build with bcm_host which I imagine is a shared object for the broadcom chip in the pi. Well the cubie has mali, so it's a no go there I think.
    Advancemenu worked, but trying to start advancemame threw my HDTV out of whack with "Invalid format" on the screen, possibly due to screen configs or something. This happened on my native build as well, so it could just be a configuration issue.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!