Page 1 of 1

Makefile advice - compiling an old game from source

Posted: Tue Mar 29, 2016 12:10 pm
by LetHopeItsSnowing
Hi,

I am looking for some advice and pointers... One of the games I loved in my youth was "Mayhem" on the Amiga, its a freeware multi player shooter and great fun. http://hol.abime.net/3853.

The game was ported to PC and open sourced a good while ago and I got it running on my windows PC https://github.com/devpack/mayhem.

Its written in C and the only hard requirement appears to be allegro, which is available on the Pi.

So before I started hacking up the Makefile https://github.com/devpack/mayhem/blob/master/Makefile (of which I have VERY little experience of doing) and trying to get it compile does anyone have any advice / pointers / experience?

Thanks

Martin

Re: Makefile advice - compiling an old game from source

Posted: Wed Mar 30, 2016 10:01 pm
by swampdog
I took a quick look. Actually it's written in C++. This is enough to get it to build..

$ git clone https://github.com/devpack/mayhem
$ cd mayhem && rm -rf allegro442_include
$ sudo apt-get install liballegro4.4 liballegro4-dev

Modifiy these lines in 'Makefile', leave the rest unchanged:
CPP = g++
CC = gcc
LIBS = -lalleg
STUFF= -O0 -g -Werror -Wno-write-strings -Wno-deprecated-declarations
CXXFLAGS = $(CXXINCS) $(STUFF)
CFLAGS = $(INCS) $(STUFF)

$ make

If it crashes on you try 'gdb' and see if you get the same as me..

$gdb ./Mayhem2.exe
>r
Program received signal SIGSEGV, Segmentation fault.
0x76f34738 in install_timer ()
from /usr/lib/arm-linux-gnueabihf/liballeg.so.4.4
>bt
#0 0x76f34738 in install_timer ()
from /usr/lib/arm-linux-gnueabihf/liballeg.so.4.4
#1 0x00014df0 in InterruptTimer::init () at game_mgr.h:38
#2 0x00014cb0 in GameManager::Init () at game_mgr.cpp:18
#3 0x00015f20 in main () at Mayhem2.cpp:42
>q
>y

Pray that you don't (my pi is headless and not running X). I can get as far as the initial logo under unbuntu but that's a virtual machine. In any case, expect to have to check the filenames 'cos there's a mixture of upper/lower case.

Re: Makefile advice - compiling an old game from source

Posted: Thu Mar 31, 2016 7:54 am
by LetHopeItsSnowing
Thank you, that is really help... I will try later.

Re: Makefile advice - compiling an old game from source

Posted: Sun Apr 03, 2016 8:52 am
by LetHopeItsSnowing
I have got it to compile and when run in X the splash screen appears and zooms in...

You dont get the menu up and it doesnt detect key presses, but now it compiles I can debug..

Thanks again.

Martin

Re: Makefile advice - compiling an old game from source

Posted: Sun Apr 03, 2016 3:30 pm
by LetHopeItsSnowing
I got it to work...

A couple of issues relating to case sensitive file names (as expected) and a couple of bugs in the original code which generated segmentation faults in linux (not expected and a lot harder to track down!).

https://github.com/martinohanlon/mayhem-pi

:D