GNGEO - A "Beginners Guide" to Compiling and Using

17 posts
by welshy » Wed Nov 07, 2012 11:38 am
Ok, it seems to me from what I have read previously in the Forum people are having problems with GNGEO. So here’s my “Beginners Guide” for compiling and running it. I have compiled and run it consistently with this method using image 2012-09-18-wheezy-raspbian (And two previous versions), my RPi is 256MEG, over clocked to 900MHz

Source Code - gngeo-0.7.tar.gz
Dependencies - libsdl1.2-dev
Additional Files Required - Neo-Geo Bios and game ROMS

1. Set up a root password for this if you haven’t already! (sudo passwd root)
2. Make a folder (I called mine gngeoroms) and Unzip the Neo-geo Bios in it and add any game ROMS you have acquired
3. Unzip gngeo-0.7.tar.gz
4. Open a ROOT Terminal
5. Install libsdl1.2-dev dependencies Type -
apt-get install libsdl1.2-dev
6. CD into the gngeo-0.7 folder and Type -
make install (Optional, but useful in this case as running straight from Terminal (Not in X) gives a significant performance increase!)
7. Exit the ROOT Terminal (Type exit) and run gngeo
gngeo /home/pi/gngeoroms/”game name”.zip (This will set up Gngeo, you SHOULD get “BIOS FILES NOT FOUND”)
8. I had problems moving the files in X by dragging and dropping them (Which is why I have set up a separate folder for the ROMS!), even though I changed the permissions of the folder which should have allowed me access! So do it MANUALLY
9. Change back to a ROOT Terminal (su root)
10. Move the Bios files from the folder you made into the gngeo folder where the program is looking for them Type -
mv “path”/”file” ”path”/”file”* to move the bios files into the appropriate folder - The three required are : 000-lo.lo, sfix.sfx and sp-s2.sp1 (MVS Arcade Bios),then delete the unused Files
*e.g mv /home/pi/gngeoroms/000-lo.lo /usr/local/share/gngeo/000-lo.lo
11. Exit ROOT Terminal (Type exit)

To Run gngeo from a Terminal Type -
gngeo “folder name”/”game name”.zip (MUST have the file extention!)
Some useful options to add when running Gngeo -
--help (Gives Options List)
--scale=2 (e.g. Scale X2)
--joystick (Enable Joystick Support)

As noted in my previous Thread, as the core is based on MAME code, like MAME gngeo requires the need of the correct ROM revision! Though unlike MAME, which DISPLAYS and names the missing Rom files, Gngeo just reply’s “unknown or unsupported romset” making it a bit harder to find the correct ones!
Please let me know if my instructions work ok. I just 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: 1222
Joined: Mon Oct 29, 2012 2:07 pm
by billb » Wed Nov 07, 2012 1:25 pm
Why are you running ./configure and make as root? I don't see why that would be necessary. Normally we'd do things like:

Code: Select all
sudo apt-get install libsdl1.2-dev


Code: Select all
sudo make install

Instead of actually logging in as the root user. Same thing in steps 9-10:

Code: Select all
sudo mv /home/pi/gngeoroms/000-lo.lo /usr/local/share/gngeo/000-lo.lo
User avatar
Posts: 173
Joined: Wed Sep 19, 2012 10:27 pm
by petrockblog » Wed Nov 07, 2012 1:48 pm
Another source of guideline might can be found here, which shows the steps of the RetroPie Setup Script for compiling, installing, and configuring GnGeo. These are essentially the same as described above though.
fun stuff for technics enthusiasts:
Posts: 260
Joined: Wed Jul 04, 2012 6:12 am
Location: Germany
by welshy » Wed Nov 07, 2012 2:38 pm
Yes, a good point! However, I have found SOME programs are problematic with the "sudo" suffix (Mame and Mess for instance). If I recall correctly root MAY have been needed to move the Bios files! Also, it is meant to be a “Beginners Guide”, when getting to grips with Linux myself I was slightly confused by the whole issue of user/root/sudo commands. Personally, I find it easier to think of Linux: ROOT (Super User) = MSDOS: Administrator; and structure my usage in a similar fashion (Maybe I’m showing my age! My programming background is with MOS 6502 Assembler back in the early 80’s where structure is EVERYTHING!). Anyway, thanks’ for the comment it may help people using the Guide!
Posts: 1222
Joined: Mon Oct 29, 2012 2:07 pm
by blc » Wed Nov 07, 2012 3:09 pm
*delicate cough*...

