iPhone Life magazine

Tutorial: Play MAME games on your iDevice

If you come from Windows Mobile and are into playing MAME arcade games, you may well remember my full article dedicated to the emulation of arcade machines, including MAME, on the platform. (Note that the linked article doesn't show inline images; if you need them, check out THIS instead.)

Fortunately, on the iDevice, it's also possible to play MAME games. No, unlike on Windows Mobile, not the newer, vastly superior (NeoGeo / CPS), “only” the older ones, but it's still more than nothing, isn't it? And it's free – and is also compatible with several Bluetooth game controllers (see below).

There are two ways of doing this. The first requires jailbreaking your iDevice, the second “only” having a (paid) developer account and a Mac with Xcode. Any iDevice will do and the application is universal running on both small-screen devices like the iPhone and the iPod touch and large-screen ones, that is, the iPad. Of course, the faster devices, the better.

Using the Cydia-based version on jailbroken devices

It's all very easy: you just search for “imame” in Cydia and select “iMAME4All” from the list:



(Disregard the other entries in the screenshot above, particularly “iMame with iCP support”, which is an experimental version of my build of the fully iControlPad-compliant, Cydia-compatible version. You won't want to install it until I officially release it. See THIS for more info on my progress.)

Install it as usual (tap the “Install” button in the upper right corner.) After this, you can freely drop your ROM files (they can be ZIPped) into /var/mobile/Media/ROMs/iMAME4all/roms on the iDevice and start the emulator.

Using the iControlPad-enhanced Xcode version on not (necessarily) jailbroken devices

If you have a Mac and also a paying developer account, you can easily deploy the emulator on it, even if you don't jailbreak your device. Yes, it'll run on even the iPad 2 with an iOS version 4.3.4+ or the iPhone 4S, which are both non-jailbreakable right now. I've written a full tutorial on how this needs to be done:

Generally, all you need to compile iMame4All for Xcode for your iPad is:

1, create a /Projects/mame/iMame4All-iOS4 directory in the root of your Mac OS X drive

2, copy all the subdirectories from the ZIP file there (first, download it from HERE, of course)

3, download and install Xcode 4. (The rest of my tutorial discusses only Xcode 4+ it so that you can also compile for iOS 5. Previous Xcode versions, while, personally, I prefer them to the new version, can't compile for iOS 5.) Start it; load /Projects/mame/iMame4All-iOS4/Xcode/iMAME/iMAME.xcodeproj

4, double-click the project name in the upper left corner and navigate to the "Build Settings" pane (third from the left):


5, enter "sign" in the search field:

6, in turn, click all of the three rows containing "Les Bird" and change the values to "iPhone Developer" (highlighted in the next screenshot):

If you do re-set all these, the results will be something like this (with a different name after "iPhone Developer (currently matches iPhone Developer", in the parentheses, of course):


Congratulations, you can now compile (just click the arrow in the upper left corner) and deploy the project! Just remember to copy the game ROM ZIP files via iTunes File Transfer, as you would do with AppStore games.

Note that some people complained about the missing corevideo.h. Interestingly, I haven't been able to reproduce the error, not even on a completley re-downloaded, clean copy. If you do run into this problem, check out the posts HERE for a solution.

Now, let's turn to the question of controlling the game with external hardware game controllers, as opposed to the on-screen one.

Bluetooth game controllers: iControlPad, iCade, WiiMote

The two versions, as of today, also differ in that the Cydia-based one

- supports iCade (or iControlPad in strictly iCade mode) but not the native (analogue) iControlPad mode

- supports WiiMote (but not the analogue joystick add-on, the Nunchuk, as is also presented in my demo video)

while the Xcode-based one, in addition to iCade, also supports iControlPad in native iControlPad (A+X) mode, but, unlike the Cydia-based version, doesn't support WiiMote.

The two versions' dialogs shown after pressing any button (or, with the Xcode version, the analogue joysticks) are also different. As the Cydia version only knows iCade (but not iControlPad), it doesn't offer a way of selecting from between the two:



The Xcode version, on the other hand, does:



You'll want to prefer the native (analogue) iControlPad to the (digital) iCade in some games like the well-known Hydra so that you can control them via the analog stick, which is highly important with this game. I've even created two demo videos showing the difference. THIS shows the (preferable) analogue version with partially tiltable ship and THIS (from 2:10) the digital (with this game, unplayable) controller.

Note that the on-screen controller of iMame is also analogue by nature; that is, it allows for partial ship tilting only in Hydra. Also note that I've shot another video showing the granularity of the iControlPad in analogue mode. It's HERE, utilizing the excellent iControlPad-compliant game Vertex Blaster. The video shows both firing and movement from the slowest to the fastest rate and in random directions as opposed to the 4 or, in better cases, 8 achievable with digital joysticks. (Incidentally, HERE's another video showing the analogue controller goodness with Vertex Blaster. The second half of the video shows the same controller in digital-only (iCade emulation) mode, this time controlling the also excellent title “Mega Worm”.

It's very important to only connect your Bluetooth devices (any of the three of them) after tapping “Start” so that you're on (at least) the game selection screen. Otherwise, if you connect it right after starting and not even going to the ROM list, the icons (including “Start”) will be hidden after connecting, which can only be fixed by completely killing and restarting the app. You can see my having done this in several of my demo videos.

This also applies to going to Options and connecting to one (or more) WiiMotes – it must also be done after tapping Start. A demo video of controlling the same game (Hydra) via a WiiMote is HERE. It also shows (see 1:40) Nunchuk isn't supported.

Button settings

The three Belutooth controllers have vastly different hotkeys in the emulator. Some examples:

Wii / iCP / iCade-mode iCP
iMAME Menu selection: A / n/t / A
Game start: B / B / right button at the bottom
Coin (credit): - / Select / nothing(?)
With the Wii controller, the (of course, digital – again, Nunchuk isn't supported) D-pad directions are rotated by 90 degrees. This is why I keep the controller horizontally in the dedicated video.

Additional info

My already-linked “iMAME4all report” thread has a lot of additional, game-specific info on which of the two (native, analogue iControlPad vs. “legacy”, emulated digital iCade) modes should be used. In general, the iCade mode should be preferred with games not supporting analogue controls at all (most of the old arcade titles belong to this category) because of the much higher speed. Let me quote myself as these posts contain a lot of compatibility information as well:

“I've played quite a bit with the current (sept. 7.) Xcode version (compiled for Release) on my non-jailbroken iPad 2 running iOS5 b7 together with my iCP.

I've found out the following:

- in some games, you WILL want to use iCade mode; otherwise, the game will be just unplayably slow. An example of this is R-Type 2. If you enable iCP mode (as is the default in iMAME), even using the digital D-Pad will result in major choppiness, let alone the analogue sticks. If you use the latter, the game becomes unplayable (1-2 fps in some cases meaning you'll die ASAP.)

- less demanding games like Zaxxon (ROMNATION version) or even R-Type I – Japanese version (also from ROMNATION) work just fine in iCP mode and with the analogue joystick.

- as far as NeoGeo is concerned, Metal Slug 2 works better than under FB on an Xscale 255-based Windows Mobile-based 624 MHz Dell Axim x51v. The framerate is the same (choppy but still playable) but there are no audio problems, unlike on WinMo. This is certainly good news and a pleasant surprise – I've expected far worse. (Tested this in strictly iCade mode; there, iCP was perfectly usable to control all aspects of the game.) Of course, all this was on the powerhouse iPad 2 – I don't think MS2 is playable on lesser hardware.

All in all, if you do own an iCP, go get the emulator, even if you don't JB your iPad 2.”

“Of the bunch, I've only found Hydra ( Romnation id=23299 ) to really depend on the analogue controller (the game is plain unplayable with the D-pad: you just can't steer the ship.)

Note that I haven't had any speed or other problems with this title when using the nubs, unlike with R-Type II (or Star Wars, see below).

The rest I've downloaded from rom-world was either 1, incompatible; 2, missing some files; 3, not having any advantage of using the analogue joystick. All tested under the Xcode version of iMame x.10, running on iOS5 / iPad 2.

I, Robot 85.00 KB id=23203 (no advantage in using the analogue?): works

Star Wars id=21400 (no advantage in using the analogue): major slowdown and, finally, disconnection

Star Wars Trilogy id=36777 989.12 KB: non-compatible
Star Wars Arcade 14.49 MB id=35896 : non-compatible

Space Harrier id=21648 : missing file ERROR
Space Harrier (8751 315-5163) id=42324 : non-compatible

Paperboy (rev 1) 97.18 KB id=22122 : non-compatible
Paperboy (rev 2) 31.50 KB id=22121 : non-compatible
Paperboy (rev 3) 272.34 KB id=22361 : missing file ERROR”

Want to master your iPhone and iPad? Sign up here to get our tip of the day delivered right to your inbox.
Email icon
Want more? Get our weekly newsletter:

Werner Ruotsalainen is an iOS and Java programming lecturer who is well-versed in programming, hacking, operating systems, and programming languages. Werner tries to generate unique articles on subjects not widely discussed. Some of his articles are highly technical and are intended for other programmers and coders.

Werner also is interested in photography and videography. He is a frequent contributor to not only mobile and computing publications, but also photo and video forums. He loves swimming, skiing, going to the gym, and using his iPads. English is one of several languages he speaks.