Instructions for the people that don't like to read:
$ curl -o mame0144s.zip "http://mamedev.org/downloader.php?file=releases/mame0144s.zip"  #download source
$ unzip mame0144s.zip
$ mkdir mame0144
$ mv mame.zip mame0144  # (mame puts a zip inside a zip)
$ cd mame0144
$ unzip mame.zip
$ cd ..
$ tar -xvzf mameacpatch-0.3.2144.tar.gz  #in case you are not reading this from the tarball
$ mv mameacpatch0.3.2144/mameac0144.diff mame0144
$ cd 0144
$ patch -p1 < mameac0144.diff
$ make
$ make installscores  # copies score.dat to your ~/.ac so that it can be found
(you can stop here if you don't have python or don't want to run the demo randomplayer)
$ cd src/ac/agents
$ make pythonbinding.so  (if you have/want python bindings)
$ ../../../mame -use_ac -automatic_controller pythonbinding.so -ac_options randomplayer <gamename> (eg galaxian)

---

This is CCPMAME, formerly known as the XMAME automated controller
interface.  It provides an interface to a runtime-selectable
agent/program that will act as the player in any MAME-supported
game which uses digital inputs.  You should be able to find the latest
version and some documentation at http://www.organicrobot.com/mame/

The accompanying patch is relative to MAME 0.144 ('patch -p1 <
mameac.diff' while in the MAME-0.144 source root should do the
trick in case you are not familiar with patch and diff).  You need to
run 'make' after patching to create a new mame binary with automated
controller support.

The python bindings and the sample agents live under
src/ac/agents. 'make' will compile the python bindings
(pythonbindings.so) and the dummy do-nothing C controller (dummy.so)

All the interesting code is under src/ac.

A brief HOWTO implement a controlling agent, look at the HOWTO file
in this distribution.

The -use_ac option is used to specify whether the controller should be
enabled. The agent/program/controller module to load is specified with
the -automatic_controller options.  For now, only shared libraries are
usable. The -ac_options option lets you pass arguments to the loaded
module.  They will be passed as one string as the first argument to
the start_game function. The -ac_player lets you specify which player
you want the controller to play.

An example on how to start a game with the random python controller
would be:
(from the src/ac/agents directory, after having compiled mame)
First, make sure you have compiled the python bindings: 

'make pythonbinding.so'

Then, run mame:

../../../mame -use_ac -automatic_controller pythonbinding.so
-ac_options randomplayer <name of game>

To run it as player 2, then the following:
../../../mame -use_ac -automatic_controller pythonbinding.so
-ac_options randomplayer -ac_player 2 <name of game>

If you add entries to score.dat (locations where the games keep their 
score), I'd appreciate sending them back to me to be added to the
distributed version.

Comments, criticisms and patches encouraged. Send to
alito@organicrobot.com
