SOFTWARE
 

Setting up Advance MAME and Menu to run on Gentoo Linux. This page is designed for those who wish to put together a system running Advance MAME and Advance Menu on Linux (I used Gentoo) Thanks goes to desmatic and Troy Kellog for their help. Credit belongs to them for much of the code presented here. I put this together so it is in one place for someone wishing to get a similar setup as mine up and running.

For those interested, here is my advmame.rc and advmenu.rc

First step is to get Gentoo Linux up and running. I'm not going to go into how to do this. The Gentoo installation handbook does an adequate job. I do recommend configuring your own kernel though as it allows you to remove some unnecessary stuff for faster boots, and I had no luck at all with Genkernel. I used Gentoo 2.6.5-r1. One tip: if you are using a new Serial ATA hard drive like me you will need to specify /dev/sda instead of /dev/hda for fdisk and everything else.

Once you have gentoo up and running you will want to emerge alsa for your sound, KDE (this isn't necessary but it does install slang which you will need for advmame and it is nice to be able to jump into a graphical desktop when you want to), and SVGALIB. SVGALIB is necessary in my experience instead of framebuffer if you are going to be running standard resolution monitor. I could not get low enough pclocks using framebuffer. This may change in the future.

Emerging ALSA:

You will need this for sound. Follow the Gentoo Linux ALSA guide. If you are installing without a network connection like me you will see when you emerge alsa it won't find certain files. Make a note of these files and download them from alsa and copy them to /usr/portage/distfiles/ Otherwise follow the ALSA guide directly.

Emerging KDE:

This is not necessary but it does install slang which you will need. Follow the KDE installation guide. The only thing it doesn't tell you, and for the life of me I don't know why, is to run /usr/X11R6/bin/xf86config You must run this and configure per the instructions before running KDE.

Installing SVGALIB, ADVMAME, and ADVMENU:

I was unable to get low enough pclocks for the low standard resolutions using framebuffer. Your mileage may vary, especially if using a newer version or with different patches.

Do the following:

Download advancemame source to your home directory (again, use the source and not a binary, this is necessary to use svgalib)

Download advancemenu source to your home directory
Download svgalib source to your home directory
Launch a terminal and enter:

cd
tar xvzf advancemame- version *.gz
tar xvzf svgalib- version *.gz
cd svgalib- version
ls ../advancemame- version /contrib/mame/svgalib/*
patch -p1 < ../advancemame- version /contrib/mame/svgalib/ svgalibversion-patch1 .diff
patch -p1 < ../advancemame- version /contrib/mame/svgalib/ svgalibversion-patch2 .diff
patch -p1 < ../advancemame- version /contrib/mame/svgalib/ svgalibversion-...
su
make install
make demoprogs
insmod kernel/svgalib_helper/svgalib_helper.ko
lsmod | grep svga
exit

If everything went well you should see the svgalib_helper module listed. Once installed you need to edit /etc/vga/libvga.conf and modify the HorizSync and VertRefresh so that it matches your monitors capabilities.

add svgalib_helper to /etc/modules.autoload.d/<kernel_version> to load the module at boot time

Continue with installing advancemame and advancemenu:

cd
tar xvzf advancemame*.gz
cd advancemame*
./configure
su
make install
exit

cd
tar xvzf advancemenu*.gz
cd advancemenu*
./configure
su
make install
mkdir -p /usr/local/share/advance/artwork
mkdir -p /usr/local/share/advance/image
mkdir -p /usr/local/share/advance/rom
mkdir -p /usr/local/share/advance/sample
mkdir -p /usr/local/share/advance/snap


copy all your artwork to /usr/local/share/advance/artwork
copy all your images to /usr/local/share/advance/image
copy all your roms to /usr/local/share/advance/rom
copy all your samples to /usr/local/share/advance/sample

su
chmod -R a+rw /usr/local/share/advance
exit
cd
advcfg

advmame -default
advmenu -default
advmenu

I couldn't get advcfg to work properly, if you can't either and are using a Wells Gardner d9200 enter the following in advmame.rc:

display_adjust generate_yclock
device_video_interlace no
device_video_pclock 5-90
device_video_hclock 15-16.75, 24-26, 31-32.5
device_video_vclock 50-85

and in advmenu.rc just add

device_video_pclock 5-90
device_video_hclock 31.5
device_video_vclock 51-90
video_size 640

advmame -default
advmenu -default
advmenu

If one of the resolutions for a game doesn't display centered use advv to make a custom resolution to use. I had no problems getting advv to run.

Mouse devices

Tip: To use the raw mouse or event mouse type give your user permission on the /dev directory. Mouse will not work otherwise.

Getting your system to boot directly into Advmenu:

useradd mame -m -G users,wheel,audio -s /bin/bash

then run this to give mame a password:

passwd mame

you'll need to make a small c program to have 'mame' automatically log in (just make a text file using nano and name it autolog.c):

main ()
{
execlp( "login", "login", "-f", "mame", 0);
}


run this to compile the program:

gcc -o <name of executable> <name of file>
I used: gcc -o autolog autolog.c

now you'll need to have autolog executed when linux boots. edit /etc/inittab like so:

# TERMINALS
#c1:12345:respawn:/sbin/agetty 38400 tty1 linux <-- the old line
c1:12345:respawn:/sbin/agetty -n -l /mame/autolog 38400 tty1 linux <-- change it to this (i have the autolog program in /mame/)


This gets you logged in, now you'll want to have advancemenu automatically run. a simple way to do this is to edit the .bash_profile in your /home/mame/

# /etc/skel/.bash_profile:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/skel/.bash_profile,v 1.10 20$
#This file is sourced by bash when you log in interactively.
[ -f ~/.bashrc ] && . ~/.bashrc
advmenu
/sbin/poweroff

The /sbin/poweroff part is so your system will shut down when you exit. You will likely need to give your user permission to /sbin/poweroff. I did it this way because I could not get advmenu's shutdown event to work. It is supposed to run /sbin/poweroff but it never did anything for me. Send me an email if you figure it out and I will update this site. I recommend adding the /sbin/poweroff part after you have everything configured because to get to the console you will need to add another user and hit alt-f2 when your machine is booting before it boots automatically into advmenu.

Getting your system to shutdown from Advmenu:

Map the event_assign shutdown in advmenu.rc to the keys you want to use to shutdown. You will also need to set misc_exit to all or shutdown to allow the shutdown event to occur.(This was what I was missing when I could not get it to work) Also make sure your user has permission on /sbin/poweroff.