Saturday, March 24, 2012

Easier to compile Advmame.

How to get advmame on the rasberry pi.
I found a tip about using advmame instead of xmame and decided it was worth a try.
advmame has an awesome configure script that takes all the work out of editing makefiles.
It also runs a lot faster.


First you will need to have some sort of rasberry pi simulator I went with this method.
RPi on Virtual Box

As before
Use the following command to ensure your running on the arm kernal

uname -a

here is my output.

Linux rasberry-pi 3.0.4 #2 mon oct 17 17:39:42 ict 2011 armv61 GNU/Linux
If you dont have X set up install it by using the command

apt-get install lxde xorg python geany

Now we need to install some dependencies to build advmame. You may not need all of these. I put them together from a lot of tinkering.

apt-get install build-essential libgtk2.0-dev libgnome2-dev libsdl1.2-dev
apt-get install libxv-dev libxv1

 
Download the advmame source. I tried 106.1 without success.
wget  http://sourceforge.net/settings/mirror_choices?projectname=advancemame&filename=advancemame/0.106.0/advancemame-0.106.0.tar.gz

extract the archive.
tar -zxvf advancemame-0.106.0.tar.gz
cd advancemame-0.106.0

Now we configure and compile.
./configure
make
make install
 
Pretty easy huh. Thanks to advmame team for all there work. 

Tuesday, March 20, 2012

Compiling xmame .106 on the Rasberry Pi

How to get mame on the rasberry pi.

Full size screen shot

Please note that it is easier to get advmame up and running. check out my guide here.
First you will need to have some sort of rasberry pi simulator I went with this method.
RPi on Virtual Box
Here are my pre patched files
makefile.unix
unix.mak

Lets get started.
Use the following command to ensure your running on the arm kernal

uname -a

here is my output.

Linux rasberry-pi 3.0.4 #2 mon oct 17 17:39:42 ict 2011 armv61 GNU/Linux
If you dont have X set up install it by using the command

apt-get install lxde xorg python geany

Now we need to install some dependencies to build xmame.

apt-get install build-essential libgtk2.0-dev libgnome2-dev libsdl1.2-dev
apt-get install libxv-dev libxv1


Download and extract xmame .106


wget  http://caltaxcn.googlecode.com/files/xmame-0.106.tar.bz2
tar xvjf xmame-0.106.tar.bz2
cd xmame-0.106

We need to edit the make file so it will compile correctly.

nano makefile.unix

Under reset flags comment out the line
CFLAG =
to
#CFLAG =

Under Choose from some preset CFLAGS. comment out the folowing
# GCC on x86
CFLAGS = -O2
to
# GCC on x86
#CFLAGS = -O2

Under general optimizations uncomment
#CFLAGS += -fno-merge-constantsto
CFLAGS += -fno-merge-constants

and uncomment
# CFLAGS += -fstrict-aliasingto
CFLAGS += -fstrict-aliasing

Under Architecture change
MY_CPU = i386
to
MY_CPU = arm

Save the modified makefile.
now open up the following file.

nano src/unix/unix.mak

and Change the line
CFLAGS.risc_lsb   = -DALIGN_INTS -DALIGN_SHORTS -DLSB_FIRST
to
CFLAGS.arm   = -DALIGN_INTS -DALIGN_SHORTS -DLSB_FIRST
then close and save the file.


At this point you can finally compile xmame. simply type in make

make

on my laptop this takes about 6hrs to compile. once done you can run xmame from this directory.

chmod -x xmame.x11
./xmame.x11 

I hope this gets the ball rolling. I know there is more optimizations to be had.