I appear to have beaten you to it... :D

Although I didn't know (at the time) that libsdl-dev was a dependency. Makes sense, now that I think about it... I probably had it installed anyway from all the other tinkering I'd been doing... And my post was buried inside someone else's thread ;)

blc wrote:Hope you don't mind me posting this SSilver2k2, but I've been able to compile gngeo from scratch. The source code can be downloaded here ... e_id=10911 (that site may give a warning about SSL certificates), and I used the following flags for the ./configure script:

Code: Select all
./configure --build=i386 --host=arm-linux --target=arm-linux --disable-i386asm --enable-cyclone --enable-drz80

It basically builds the GP2X port, but without the GP2X option enabled.

After that finishes it's just a case of compiling and installing:
Code: Select all

which takes about 20 minutes, and
Code: Select all
sudo make install

which takes seconds.

The BIOS roms need to go in /usr/share/local/gngeo, but I'm sure that can be changed in the gngeorc file somewhere. I grabbed SSilver2k2's gngeo config file:

Code: Select all
cd ~./gngeo/

And edited it with the following options:

"effect none" changed to "effect scale2x50"
"showfps false" changed to "showfps true" (so that I can see how well/badly it's doing :))

My Pi is overclocked to 800MHz, so I'm not sure how much difference that makes. At the moment I've just got the game ROMS in my home folder, so I execute it with:

Code: Select all
arm-linux-gngeo -i ~/ ~/

As mentioned that can probably be cleaned up by putting a custom rom path for games and BIOS files in the gngeorc file, but I haven't got round to that yet. Unfortunately it doesn't have the nice pretty GUI that SSilver2k2's binaries do, but unfortunately I couldn't get those binaries to work properly, even with a 128/128MB split and an overclock to 900MHz.

I've tested this so far with Metal Slug X and it plays pretty well - usually over 40-50FPS, which is perfectly playable. I'm going to have a play with some more games shortly, but first I want to get joypad support enabled/working.

If anyone wants me to write up the instructions properly, I'll do some testing with a clean raspbian image - I've got a pile of additional libraries & packages installed, and I don't know which ones are necessary to build Gngeo. I'll set up a separate thread for that if people want it...
Posts: 167
Joined: Mon Sep 05, 2011 9:28 am
by welshy » Wed Nov 07, 2012 3:52 pm
Nice one! No problems with the *delicate cough*... I have previously stated the previous fractured nature of Emulator threads on the Forum. Abishur (One of the moderators) contacted me and kindly said “I do agree that it can be somewhat fractured and I try to get them back in the gaming sub-forum whenever I catch them ” (Thanks again Abishur!). I too have quite a few additional libraries & packages installed and like you say, it’s not always easy keeping tabs on what you have installed, especially if you’ve done a few “apt-get” from the repo’s and DIDN’T keep an eye on what packages it was also grabbing!* Saying that, I ONLY have ONE SD card (Must get another though, a 512MEG RPi should be on the way soon!), so when I kept “bricking” it examining the limits of over clocking I just re-flashed the O/S image and started again!
Thanks’ for the post!
*The ONLY things I added BEFORE installing GnGeo were Stella and Mednafen
Posts: 1222
Joined: Mon Oct 29, 2012 2:07 pm
by omegacon » Thu Nov 08, 2012 8:01 am
so im having trouble configuring my x gaming controller her are the keys i saw when i hit f4 and entered them like so:

p1control A=K306,B=K308,C=K32,D=K304,START=K49,COIN=K51,UP=K264,DOWN=K258,LEFT=K260,RIGHT=K262,MENU=K27
p2control A=K97,B=K115,C=K113,D=K119,START=K50,COIN=K52,UP=K114,DOWN=K102,LEFT=K100,RIGHT=K103,MENU=K27

btw some of the buttons alrdy work like coin in and start so i kept the 'K'
Posts: 7
Joined: Sat Nov 03, 2012 10:19 pm
by omegacon » Thu Nov 08, 2012 8:09 am
nvm fixed im a dumb dumb sry!! great guide btw
Posts: 7
Joined: Sat Nov 03, 2012 10:19 pm
by Mechnix » Thu Nov 08, 2012 11:08 pm
I got GNGEO playing all my Metal Slug roms perfect but Metal Slug 1 quits with 'segmentation error'
this rom plays fine on the latest mame exe.

Second problem I have is I can't adjust the screen size and I'm stuck with a 3x4 inch screen.

I noticed I don't have a gngorc file I have a gngorc.gp2x file. Changing the fullscreen true,effect,or scale does nothing, it says:
# Play in fullscreen?
fullscreen false

# Which blitter? GP2X only support soft mode
# soft
# opengl
# yuv
blitter soft

# Which effect? GP2X don't support effect
# none
# scanline
# scanline50
# scale2x
# scale2x50
# scale2x75
# doublex
# sai
# supersai
# eagle
effect none

# Enable the raster interrupt?
raster false

# scale the output image. Don't use anything else on your GP2X :)
scale 1
Posts: 4
Joined: Thu Nov 08, 2012 10:56 pm
by welshy » Fri Nov 09, 2012 11:39 am
Ok, first thing first -

1. There is a gngorc.gp2x file because the emulator is written for the GamePark GP2X console, unless at the ./configure stage you add to the script, it will build a GP2X version. As indicated it is a “Beginners Guide” so I didn’t want to make things overcomplicated as it works acceptably on that build anyway! (Like PCSX Reloaded, another GP2X Emulator)
2. I have tried altering the gngorc.gp2x script and, as you say, it DOESN’T change anything when the emulator runs! However, adding to the run instruction DOES! I have found when running in Terminal (i.e. NOT in “X”) scaleX2 is sufficient (More than that and, like MAME (Because it’s based on MAME cores), it keeps the same size (It cannot display the image any bigger), but runs SLOWER). Just add the “option” in your Terminal -
E.g. gngeo “path”/”game”.zip --scale=2 (For scale X2)
You can also add multiples -
E.g. gngeo “path”/”game”.zip --scale=2 --effect=scanline (For scale X2 AND scanlines)
3. With regards to ROMS, I have not encountered a “segmentation error”, they are USUALLY associated with CD emulation (i.e. the way the files are “split” on the Disc). MAME requires the need of the correct ROM revision (And in this case the correct Neo-Geo BIOS rev) for individual versions of the core program! Unfortunately, GnGeo, although it’s based on the MAME cores DOESN’T DISPLAY and NAME the missing Rom files, so just try a ROM rev from another source! It’s an existing problem in MAME, that’s why I run different versions on my PC - 0.103 AND 0.138 (With my Neo-Geo games split across them), but I ALSO run Nebula rev225b (For Neo-Geo AES emulation) and NCDZ rev 20051225 (For Neo-Geo CD emulation)

If this DOESN’T help with the screen size, it COULD also be the O/S you are running, I’m currently using image 2012-09-18-wheezy-raspbian.
This is a usual problem with Emulators, for instance, on XP and Windows 7 my SNES EMU (snes9x-1.51) runs PERFECTLY. However, on VISTA, SOME games which had additional processors in the cartridge (Super Mario Cart, DSP-1) don’t function correctly! Try not to complain TOO MUCH though, remember, this is HOME BREW! The talented guys who write these emulators DON’T have a HUGE BUDGET like the big Software Houses for in-house testing! Just be grateful through their HARD WORK (Often having to reverse-engineer the hardware with NO documentation) that we get to enjoy them AT ALL!

I hope that helps!
Posts: 1222
Joined: Mon Oct 29, 2012 2:07 pm
by Mechnix » Fri Nov 09, 2012 3:57 pm
I appreciate the help, I realized I could add it to the command line but I'm running this out of emulation station (retropie) also I'm on (2012-10-28-wheezy-raspbian)

I did try about 10 different versions and combos of the bios and game rom's for MSlug 1 some would run a little further before crashing...

The others work great though and I'm not complaining :) just need some help.

I also realized I posted this in the wrong thread....I found the retropie thread after I posted this..
Posts: 4
Joined: Thu Nov 08, 2012 10:56 pm
by jeb92 » Mon Nov 26, 2012 8:37 pm
i found out that in order to change the key mappings for your keyboard/joystick you need to copy the sample_gngeorc file to
Code: Select all
in the README it made it seem like it needed to be in
Code: Select all
but that is incorrect. just in case anyone else was confused by that same thing.

on a side note i found this
Escape: exit game.
F1: reset game.
F2: take a screeshot (BMP file saved in your home directory).
F3: enter Neo Geo Bios configuration interface.
F4: enable/disable display of pressed key value.
F5: enable/disable display of FPS value.
F6: enable/disable slow motion.
F8: save current game state (to a slot you thereafter specify, from the one hundred possible!).
F9: load a saved game state (from a slot you thereafter specify).
F10: enable/disable auto frame skip.
F11: enable/disable sleep mode when Gngeo is idle.
F12: enable/disable fullscreen mode.

hope this helps someone. and does anyone know if there is a way to change these keys? i didnt see them in the sample_gngeorc file
Posts: 12
Joined: Sat Nov 03, 2012 8:58 pm
by golvellius » Wed Nov 28, 2012 1:46 am
Hello ..

I tried to compile version gngeo v0.8 . Compilation ok , with arm parameters .
All ok , it has got beautifull menu . Animation , etc .
But when load a rom :

a) Stack at the end of loading .
b) Load + Decript , after goes to command line .

