Skip to content

Instantly share code, notes, and snippets.

View jdinalt's full-sized avatar

Jason dinAlt jdinalt

View GitHub Profile
@jdinalt
jdinalt / shift.c
Created September 12, 2019 06:56
A quick hack to create a virtual "H-Shifter" from a numeric keypad
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <limits.h>
#include <assert.h>
@jdinalt
jdinalt / DiRT_2.0_FFB_Debug.txt
Last active September 7, 2019 21:49
Debug Notes for Broken FFB on DiRT Rally 2.0, Linux
TL;DR
Force feedback does not work with the Logitech G29 driving wheel on "DiRT Rally
2.0" when running under the Linux/Proton environment. This leads to a
sub-satisfactory gaming experience.
I have traced the issue to a SDL2 call, SDL_HapticUpdateEffect(), made by the
the following Proton patch:
https://git.froggi.es/tkg/PKGBUILDS/blob/2b563056f83e555bef56616a9a48578b1ea0758c/wine-tkg-git/wine-tkg-patches/proton-sdl-joy.patch
diff -Naur SDL2-2.0.10/src/haptic/DSDL_Log.h SDL2-2.0.10.x/src/haptic/DSDL_Log.h
--- SDL2-2.0.10/src/haptic/DSDL_Log.h 1969-12-31 16:00:00.000000000 -0800
+++ SDL2-2.0.10.x/src/haptic/DSDL_Log.h 2019-09-04 10:06:57.000000000 -0700
@@ -0,0 +1,62 @@
+#ifndef DSDL_LOG_H
+#define DSDL_LOG_H
+
+#include <stdarg.h>
+
+#define DSDL_LOG_ENABLED 1
@jdinalt
jdinalt / sdl2-hapatic-retry.patch
Created September 5, 2019 18:58
SDL2 Patch to fix FFB on DiRT Rally 2.0 on Linux
diff -Naur SDL2-2.0.10/src/haptic/linux/SDL_syshaptic.c SDL2-2.0.10.patched/src/haptic/linux/SDL_syshaptic.c
--- SDL2-2.0.10/src/haptic/linux/SDL_syshaptic.c 2019-07-24 21:32:36.000000000 -0700
+++ SDL2-2.0.10.patched/src/haptic/linux/SDL_syshaptic.c 2019-09-04 10:52:36.784736281 -0700
@@ -974,6 +974,7 @@
SDL_HapticEffect * data)
{
struct ff_effect linux_effect;
+ int retry_count = 0;
/* Create the new effect */