ADVMENU - A "Beginners Guide" to Compiling and Using


17 posts
by welshy » Wed Nov 21, 2012 3:30 pm
Having read several posts in my thread “ADVMAME - A "Beginners Guide" to Compiling and Using” people seem to be having problems integrating AdvMENU, so here’s a Guide! One thing I have noticed and would like to comment on is - “If you are using a “Binary” this WILL undoubtedly be the cause of your problems!” AdvMENU uses scripts within the advmenu.rc to locate the position of the executable, then the folder where the ROMs are and finally processes these locations into a Terminal Command Line script e.g.

For GnGeo (See ADDING EMULATORS Below) I added -
emulator “gngeo” generic “/usr/local/bin/gngeo” “%p”
emulator_roms “gngeo” “/home/pi/gngeoroms”
Which, if I select Metal Slug, it will then execute a Terminal Command Line with the correct syntax, i.e.-
gngeo gngeoroms/mslug.zip

The Default Line added in the advmenu.rc for AdvMAME is -
emulator “advmame” advmame “advmame” “”

As you can see, this Line is scripted with the condition of having performed a “make install” for AdvMENU, AdvMAME and/or AdvMESS (And their associated folders and set up scripts) so they ALL reside in the correct locations!

So if your executables and/or ROMS are in differing positions to what the “Default” script produces as its Terminal Command Line (They WILL BE if you haven’t compiled it yourself!), it ISN’T GOING TO WORK and you will need to modify the phrasing
(See ADDING EMULATORS below for a more in depth explanation of “scripts”)

ADVMENU - Compiled using 2012-09-18-wheezy-raspbian, RPi is 256MEG and over clocked to 900MHz
Source Code - Advmenu 2.5.0.tar.gz
Dependencies - sdl1.2-dev

