UbuntuX

May 17, 2006

HOWTO: Compile Gens from source

Filed under: Emulation, Gaming — ubuntux @ 2:21 pm

The Sega Genesis (or MegaDrive, for our European readers) was a technological marvel, bringing gaming kicking and screaming into the 16-bit era. Genesis consoles are hard to come by nowadays, meaning that emulation is the only way for those with broken consoles and fond memories to relive their favorite Genesis games. Ubuntu includes the dgen emulator in its Universe repository, which does a fine job of emulating the Genesis system but which, as a command-line only program, is less than inviting. This article will show you how to compile Gens, one of the best Genesis emulators for Windows, to run natively on Ubuntu.

1. Get Gens source code
Go to https://sourceforge.net/project/show…group_id=73619
and look in "Gens Source Code" -> "Gens WIP Linux". Download the "gens-rc3.tar.gz" file and extract it to a convenient spot, like your desktop.

2. Get needed build tools
In order to compile Gens from source, you'll need a few tools installed on your system. Make sure that you have the 'universe' repository enabled in your /etc/apt/sources.list.

First, make sure you have the right compilers:

sudo apt-get install build-essential gcc-3.4 nasm

Next, make sure you have the SDL libraries that Gens needs:

sudo apt-get install libsdl1.2debian-alsa

(Note: You may need some of the extra SDL libraries installed – if this does not work, try installing libsdl-gfx, libsdl-image, and libsdl-mixer, along with the '-dev' versions of each package.)

You'll need development headers for GTK+ too:

sudo apt-get install libgtk2.0-dev

3. Set up your build environment
Gens will not compile with the standard gcc-4.0 that comes with Dapper. To make sure that Gens gets built with gcc-3.4 instead, use the following:

export CC="gcc-3.4"

4. Build Gens!
Now that everything is set up, the compilation / install is fairly simple. Go into the directory that you extracted from the .tar.gz, and then:

./configure
make
sudo make install

Gens will install itself into /usr/local/bin/gens, and you should be able to start the program (or add it to your Applications menu) with just "gens". You will need a BIOS file if you want to play SegaCD games (available through Google, not here), and to play any games you will of course require legally-acquired ROMs.

Happy Sega-ing!

Advertisements

8 Comments »

  1. Thanks. This howto was really helpful to me.

    Comment by libby — June 28, 2006 @ 5:49 pm

  2. Same here, thank you very much 🙂

    Comment by cooper — September 21, 2006 @ 11:21 am

  3. I’ll be trying this tommorow 🙂
    Just out of curiosity, does the sound work properly? I’ve been hearing that people have been having problems with sound in Gens, and the games running too fast/slow… Does it run fine for you?

    Comment by Daniel — September 26, 2006 @ 11:06 am

  4. Yeah, I keep having problems trying to compile this whore from source. Really frustrating, been trying for days, using many different sources. It’s really gay and frustrating.

    emulator/g_main.c:755: error: static declaration of ‘Build_Language_String’ follows non-static declaration
    emulator/g_main.c:570: error: previous implicit declaration of ‘Build_Language_String’ was here
    make[3]: *** [emulator/gens-g_main.o] Error 1
    make[3]: Leaving directory `/home/anomaly/gens/GensForLinux/src/gens’
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/anomaly/gens/GensForLinux/src’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/anomaly/gens/GensForLinux’
    make: *** [all] Error 2

    Comment by Anomaly — January 1, 2007 @ 7:35 pm

  5. Sorry, I wasn’t using gcc 3.4… So, of course, as anything with linux, it fucked up because of my own ignorance.

    Comment by Anomaly — January 1, 2007 @ 7:40 pm

  6. hi,

    i was discovering the same problem.
    you need to edit the file [gens]/src/gens/emulator/g_main.c

    remove the ‘static’ in line 570 and gens compiles; and works!

    Comment by matthes — January 20, 2007 @ 8:19 am

  7. Unfortunately I get

    This is with latest Ubuntu AMD64 and gcc-3.4

    gens_core/cpu/68k/cpu_68k.c:27: error: initialiser element is not constant
    gens_core/cpu/68k/cpu_68k.c:27: error: (near initialisation for `M68K_Fetch[1].offset’)
    gens_core/cpu/68k/cpu_68k.c:27: error: initialiser element is not constant

    Comment by Tom — February 9, 2007 @ 5:46 pm

  8. I don’t find any solution to compile it on amd64 too…

    Comment by KnuX — August 14, 2007 @ 5:32 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: