Heretic 2
Install & patch the game
To install the required utils :
# apt-get install xxd
To install the game, mount your CD & run the installer with linux32
from the util-linux
package :
# mount /dev/cdrom /media/cdrom $ linux32 bash /media/cdrom/setup.sh $ cp /media/cdrom/bin/x86/glibc-2.1/heretic2 <installation-directory>
Apply the first patch :
$ linux32 bash heretic2-1.06a-x86.run
Apply the second patch :
$ linux32 bash heretic2-1.06b-x86.run
Apply the last released patch :
$ linux32 bash heretic2-1.06c-x86.run
Unfortunately, even the “dynamic” binary is statically linked with an old SDL, so we are stuck with that version and it's bugs
So, if we are stuck with an old SDL anyway, to make our life easier we will use the “static” binary that embed the others legacy libraries needed (most notably libesd.so.0
and libsmpeg-0.4.so.0
).
Note: The dependency on libesd.so.0
exist only because the statically linked SDL is compiled with ESD (Enlightened Sound Daemon) support. ESD hasn't been relevant for 15 years now, so there is very little chance that you will want to use it with SDL_AUDIODRIVER=esd
. If you want to use the “dynamic” binary, you can safely do something like
patchelf --remove-needed libesd.so.0 heretic2.dynamic
Launch the game
To launch the game using the software renderer:
./heretic2 +set vid_ref soft -w
Fix crash when using the OpenGL renderer
If you try to use the OpenGL renderer
./heretic2 +set vid_ref glx +set gl_driver /usr/lib/i386-linux-gnu/libGL.so.1
it crashes immediately with received Signal 11 (SIGSEGV): Segmentation violation
:
The ref_glx.so library wants to print a list of OpenGL extensions available in your graphic driver. What's happening is that the buffer with the extensions is too large for the 8192 bytes allocated text-string use by vsprintf. The program crash after overwriting instruction memory with text data. The most simple way to fix this, is to never let vsprintf write the buffer. It's only a message console, it's never used for anything useful in the game!
You can do it graphically, using an hex editor, find “GL_EXTENSIONS: %s” and replace “%s” by 2 spaces.
Or you can do it in with xxd
:
$ cp ref_glx.so ref_glx.so.orig $ echo -n "2020" | xxd -r -p -seek 0x3E689 - ref_glx.so