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
- LetHopeItsSnowing
- Posts: 357
- Joined: Sat May 26, 2012 6:40 am
- Location: UK
Makefile advice - compiling an old game from source
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"
Re: Makefile advice - compiling an old game from source
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.
$ 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.
- LetHopeItsSnowing
- Posts: 357
- Joined: Sat May 26, 2012 6:40 am
- Location: UK
Re: Makefile advice - compiling an old game from source
Thank you, that is really help... I will try later.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"
- LetHopeItsSnowing
- Posts: 357
- Joined: Sat May 26, 2012 6:40 am
- Location: UK
Re: Makefile advice - compiling an old game from source
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
You dont get the menu up and it doesnt detect key presses, but now it compiles I can debug..
Thanks again.
Martin
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"
- LetHopeItsSnowing
- Posts: 357
- Joined: Sat May 26, 2012 6:40 am
- Location: UK
Re: Makefile advice - compiling an old game from source
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

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

"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"