The restoration of a 1980's Williams Defender arcade machine
Raspberry Pi: Running Defender with Advanced Mame
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
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 🙂
Print article | This entry was posted by Judder on September 14, 2012 at 10:35 am, and is filed under Mame, Raspberry Pi, Williams Defender restoration. Follow any responses to this post through RSS 2.0. You can skip to the end and leave a response. Pinging is currently not allowed. |
about 10 years ago
Hi,
Thanks for your great article. I followed it and success to launch rom on my 16:9 screen with my raspberry 🙂
But i have a speed issue, i try via LXTerminal to launch batman (for example) and all take a long time to display, detect the key pressed, do action etc.
How do you have good performances ?
Thanks
about 9 years ago
Brother I am an old defender clocker whose first Pi arrives tomorrow. Don’t know if my Linux will hold up but this is the Grail and no mistake.
about 9 years ago
My dad (a major defender fan) and myself (asteroids enthusiast) rebuilt an original defender control panel to play defender, and are working on transitioning from PC to Raspberry Pi to turn the console into a wireless, self-contained gaming system. I just ran into that very issue with the ‘make’ command and I cannot wait until morning to fix it!
I will report back to see if this works for us too!
about 9 years ago
Awesome – report back how you get on and hope it helps!
about 6 years ago
These instructions are awesome. Can’t wait to try this out. I’m wondering if this tread is still monitored in case I run into any issues? I agree. This is the holy grail of computing! I’m thinking of building a console around it. Maybe. That would be the original control layout. What are you guys doing for controllers? Thanks!
about 4 years ago
G’day there mate,
I’ve been looking at building a couple of bartop cabinet’s for home with one being a dedicated build that only feature’s both Defender & Stargate & came across this site whilst doing my research…
Although I am quite handy with building & making stuff (including some electronic’s) I am new to this stuff I was just wondering if you knew whether one of the early version’s of a Raspberry Pi would be powerful enough to run both game’s, as I don’t feel it necessary to use a newer version if not required & to save some money toward’s the other game cabinet’s I would like to make (being dedicated 1up & 2up cabinet’s strictly for pre-1990 retro arcade game’s)…
If you are still active here I would really appreciate any input you could provide to my query…
Cheer’s & thank’s in advance from Down Under,
Andy…
about 2 years ago
Yes – you can use the original raspberry Pi – that’s what I used when I was testing for my post. HTH