What is the problem ?

Thanks ..
Posts: 1
Joined: Wed Nov 28, 2012 1:31 am
by vlahde » Thu Aug 15, 2013 8:14 pm
Hi, does any of you guys have problem with configuring the joystick to gngeo? Intructions say that to see the keykodes I must press f4 to see them. Well I can't see anything. Looks like any of the F-button functions does not work. So any ideas how can I figure the joystick key codes for USB fighting stick controllers. My raspian is linked up with HDMI and I have the latest 0.7 pimame. The F4 button is working with other emulators
Posts: 2
Joined: Thu Aug 15, 2013 8:09 pm
by welshy » Thu Aug 15, 2013 9:13 pm
I have a feeling PiMAME now uses GnGeo 0.8 which is an 'unofficial' GP32 fork/port which as it has no Function Keys pressing F4 button for key logging wasn't supported. However, GnGeo is now pretty much redundant as Shea has included PiFBA with the new revision of PiMAME, its ROM compatibility is much better than GnGeo (which is problematic at best) and is written by pudding specifically for the RPi so has better performance. I have replaced GnGeo with PiFBA in my 'Custom' setup, it also has the facility to emulate Capcoms CPS II Arcade Board (Link to Game List Here -

Hope That Helps!
Posts: 1222
Joined: Mon Oct 29, 2012 2:07 pm
by vlahde » Mon Aug 19, 2013 6:48 am
Yeah, thanks for the advice. Final Burn Alpha works way better than gngeo.

However I have problem configuring joysticks with 4 axis with it. I configure axis y to 2 and axis x to 3 but it will not work. The buttons work but seems to me that HAT0Y and HAT0X controls are not supported. My snes controller (with only 2 axis) work just fine.
Posts: 2
Joined: Thu Aug 15, 2013 8:09 pm
by welshy » Mon Aug 19, 2013 7:49 am
vlahde wrote:I have problem configuring joysticks with 4 axis with it. I configure axis y to 2 and axis x to 3 but it will not works. The buttons work but seems to me that HAT0Y and HAT0X controls are not supporten. My snes controller (with only 2 axis) work just fine.

I think this is a general problem across puddings suite of RPi emulators, obviously he cannot anticipate every configuration of input devices people are going to use and in some cases is no doubt restricted by the original emulators code (Many of the Arcade Cabs didn't have 4 axis controllers!). Perhaps you could add this as a 'Issue' at the code site, he may be able to address this in a future revision.

Link -
Posts: 1222
Joined: Mon Oct 29, 2012 2:07 pm