A minor diversion while I am working on the actual ROM boards for the Defender arcade machine, was to get Advanced Mame to compile on my new Raspberry Pi and to run Defender on that (You never know it might make a good back-up to put into the cabinet if the ROM boards get too much hassle!)

Turns out it needs a few tweaks to compile it correctly so here’s how to do it for reference:

1. Download and unpack Advanced Mame to your Raspberry Pi

mkdir downloads
cd downloads
wget http://prdownloads.sourceforge.net/advancemame/advancemame-0.106.1.tar.gz?download
mv advancemame-0.106.1.tar.gz\?download advancemame-0.106.1.tar.gz
gunzip advancemame-0.106.1.tar.gz
tar -xvf advancemame-0.106.1.tar
cd advancemame-0.106.1

2. Configure Advanced Mame for the Raspberry Pi

./configure

3. Make Advanced Mame for the Raspberry Pi

make

Note: This process will FAIL when it tries to compile src/cpu/sh2/sh2.c due to an incompatibility between GCC optimisations and the way that file is written. To work around the fail, edit your Makefile and change/disable the optimisations from the compiler and restart the Make process to complete.

Before:

CONF_CFLAGS_OPT= -O2 -fomit-frame-pointer -fno-merge-constants -Wall -Wno-sign-compare -Wno-unused

After:

CONF_CFLAGS_OPT= -fomit-frame-pointer -fno-merge-constants -Wall -Wno-sign-compare -Wno-unused

Here is the error for reference:

src/cpu/sh2/sh2.c: In function âsh2_get_infoâ:
src/cpu/sh2/sh2.c:3217:1: error: unrecognizable insn:
(insn 2034 2033 2035 183 (set (subreg:SI (reg:DI 362 [ sh2.irq_line_state ]) 0)
(sign_extend:SI (mem/s/j/c:QI (plus:SI (reg/f:SI 361)
(const_int 260 [0x104])) [0 sh2.irq_line_state+0 S1 A32]))) src/cpu/sh2/sh2.c:3111 -1
(nil))
src/cpu/sh2/sh2.c:3217:1: internal compiler error: in extract_insn, at recog.c:2109
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.

4. Install the SVGA libraries for Linux

sudo apt-get install libsvga1

5. Install the build into your Raspberry Pi

sudo make install

6. Enable sound for the Raspberry Pi


sudo depmod
sudo modprobe snd_bcm2835

7. Copy the ROM you require to your ROM directory (I FTPd mine to my temporary directory, /tmp/, first)

cp /tmp/defender.zip ~/.advance/rom/.

8. Run Advanced Mame to make the default configuration file

advmame

9. Edit the default configuration file to add in Video Clock settings for the HDMI output

nano ~/.advance/advmame.rc

Add the following line to your configuration file [this is the default TV setting from the Advanced Mame instructions]

device_video_clock 10 – 50 / 15.75 / 60

10. Run Advanced Mame and enjoy!

advmame defender

And as they say a picture says a thousand words, so here’s mine running at full speed on my 1080P TV at some huge size 🙂