games/koules: Make joysticks work again.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-01-08 00:11:33 -05:00 committed by Willy Sudiarto Raharjo
parent 1195b77643
commit b9a6d30880
No known key found for this signature in database
GPG key ID: 3F617144D7238786
2 changed files with 31 additions and 2 deletions

View file

@ -10,13 +10,17 @@
# This script doesn't share any code with whatever build script # This script doesn't share any code with whatever build script
# existed back then (partly because I couldn't find a copy) # existed back then (partly because I couldn't find a copy)
# TODO: make -E the default size. It's 2023, nobody wants to play a game
# in a window the size of a postcard (or a playing card, on 4K).
# 20230107 bkw: BUILD=4, fix paths to joystick devices (/dev/jsX => /dev/input/jsX)
# 20211020 bkw: BUILD=3, fix -current build. # 20211020 bkw: BUILD=3, fix -current build.
cd $(dirname $0) ; CWD=$(pwd) cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=koules PRGNAM=koules
VERSION=${VERSION:-1.4} VERSION=${VERSION:-1.4}
BUILD=${BUILD:-3} BUILD=${BUILD:-4}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz} PKGTYPE=${PKGTYPE:-tgz}
@ -81,7 +85,7 @@ patch -p1 < $CWD/patches/slackware.diff
patch -p1 < $CWD/patches/compile_fix.diff patch -p1 < $CWD/patches/compile_fix.diff
# Modern gcc seems to hate the inline assembly. Anyway I bet gcc's code # Modern gcc seems to hate the inline assembly. Anyway I bet gcc's code
# with -O2 is the same or faster... # with -O2 is the same or faster... and we need this for x86_64 too.
patch -p1 < $CWD/patches/no_inline_asm.diff patch -p1 < $CWD/patches/no_inline_asm.diff
# The author forgot to mention the -E option in the help and man page # The author forgot to mention the -E option in the help and man page
@ -90,6 +94,10 @@ patch -p1 < $CWD/patches/document_E_option.diff
# Some people might like the launcher... # Some people might like the launcher...
patch -p1 < $CWD/patches/tcl_launcher_paths.diff patch -p1 < $CWD/patches/tcl_launcher_paths.diff
# 20230107 bkw: this has been broken for ages, I just now decided to play
# this game with a joystick...
patch -p1 < $CWD/patches/joystickdevs.diff
# I hate Imake even worse than autoconf... # I hate Imake even worse than autoconf...
if [ "$MITSHM" = "no" ]; then if [ "$MITSHM" = "no" ]; then
sed -i -e '/#define MITSHM/d' Iconfig sed -i -e '/#define MITSHM/d' Iconfig

View file

@ -0,0 +1,21 @@
diff -Naur koules1.4/xlib/init.c koules1.4.patched/xlib/init.c
--- koules1.4/xlib/init.c 1998-03-05 12:03:01.000000000 -0500
+++ koules1.4.patched/xlib/init.c 2023-01-07 23:23:21.963726308 -0500
@@ -334,7 +334,7 @@
printf ("Autoprobing hardware\n");
printf ("Initializing joystick driver\n");
#ifdef JOYSTICK
- joystickdevice[0] = open ("/dev/js0", O_RDONLY);
+ joystickdevice[0] = open ("/dev/input/js0", O_RDONLY);
if (joystickdevice[0] < 0)
{
perror ("Joystick driver");
@@ -343,7 +343,7 @@
}
else
printf ("Joystick 1 initialized\n");
- joystickdevice[1] = open ("/dev/js1", O_RDONLY);
+ joystickdevice[1] = open ("/dev/input/js1", O_RDONLY);
if (joystickdevice[1] < 0)
{
perror ("Joystick driver");