Pull requests

#24 Merged
Repository
Deleted repository
Branch
default (862a7e429b62)
Repository
richard42/mupen64plus-input-sdl mupen64plus-input-sdl
Branch
default

Use SDL2 to play force feedback effects

Author
  1. ecsv
Reviewers
Description

A test for SDL2 force feedback.

I've had to set the time of the ingame effect to 0x7fff instead of SDL_HAPTIC_INFINITY in my tests because otherwise it isn't played at all with xboxdrv (it is a bug in the driver).This is by the way also the reason why the current implementation works for some people when using the mem/rumble switch button but not ingame. I don't have access to a gamepad with real force feedback under linux to test it. But maybe can get an XBox360 gamepad next week for a test with the xpad kernel driver.

I've tried a workaround for xboxdrv by adding following change to mupen64plus-input-sdl. This isn't a valid workaround for m64p - a bug against xboxdrv was opened instead https://github.com/Grumbel/xboxdrv/issues/47

--- a/src/plugin.c
+++ b/src/plugin.c
@@ -735,6 +735,7 @@ static void InitiateRumble(int cntrl)
      ffeffect[cntrl].id = -1;
      ffeffect[cntrl].u.rumble.strong_magnitude = 0xFFFF;
      ffeffect[cntrl].u.rumble.weak_magnitude = 0xFFFF;
+    ffeffect[cntrl].replay.length = 0x7fff; // xboxdrv is buggy and doesn't support infinite replay

      ioctl(controller[cntrl].event_joystick, EVIOCSFF, &ffeffect[cntrl]);

Comments (0)