I've been trying to get SDLQuake working on my Raspberry Pi computer but have run into an annoying issue. I've successfully got the program to compile and run however when trying to create a new game I receive a segmentation fault.
I've done some digging and it appears to be caused when trying to load progs.dat. From what I've found on google progs.dat is the compiled game logic in QuakeC. Obviously a very important file, but fails to load when trying to start a new single player or multiplayer game.
This is the code base I'm using: http://www.libsdl.org/projects/quake/
and my edited makefile: SDLQuake R-Pi Makefile - Pastebin.com
I did a little stack trace with gdb which gave me this:
#0 0xb6def284 in fread () from /lib/arm-linux-gnueabihf/libc.so.6
#1 0x000475e0 in Sys_FileRead (handle=115, dst=<optimized out>, count=413116) at sys_sdl.c:218
#2 0x00010f5c in COM_LoadFile (path=0x51c6c "progs.dat", usehunk=<optimized out>) at common.c:1583
#3 0x0002e004 in PR_LoadProgs () at pr_edict.c:995
#1 0x000475e0 in Sys_FileRead (handle=115, dst=<optimized out>, count=413116) at sys_sdl.c:218
#2 0x00010f5c in COM_LoadFile (path=0x51c6c "progs.dat", usehunk=<optimized out>) at common.c:1583
#3 0x0002e004 in PR_LoadProgs () at pr_edict.c:995
Code:
int Sys_FileRead (int handle, void *dst, int count)
{
char *data;
int size, done;
size = 0;
if ( handle >= 0 ) {
data = dst;
while ( count > 0 ) {
done = fread (data, 1, count, sys_handles[handle]);
if ( done == 0 ) {
break;
}
data += done;
count -= done;
size += done;
}
}
return size;
}
Any assistance on getting this working would be awesome
Thanks.

Leave a comment: