====== SiN ======
===== Install the game =====
To install the required utils & library:
# apt-get install patchelf xxd libsmpeg0:i386
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
And now the fun begins :-) The installer is a mess and doesn't do half of what it is supposed to. We need to do a good half of the job ourself :
cd
install -m 755 /mnt/cdrom/bin/x86/registergui ./
tar xfz /mnt/cdrom/base/maps.tar.gz -C ./base/
mv ref_soft.so.gz ref_soft.so
mv ref_gl.so.gz ref_gl.so
mv game.so.gz game.so
mv game.so base/game.so
mv sin.exe.gz sin.exe
===== Register the game =====
The file ''sin.exe'' is "//encrypted//" (I didn't spend time on this, maybe it's trivial to bypass, maybe not) ; and we need to combine the provided tool with our cdkey to get a usable binary.
The hard part in today's world is to get the required libraries to run that tool. We need GTK1.2 compiled for i386.
After that it's easy:
./registergui sin.exe
===== Remove a useless dependency =====
The game is linked to 2 versions of the SDL library: ''libSDL-1.1.so.0'' & ''libSDL-1.2.so.0'' ; it's useless and harmful, since you will not find a libSDL-1.1 for you distribution easily. Lets remove that:
patchelf --remove-needed libSDL-1.1.so.0 sin.exe
===== Fix crash when using the OpenGL renderer =====
Like in [[sof|others]] [[heretic2|games]] we need to patch the OpenGL renderer to prevent a crash.
echo -n "2020" | xxd -r -p -seek 0x38A08 - ref_gl.so
===== Prevent a game crash =====
This is due to a change in ''libgcc'' that broke some binaries that where compiled with gcc 2.95 in an unusual way (like compiling C++ code with ''gcc'' instead of ''g++'').
==== Option a ====
You can use a little [[https://github.com/twolife/lokishim|shim]] that add back functions required by a bunch of old games like this one.
LD_PRELOAD="/path/to/lokishim.so" ./sin.exe +set vid_ref gl +set gl_driver_lib /usr/lib/i386-linux-gnu/libGL.so.1
==== Option b ====
The missing function can be found in a //very// old ''libstdc++'', and you can use ''libstdc++-3-libc6.2-2-2.10.0.so'' from [[https://www.improbability.net/loki/loki_compat_libs-1.5.tar.bz2|https://www.improbability.net/loki/]]
LD_PRELOAD="./libstdc++-3-libc6.2-2-2.10.0.so" ./sin.exe +set vid_ref gl +set gl_driver_lib /usr/lib/i386-linux-gnu/libGL.so.1