Compile STRAIGHT from Terminal (DON’T go into X)
1. Make sure you have the RAM split set up attributing ALL the RAM to the ARM (Use the config (sudo raspi-config))
2. Compile as ROOT (Set up a root password for this if you haven’t already! (sudo passwd root))
3. Install libsdl1.2-dev dependencies (apt-get install libsdl1.2-dev)
4. Install the GCC 4.7 Compiler (apt-get install gcc-4.7)
5. Change over to the 4.7 Compiler -
export CC=gcc-4.7
export GCC=g++-4.7
Now just CD into the directory where you uncompressed the source code
./configure
make
make install (Optional, but useful in this case, it will “sync” with AdvMAME and/or AdvMESS as to NOT require ANY alteration to the advmenu.rc. NB So long as you have also compiled AdvMAME and/or AdvMESS with “make install”
6. Once it has completed compiling, exit ROOT
7. Now start the executable so it sets up all the correct folders -
advmenu (Hopefully it will give you a message telling you its set these up!)
8. Start X
9. There should now be a hidden folder .advance (Right Click on your mouse and “Tick” Show Hidden if you cannot see it!)
10. If you are running AdvMAME, In the advmenu.rc there SHOULD be a line -
emulator “advmame” advmame “advmame” “”
This is the execution line, that performs the instruction to run the emulator, if it isn’t there, add it, or delete the advmenu.rc and the advmame.xml config files, repeat step 7 (In a Terminal)
11. Run AdvMENU and Select your game!

ADDING EMULATORS
For emulators “OTHER” than the ADV Suite with NO Front End that have to be run from Terminal e.g. GnGeo

In the advmenu .rc add the lines -

1. For the EMULATOR PATH - emulator “EMULATOR” generic “PATH”
In my case, as I have GnGeo installed - emulator “gngeo” generic “/usr/local/bin/gngeo”
2. For the ROM PATH - emulator_roms “gngeo” “PATH”
Again, in my case - emulator_roms “gngeo” “/home/pi/gngeoroms”

Ok, now we have the Path’s entered we need to add the Terminal Line Data i.e. “what you would type to get Gngeo running” for instance -

gngeo gngeoroms/mslug.zip “OPTIONS”
I run GnGeo at double scale so it’s -
gngeo gngeoroms/mslug.zip --scale=2

So, I’m going to add this to the emulator Line (The %p adds the ROM path line, Including its file extension (.zip))

emulator “gngeo” generic “usr/local/bin/gngeo” “%p --scale=2”

Close and Save the advmenu.rc

Run AdvMENU and the emulator and its associated ROMs should now appear in AdvMENU, selecting a game will open it!

Please let me know if my instructions work ok. I wrote them "on the fly" in reply to a post from my unfinished "Emulators on the RPi" draft notes and as such haven't checked them "step by step" compiling it myself! However, having compiled it several occasions it shouldn't be a problem, but, I may have missed a step!
Posts: 1371
Joined: Mon Oct 29, 2012 2:07 pm
by TrevorB999 » Mon Dec 10, 2012 7:17 pm
Hi Welshy

Have you got any ideas about how I can get Advmenu to run at startup, after auto-logging on as a user?

the intention is to have an autostarting games machine for the kids (of all ages) at Christmas - just turn on the switch and it's there after a few mins...

Trev
Posts: 11
Joined: Tue Nov 20, 2012 10:18 pm
by welshy » Mon Dec 10, 2012 7:38 pm
TrevorB999
Not sure, you would have to alter the config.txt to "Boot" into AdvMENU, however, I’m not sure the Console Login can be bypassed? Try Posting a new Thread, I’m sure somebody can give you the advice if its possible!
Posts: 1371
Joined: Mon Oct 29, 2012 2:07 pm
by Texcoco » Sat Dec 15, 2012 6:45 am
Welshy,

It is me again. The AdvMESS install went really well so I decided to give this a go, but this time I hit a speed bump. After entering the "make" command I got the following error:
obj/menu/linux/blend/menu/category.o
cc1plus: error: bad value (native) for -march switch
make: *** [obj/menu/linux/blend/menu/category.o] Error 1

I tried to follow the steps faithfully. Any thoughts on what is causing the error?

Thanks in advance.
Posts: 11
Joined: Sun Jun 24, 2012 3:28 am
by welshy » Sat Dec 15, 2012 9:01 am
Texcoco
Looks to me like you have NOT changed over to the 4.7 compiler! Remember, you MSUT be ROOT and change to the 4.7 compiler! (Default is 4.6). As AdvMESS compiled, AdvMENU and/or AdvMAME shouldn't be a problem providing you follow the steps as before (Excluding the installation of the SDL1.2 dependencies AND GCC 4.7 Compiler as you have done this already! (Unless you have "reflashed" your card image O/S!)) -

1. Make sure you have the RAM split set up attributing ALL the RAM to the ARM (Use the config (sudo raspi-config))
2. Compile as ROOT
3. Change over to the 4.7 Compiler -
export CC=gcc-4.7
export GCC=g++-4.7
Now just CD into the directory where you uncompressed the source code
./configure
make
make install
Posts: 1371
Joined: Mon Oct 29, 2012 2:07 pm
by Texcoco » Mon Dec 17, 2012 5:38 am
Welshy,

I had a chance to try this again. I followed all of the steps as best I could, but it still resulted in the same outcome. Am I still missing something? Here is some of the output from the end of the "./configure" command and "make" command:
== Host ==
Environment : armv6l-unknown-linux-gnu
Endianess : little
Bits : 32
Assembler for Pentium : no
Assembler MIPS3 emulator for Pentium : no

== Drivers/Libraries ==
Video : fb slang sdl
Sound : alsa oss sdl
Keyboard : sdl raw event
Joystick : sdl raw event
Mouse : sdl raw event
Misc : zlib expat(internal) pthread freetype2

== Compiler ==
CC : gcc-4.7
CXX : g++
CFLAGS : -march=native -O2 -fomit-frame-pointer -fno-merge-constants -Wall -Wno-sign-compare -Wno-unused
LDFLAGS : -s
root@raspberrypi:/home/pi/advancemenu-2.5.0# make
obj/menu/linux/blend/menu/category.o
cc1plus: error: bad value (native) for -march switch
make: *** [obj/menu/linux/blend/menu/category.o] Error 1
root@raspberrypi:/home/pi/advancemenu-2.5.0#

Thanks for the help.
Posts: 11
Joined: Sun Jun 24, 2012 3:28 am
by welshy » Mon Dec 17, 2012 10:33 am
Texcoco
I’m not sure, as AdvMESS compiled I see no reason why this would NOT (So long as you are using the same steps!). Has anybody else had this problem? (Please post if you have with a solution). Try with the 4.6 (Default Compiler to see of this resolves the issue) i.e. DO NOT Type the lines -

export CC=gcc-4.7
export GCC=g++-4.7

Also, again, make sure you are compiling as ROOT user and NOT in X!

One Last Thing, are you using the newer (2012-10-28-wheezy-raspbian) O/S image? I HAVE NOT tried compiling under this revision and differing versions of the O/S can cause problems! (That’s one of the reasons I quote my overclock AND O/S version in the “Guides”
Posts: 1371
Joined: Mon Oct 29, 2012 2:07 pm
by TrevorB999 » Tue Dec 18, 2012 10:22 pm
Texcoco
I had a similar problem, but found via the debian forum that you can edit the makefile (after you've run the configure) and remove the "-march=native" from the CFLAGS line. Leave the rest of the line intact.
Having done that, it works fine (it did for me!)

I should also add that this was under GCC/CC 4.7, having entered the export lines.

Trev
Posts: 11
Joined: Tue Nov 20, 2012 10:18 pm
by TrevorB999 » Tue Dec 18, 2012 10:31 pm
@Welshy

I managed to get the autologin / auto advmenu startup working.

On the forums here, the commands exist to perform the autologon by editting inittab - I won't go into detail - others have documented it better than I can

I then added "advmenu" at the end of the /usr/home/pi/.bashrc script (don't use the quotes if you're doing the same). It works great - switch on the raspi, it goes through the usual start-up motions and straight into Advmenu. I only plug in my IPAC based joystick/button control panel now - doesn't need anything else (just right for a Raspi model 'A'!). I've altered the game select etc just to work off the buttons & joystick, and added extra buttons to the panel for coin input/escape.

Trev
Posts: 11
Joined: Tue Nov 20, 2012 10:18 pm
by Texcoco » Sat Dec 22, 2012 7:43 pm
Welshy,

I gave it a try without switching over to the 4.7 compiler. That seemed to do the trick. I am running a later version of rasbian which may have been the cause. Thanks again for the help.

TrevorB999,

Thank you for the help, unfortunately I saw your post after I had gotten past it. I am interested in how you boot straight into advmenu. That sounds pretty fun.
Posts: 11
Joined: Sun Jun 24, 2012 3:28 am
by FabienO » Wed Dec 26, 2012 1:34 am
Hey guys, I'm brand spanking new to Linux, raspberry pi's and all.

I do fine up until step 7. When I exit root I get my login prompt. To run advmenu do I log in as my default user? How do I go about running advmenu? I tried logging in as root and the default pi user, both say no command found if I run "advmenu" or "-advmenu".

Any help would be much appreciated. Just want mame setup really :)

Thanks in advance.

Edit

I've just seen you can use an image with mame installed. I will do this instead. Sorry for the bump.
Posts: 1
Joined: Wed Dec 26, 2012 1:29 am
by fg1998 » Tue Apr 30, 2013 9:57 pm
Hi everyone

This post had a simple solution to Halt/Reboot Pi from inside advance menu, without a keyboard.

viewtopic.php?f=78&t=42307&p=341190#p341190

Its perfect for people like me is running pi as a console/arcade machine without a keyboard
Posts: 6
Joined: Tue Apr 30, 2013 3:12 pm
Location: Brazil
by bidinou » Fri Feb 21, 2014 3:33 pm
Hi ! As of today, I managed to get it working without changing the compiler version nor building as root.

Seems to work well but apparently there's a lot to tweak ! :-)

Juste one strange thing : during the menu, I can hear an horrible sound (like "fire" at a very low samplerate...), any idea what it is ?!
Posts: 43
Joined: Fri Sep 27, 2013 8:53 am
by welshy » Fri Feb 21, 2014 3:55 pm
bidinou
It will Build correctly without the 4.7 compiler or as root user, I just kept it consistent with AdvMAME/AdvMESS for convenience!

To remove the Sound issues change the following in advancemame.rc -

sound_background_begin none
sound_background_end none
sound_background_loop none
sound_background_loop_dir none
sound_background_start none
sound_background_stop none
sound_buffer 0.1
sound_foreground_begin none
sound_foreground_end none
sound_foreground_key none
sound_foreground_start none
sound_foreground_stop none

Note: Its a shame mp3s cannot be used in AdvMAME, the quality is to bad even changing all the variables

To include snapshots for display in the Menu, make a folder and use .png Images and add this line to the .rc
e.g. for the example above
emulator_altss "gngeo" "/home/pi/gngeosnap"

Note: I think its missing above so to make the emulator appear in the MENU add
emulator_include "gngeo"
(again for the above example)

The MENU will display the names of the ROMS by default, if you wish to correct this, amend in the following manner
game "advmame/dkong" "" "" 39 2 ""
Becomes
game "advmame/dkong" "" "" 39 2 "Donkey Kong"
etc.

The full documentation for AdvMENU is

Here - http://advancemame.sourceforge.net/doc-advmenu.html
Posts: 1371
Joined: Mon Oct 29, 2012 2:07 pm
by bidinou » Fri Feb 21, 2014 4:12 pm
Wow, how fast ! I was reading the documentation...

There's just one thing that bothers me... I would like to mix the roms of ALL emulators (I mean, see all games without having to switch the emulator with F6, as I only selected a few ones per emulator anyway.

Couldn't see that in the documentation but it's pretty big :)

Any idea ?
Cheers & thanks again for the help !
Posts: 43
Joined: Fri Sep 27, 2013 8:53 am
by welshy » Fri Feb 21, 2014 4:32 pm
bidinou
I recall it displays all emulators and Titles by default , to change it Press Tab, List, then select how you want them displayed. Same for Mode: Icons small, icons large, list etc.
Posts: 1371
Joined: Mon Oct 29, 2012 2:07 pm
by bidinou » Fri Feb 21, 2014 4:46 pm
Okay, will reset settings in the config file then :)

Pretty cool stuff !!
Posts: 43
Joined: Fri Sep 27, 2013 8:53 am