Sunday, June 16, 2013

MAME on MICILE (Part 1)


Overview
This is the first part of a multi part series on running the MAME (Multiple Arcade Machine Emulator) on the MICILE development system.
  • Part 1 will show how to play a simple MAME game (this article you are reading)
  • Part 2 will show how to write a front end to pick different MAME games (coming soon)
  • Part 3 will show how to construct a little arcade cabinet to hold the tablet in viewable position so you can play all day long. (coming soon)
This not intended to be an exhaustive guide, there is lots of information about AdvanceMAME and Linux on the internet, so if you have more in depth questions, there is a wealth of information on the internet on how to fully use a MAME emulator on a Linux system.
Parts Needed
  • MICILE development system
    The MICILE development system consists of hardware and software that allows a linux based operating system to run on Allwinner A13 tablets. It also allows the easy development of python applications that run on the tablet. www.micile.com

    Note: You must be running a MICILE Operating System build of at least Beta1 RC3 E6 for these instructions to work.

    You must be running a MICILE Operating System build of at least "Beta1 RC1 E1". This first batch of pre-release MICILE development system tablets shipped with "Beta1 RC1". See the MICILE web site for how to check your operating system version and how to upgrade to the latest version of the operating system.
  • MAME (Multiple Arcade Machine Emulator
    MAME is an open source program which allows the emulation of arcade video games on a variety of hardware. It is so versatile that it has been successfully ported to run on everything from regular PC computers, smart phones, and even on a digital camera. MAME needs the ROMS for games in order to play them. A ROM is a dump of the software for the arcade game. http://advancemame.sourceforge.net/

    You will also need ROM dumps from video game circuit boards that you own.  After purchasing a video game circuit board, you can get ROM dumps from places like www.romnation.net for games that you own the circuit boards of.
  • Cheap chinese game pad off of eBay
    These are cheap generic gamepads sold on ebay that use the DragonRise chipset. I like cheap things. I got mine from this vendor on ebay. www.ebay.com
Assemble the hardware
  • Turn off the MICILE tablet if it is on by holding down the power button for 10 seconds and then releasing
  • Plug the gamepad into the tablet using the tablet's micro USB to USB Host adapter cable.
  • Turn on the tablet by holding the power button down for 5 seconds and then releasing. If needed, configure the MICILE tablet's wifi.
  • Wait for the tablet to finish booting. When the tablet has completed booting it will show its IP address on the screen.
  • Activate analog mode on the gamepad by pressing the ANALOG button on the joystick. The analog LED will be lit when the gamepad is in analog mode.
Installing MAME
  • MAME comes preinstalled on the MICILE tablet. I bet you thought this step would be a lot harder, didn't you?
Adding ROMs to MAME
  • When the MICILE tablet boots, it will show you its IP address, as shown in the last picture of the Assemble the Hardware section. We will use that IP address to access the MICILE tablet. The MICILE tablet shares a folder on the network which the MAME ROMs for games should be placed in.
  • To access the share folder, start by clicking on the Windows Icon on your taskbar.
  • That will bring up the start menu. Type in two backslashes followed by the IP address of the tablet. The backslash key is usually located above the space bar on the keyboard and is shared with the question mark.
  • A network window should appear showing the directories that the MICILE tablet is sharing on the network.
  • Double click on the folder mame_roms. A login window should appear the first time. Login using the the username of root and a password of password
  • Now drag and drop in your MAME ROMS. In my case, since I own an original Street Fighter II Circuit Board from a vintage standup arcade game of Street Fighter II and I feel like playing Street Figher II, I will be installing the ROM for Street Fighter II in this example.
  • Here is a shot of my vintage Street Fighter II circuit board. It is amazing how much they were able to do with such little computing power 20 years ago. Look at the size of those chips!
Launch MAME
  • Since we don't have a front end for MAME yet, we will need to launch MAME from a shell terminal. This will require a PC with a web browser running chrome. Type in the IP address of the MICILE tablet into the chrome browser and the MICILE web based IDE (Integrated Development Environment) will launch.
  • Click on the button labeled "Open Terminal". If this is the first time you have ever launched the shell, it will take up to 10 minutes for the tablet to generate its ssh encryption keys. Other times it may take up to a minute for the shell. Be patient, or use your favorite ssh client if you know how to use ssh already.
  • Eventually, the shell will ask you for a MICILE login otherwise known as a username. The default username is root. The default password for root user is password. When you type in the password nothing will appear on the screen as you are typing. This is expected. Just go ahead and type the password and press enter when the shell asks for the password.
  • Following my example earlier of adding the Street Fighter II ROM named sf2, we will launch Street Fighter 2 by typing the following command into the shell:
    run_advmame sf2

    The screen show below is out of date, please use the correct updated command of run_advmame instead of advmame!
  • A few seconds later, the load screen of the game will appear. Read the load screen and follow it's instructions.
  • Once past the load screens and the game is running, use the SELECT button on the gamepad to add a coin. Use the START button to start the game after adding the coin.
  • So this is the game in action
What's Next?
  • It's not too cool to have to lug around a laptop every time we want to play an arcade game. In Part 2 we will write a front end for MAME that runs on the MICILE tablet everytime the tablet boots and will allow us to choose a game using the touchscreen so the system becomes self contained. I've also got some cheapy wireless gamepads I picked up off ebay that I want to try.