samuelgr / xidi Goto Github PK
View Code? Open in Web Editor NEWDirectInput interface for XInput controllers
License: BSD 3-Clause "New" or "Revised" License
DirectInput interface for XInput controllers
License: BSD 3-Clause "New" or "Revised" License
Have you considered adding a custom mapping option? For example, this project fixes mapping in scarface game:
https://github.com/aap/XDinput/blob/master/dinput8/IDirectInputDevice8A.cpp#L115
I was thinking, maybe Xidi should offer additional functionality to achieve the same result?
SDL (Simple Directmedia Layer) is a popular cross-platform library for multi-media functions, including gamepad/joystick support. Currently it does not work at all with Xidi, not even allowing the virtual controllers to be enumerated.
Having done some digging, it appears that being compatible with SDL requires a few changes to Xidi:
I'm having an issue with this game on Windows 8.1, 10 and 11:
AFAIK this is a dinput 8 game, so dinput8.dll has to be used in this case. Now, when using dinput8.dll, vibration works fine but triggers won't:
In the game's mapping menu I assign left trigger to break and right trigger to accelerate. The game will recognize Left trigger as "RX Axis" and Right trigger as "RY Axis". So far, so good, cause they're 2 different axes indeed (thanks to "ExtendedGamepad" value in Xidi.ini file). Once you're racing, though, triggers behave as follows:
0 to halfway pressed = break/reverse
Halfway to fully pressed= accelerate
Does absolutely nothing despite being mapped.
I guess all it needs is calibrating triggers and sticks in the game's calibration menu, but here's the issue: the game will crash when exiting calibration menu, with the following message:
JOYSTICK:1574: Failed to set device properties (0x80004001)
Problem when this happens is that changes are not saved and therefore the game will use the triggers as described. When using dinput.dll, though, the game won't crash when exiting calibration menu, but both vibration and analog triggers won't work.
The only setting I've found so far that will kinda fix the issue is changing to "XInputNative" value in Xidi.ini file, and it's fine for the most part: right trigger will accelerate and left trigger will break, just as intended. The only issue is the game recognizes both as part of the same axis, so I can't use both at the same time. I know, I know, who would want to accelerate and break at the same time, right? Sometimes I like to try a few things and also I feel I am in full control of the car, so to speak. It may not be important in this game, but some more technical games/simulators might as well make good use of it.
Do you think this coul be addressed?
I will run as many tests as you require.
Thanks a lot for such incredible tool.
Is there a way to get controller vibration feedback working with Xidi? I have been using Xidi + Hookshot on an Xbox One controller via the included USB cable so far with the obscure 2004 PC port of Mega Man X8 (not to be mistaken for the version of Mega Man X8 included in Mega Man X Legacy Collection 2) and this PC port does support vibration feedback but the Xidi configuration I'm using is not allowing the game to toggle the vibration setting and it's grayed out instead. Oddly enough, without Xidi the option to toggle controller vibration is available but not with Xidi and Hookshot are hooking into the game's controller inputs.
EDIT: Never mind, I failed to see the lack of vibration support at the moment on the last second of the readme. I'll close but I hope rumble support gets implemented.
Instead of an explicit link with the XInput library switch to loading it dynamically at run-time and pick a version based on what the system makes available.
This concerns launching a game from Steam using Steam's controller config, regardless of the actual controller used. Steam's controller config results in a Steam virtual xinput controller being presented to the game. There is an issue when this game is using Xidi (for instance to make a virtual Directinput controller)
Naturally this is a grotesque stacking of various xinput wrappers already whose support is already dubious and I understand not wanting to look into it.
However, it almost already works except for one thing: input from Steam's virtual LT/RT triggers (analog, nor digital) is not recognized by Xidi.
All other controls work.
Possibly Steam's xinput wrapper presents its virtualized xinput triggers/axes in a slightly different way than expected or standard (which however works with xinput games natively)
To reproduce: Enable Steam controller remapping via Steam->settings->controller->general settings
Add a Non-Steam game that uses Xidi
Set up a Steam controller profile that outputs LT or RT from any gamepad button
Result: Xidi seems not to see anything configured to output LT/RT, but will handle input from any other xinput controls specified in the steam controller profile.
Fixing this would improve support for say, Steam Controller, Steam Deck, or any game launched via Steam.
Hi, I'm the maintainer of Ray2Fix, a collection of fixes for Rayman 2. A while ago we switched from dinputto8 to Xidi as the input wrapper, mostly for the input remapping features.
Recently I've received reports of input drop issues that seemingly only affect DS4 and DualSense controllers, only when using Xidi as the input wrapper.
Here's a video recording of the issue. As you can see at about the 0:02 mark, an X press is completely ignored by the game, but still registers on the input display (which uses XInput directly):
I'm also attaching the config and log file (although I haven't noticed any errors or anything weird myself):
I'm not entirely sure if the controller type matters, but I was not able to reproduce the issue myself with Xbox controllers (and I don't own a DS4/DualSense) and it has occurred to multiple R2 speedrunners, specifically using the PlayStation controllers.
Interestingly enough, the issue does not occur when using dinputto8 + Steam Input (what Ray2Fix used previously) instead of Xidi, and in either case the input display registers the button press just fine - so by a process of elimination, the issue must be related to Xidi in some way.
(If you need any more info/testing to debug this, please let me know)
This is mostly useful for XInput -> Directinput remapping, and is a feature XInputPlus has.
An ini setting to configure the instance to ignore all XInput controllers except for a specified player number.
This is useful for instance for emulating splitscreen by launching multiple instances of a game that does not handle multiple joystick devices/gamepads properly, and therefore should get each instance filtered to a specified XInput player number. So that the player 1 instance ini can be set to only take input from the Player 1 gamepad, and the player 2 instance ini can be set to only take input from the Player 2 gamepad, and so on.
Thanks!
Can't make Jazz Jackrabbit 2 load the winmm.dll (32bit 4.1.0.0) from Xidi (I have no log output either) using this xidi.ini:
[Mapper]
Type = DigitalGamepad
[Log]
Enabled = yes
Level = 4
Tried also the GOG collection and doesn't work as well: arcade joystick directions are ignored (Hori Fighting Stick MINI, DPAD XInput for directions), only buttons do work.
(See also #5 )
Hey there,
On the back of the successful fix for Soul Reaver 2 (#6), I decided to test out Xidi 1.0.2 with Legacy of Kain: Defiance. The game loads up just fine and the options menu detects a gamepad.....but it's not possible to assign any commands to the throttle buttons; LT and RT.
This behavior is similar when running Defiance (and Soul Reaver 2) with vanilla DirectInput on an XInput gamepad (as the throttle triggers are registered as an axis, as opposed to digital buttons).
As part of the appeal of using Xidi is that it can enforce the throttle triggers to work as digital buttons, it's surprising that Xidi works fine with Soul Reaver 2 and not with Defiance.
Please let me know if there's any further info I can provide and i'm ready & able to test.
Hey @samuelgr ,
After getting Silent Hill 4 working, I started a play-through and it seems that force feedback isn't working. This applies to both the retail and GOG version. Additionally, I also tried incorporating Hookshot but it didn't make a difference.
I also installed both versions of the game in a Win XP VM and used a Logitech Rumblepad 2 (w/ LGS 4.60 driver) and that did work...so vibration isn't inherently broken with the game. Silent Hill 2 and 3 work perfectly with Xidi dinput8, both with fully registered inputs and force feedback.
If you open Rayman 2 with only the keyboard connected there is a peculiar behaviour with the input. The main menu works fine, but going to New Game will make the first letter of the save naming menu start spinning, preventing you from creating the save, and loading a saved game will make the game act like you are always pressing the up key. This makes the game unplayable (because you are forced to play like you are always holding the up key) and forces you to remove xidi if you can't have the controller connected. This is the configuration file I'm using, it's from https://github.com/icup321/Ray2Fix:
Here a screenshot of the menu for context, the first letter is spinning:
Hello, is it possible to define a dead zone for an axis ?
I couldn't find any setting about that.
Thank you.
I'm pretty sure that the Dpad mapped to swapping soul reaver types and swapping between planes, but I can't seem to get the Dpad to map to anything in game.
Hello,
I'm trying to get winmm.dll working with Snes9x-x64 at Windows 10, but i get the following message:
Der Prozedureinsprungspunkt "mciSendStringW" wurde in der DLL "C:\Windows\System32\MSVFW32.dll" nicht gefunden.
Translation:
The procedure entry point "mciSendStringW" was not found in the DLL "C:\Windows\System32\MSVFW32.dll".
Update:
I've tried VisualBoyAdvance with the Win32 winmm.dll and there I get the same message, but with "mciSendStringA".
Thank you!
Xidi v.4.0.0 does work only partially in Spirit of Speed 1937. It is possible to remap buttons in the game's settings but during racing the controller doesn't work at all. Xidi v3.1.0 works fine.
Windows 10 21H1 x64, 8Bitdo SN30 Pro+
I wanted to use Xidi with the PC port of Chaos Legion and, while it works, it also has some unfortunate bug menu and crashes when trying to change the controls between Gamepad and Keyboard configurations from the in-game menu. It was working at first, but when trying to change the controls, the game either breaks the Gamepad 2 configuration and prevent it from being selectable (which allows for right stick camera movement like in the PlayStation 2 version whereas Gamepad 1 maps it to the W key on keyboard) or the game hangs mid load of the configuration options and then just crashes to desktop. I have to use a workaround of removing Xidi, switch the input settings to Gamepad 2, put the Xidi files back, then avoid the control settings entirely unless I remove Xidi altogether. I used Xidi v4.1.1 with the Dinput8.dll file without needing to use Hookshot for this game with an Xbox Series controller connected via Bluetooth with Mayflash's MAGIC NS-2 adaptor. Below is my crashlog when I recreated the crash and errors with the game. I also wanted to submit a Xidi configuration with this game and a few other games, but unfortunately I cannot submit them into the configuration repository myself.
With Xidi installed, every time I launch the game the language selected in the list of languages is always the one before the last selection. This doesn't happen without Xidi. It's like the cursor is getting positioned in the entry before the one where it's supposed to actually be. Here is a screenshot, the red one is the previously selected one, usually it will just show in yellow the menu item the cursor is in, and pressing the confirm button will select spanish instead of italian (this means you have to move the cursor down every time you start the game):
I have a custom config file I got from https://github.com/icup321/Ray2Fix:
I've bought an Hori Fighting Stick Mini (XInput device) and found some games that ignore this joystick movements because they are detected as POV-hat, and not as LSTICK for movements :(
Would be handy an additional XInput wrapper to just remap POV-hat to act as LSTICK...
Hey @samuelgr , hope all is well.
After giving Silent Hill 3 a shot in Linux, which works perfectly with Xidi's dinput8.dll, I moved on to Silent Hill 4 (GOG version). GOG's dinput wrapper, dixi, doesn't seem to detect the left and right throttle triggers on my Xbox Series X/S controller in WINE. Testing it in Windows works fine. From checking the guid for my pad, via SDL, the value is different between Windows and Linux. As a result of dixi being hard-coded, as far as I understand, there's no method I've determined to work around that directly.
Thus Xidi was the intended solution. GOG's implementation is a dinput8.dll and an accompanying dixi.ini. I simply moved those files and placed Xidi's 32bit version of dinput8.dll instead. The game registers the controller and the throttle buttons (LT/RT) work!....except it doesn't detect the right analog stick/axis. Testing the same in Windows has the same result. Lastly, I also tried using Hookshot but the results, both in Linux and Windows, were the same.
Assuming GOG's implementation hasn't been hard-coded into the games executable in anyway, maybe there's a way to get the right analog stick/axis detected? It'd be great if this can work as counting on GOG to update their hard-coded database for existing and future controllers isn't dependable. Checking on their forums, as well as else where online, seems a reasonable amount of people are having issues even with "supported" controllers. Cheers!
I actually have something like this here, but better approach would be something like
if (CharDriving())
XIDI_API_SET_PROFILE(L"InCar");
else if (CharOnFoot())
XIDI_API_SET_PROFILEL("OnFoot");
else
XIDI_API_SET_PROFILE(L"Custom");
inside another plugin.
Hi mate,
I'll get the usual fluffery out of the way first. Xidi has been amazing and have used it on numerous things like Splinter Cell: Conviction and Dead or Alive 5: Last Round. It's been an absolute godsend! Thank you for your efforts. :)
Now onto the slimy part where I ask something from ya after buttering you up some. Can you add a mapper which treats the D-Pad / POV hat of the Xinput controller as buttons 13-16 instead of an axes or POV?
I've been re-enabling gamepad support in the original SC and SC:PT for PC - which never had them but Xidi makes it possible to restore it. However, there is no way to bind the D-Pad / POV hat. Using Xinput Plus, if I use the DirectInput Output function and advise it to bind the D-Pad / POV as button 13-16, I can make the game do what I need. But Xinput Plus isn't nearly as elegant solution as Xidi and was only employed to "test" my theory about POV as buttons 13-16.
Thanks for your time. :)
PS: You got a donation area? Happy to shoot you a beer for your efforts and as thanks for enabling my fave fighting game, DOA5:LR to live on! :D
Most games that use Directinput are old and require few requirements, Windows 10 and 11 are already OS that demand more to the computer.
to take advantage of hardware that is still good enough to run these games.
I know there are alternatives like xinput plus, but xidi is much lighter and easier to configure and xidi is opensource.
and yes I installed Microsoft Visual C++ Redistributable and the error (0xc0000142) appears, I had this problem before with SH2 EE and a few weeks ago it was solved but only with dinput8, I need dinput.dll
Hi Samuel,
Hope things are well! The other week we released an update to the Silent Hill 2: Enhanced Edition project which includes the debut of Xidi with it. We've had some reports of the project being unable to launch due to VC Redist packages needing to be installed, along with others having an "error 0xc0000142" code while Xidi was in the game's directory.
Elisha made a build of Xidi with all dependencies removed but users are still reporting the error mentioned above. May we ask for your thoughts on this matter? Please see the tickets below for some of the user reports:
Thank you!
This game seems to completely ignore its local install folder, after placing the dinput8.dll in the folder, the game just detects the regular directinput xbox 360 controller from steam, it works fine in Flatout 2 and THPS4 and even on Steam Deck, any ideas, workarounds?
Edit: Tested on Windows 11H22, also tried the Hookshot method still nothing
I'll see if I can post the logs here
Hi,
Xidi isn't working on "tomb3decomp" (https://github.com/Trxyebeep/tomb3), "tomb4decomp" (https://github.com/Trxyebeep/TOMB4) and "tomb5decomp" (https://github.com/Trxyebeep/TOMB5), while "XInput Plus" is working. I've tried both "dinput.dll" and "dinput8.dll" and none of them seem to be working.
Thanks.
On the Controller settings in-game, Xidi Virtual Controllers (from 1 to 4) are selectable (and remain selected) even if no controller is connected to my PC.
Xidi's dinput8.dll
is on the latest version, Windows 11 version 22H2 is my OS. Another thing: I run this game through DxWnd.
Hi! I've just stumbled across this project after searching for a way to enable gamepad vibration in some older racing games for a while now.
I am currently trying to get FFB to function for Grand Prix 4 (2002) which has had its respective option in the game's settings greyed out by default.
I am using a kind of unusual setup, running the game through Proton on Steam Deck/Linux which is working fine though. Steam Deck uses XInput and is usually detected as an ordinary xbox360 or xboxone controller in more modern games with working pad vibration etc.
Now I've managed to get Xidi to work in combination with dinputto8, and the FFB setting is now actually selectable in the game's options, however there is no vibration whatsoever when starting a race.
I've created a Xidi.ini file according to the documentation and just tried playing around with the axis parameters for the left and right motor but unfortunately to no avail...
I've attached a log file below, any help would be appreciated!
Some games like Metal Gear, MGS 1 and 2 or Second sight (maybe others too but i dont know) now includes dixi which seems to do same job as xidi but is less advance in some aspects, yet it has good database of common populat controllers and defines hot to remap them to make all controlles work the same on different gamepads, i suggest to check it out and borrow in from it and make 100% compatible parser (maybe it should directly lod dixi.ini from gog) to unify bindings of various dinput gamepads.
Sometimes the standard DLL loading mechanism for winmm.dll
is bypassed and the Xidi version is ignored even if it is present. I suspect this is due to newer mods that might inadvertently be causing winmm.dll
to be loaded via API sets.
Given that these mods can be particularly important for the games to run at all on modern machines, Xidi will need to have the functionality to force its own version of winmm.dll
to be loaded even in these situations.
I remember around 15 years there was software from company that invented ForceFeedBack, that allowed to add FFD to any game or program like movie players (yep i used and watch movies with gamepad in hand to feel FORCE FEEDBACK from LFE channel), it worked very simple - it listened program sound output, and based on frequency thresholds that you can set, but mostly low frequency bass sounds, it turned those loud basses into force feedback signals.
It worked pretty well, vibrated at sounds of most of gun fires, explosions, collisions, heart beats... and Drum'N'Bass soundtracks XD
Usually native FFD effects happens at same events that has those low freq bass sounds, so mostly it works fine.
If such feature could be added in Xidi in addition to native FFD support (which as i saw is planned), it could be used to add FFD to games that never had it. It would be very good if this would implemented with selection of input channel and frequency range to feedback on, to allow transformation ot LF 5.1\7.1 subwoofer channel into source of FFD.
Even with Xidi v4.0.0 the vibration menu option is grayed out in Legacy of Kain: Defiance. In order to investigate this further I will need some assistance. The Xidi log shows that the game successfully invokes many parts of the DirectInput API for vibration, even to the point of creating a force feedback effect option, and then suddenly gives up for no apparent reason.
I tried this game on Windows 7 and XP using a real Logitech RumblePad 2 with the official Logitech drivers installed. The force feedback driver is installed and works properly via DirectInput, yet for some reason with this game the vibration option is still grayed out.
What I need is some additional information on a working combination of controller hardware and Windows version in order to investigate further. Either that or some additional technical insight into what this game needs internally to allow vibration to be available.
Solution: Dedicate Axis 5 to Left Trigger and Axis 6 to Right Trigger.
With an Xbox One controller, the controls in the following screenshot would normally be...
With Axis 5 being shared by the triggers.
Here's two examples of how Xbox 360/One controllers normally map
https://github.com/SnowyMouse/chimera/blob/master/controller_config/windows/xbox_360.txt
https://github.com/SnowyMouse/chimera/blob/master/controller_config/windows/xbox_one.txt
Replace system dinput8.dll with xidi dinput8.dll, may game can't work. dose xidi dinput8.dll need " system dinput8.dll" to work?
How do I configure extra buttons for Type=DigitalGamepad ?
This cfg doesn't work:
[Mapper]
Type = DigitalGamepad
; These changes are applied on top of the template.
ButtonA = Button(4)
ButtonB = Button(3)
ButtonX = Button(2)
ButtonY = Button(1)
it fails saying ButtonA etc. are unknown. My goal is to force my Hori Fighting Stick MINI arcade stick (DPAD for directions + 8 buttons) as LS controller with at least 4 buttons.
With Type = DigitalGamepad it works fine, but the emulator then detects just 1 fire button.
We have already #19 rumble support, but Xbox controllers evolved a bit and Xbox One controllers have Impulse triggers too. Is it possible to have Impulse Trigger Vibration support directly in Xidi?
My idea is that DirectInput vibration could activate every available motor - left motor, right motor, left trigger and right trigger when vibration is defined.
From configuration side it can have config flag which can decide about activation of these vibrations. If flag enabled - rumble motors + triggers are vibrating, if disabled only rumble motors are working. Optional option can be mode when only triggers are vibrating, disabling motors.
Similar implementation has already X1nput hook.
I was trying this out on Sonic Heroes's 2004 PC port and while it works, the in-game rumble feature doesn't seem to register with Xidi using the set-up I'm using for the game. I've made sure that the game's Vibration setting is set to ON with the save file I was using but I get to vibration feedback from the game. I'm not sure if it's because I'm using the DigitalGamepad
configuration to mimic a DirectInput controller for the game while using an Xbox Series controller. I am using Xidi v4.0.1 and the game seems to work with just the Xidi dinput8.dll and Xidi.HookModule.32.dll files.
Greetings,
Firstly, great work on this project!
Just wanted to report an issue between Xidi and Soul Reaver 2 (GOG version). If I place the dinput.dll into the Soul Reaver 2 folder and run the game, it immediately crashes to desktop (when the dinput.dll is removed, the title launches properly). The testing is done with an Xbox One controller on Windows 10.
I'm happy to do further testing, in order to help pinpoint the issue. :)
Game detects input device, rumble also works, but I can't seem to map anything as its not correctly responding to any inputs.
axis are completely maxed out, car fully accelerates and steers to the left without me doing anything.
the game works without issues on windows 10 computer, but I need it for steam deck.
I am noticing that every time I close the PC version of Mega Man X8 (the 2004 PC version, not the MT Framework version in the Legacy Collection), it always causes the game to crash as it closes going by how it always creates ~80 MB crash dumps all the time whenever I quit the game by pressing Alt+F4 or closing it from the title screen. I am using a combination of Xidi v3.1.0 with Hookshot v1.2.0, yet no matter the combination of hooking the game with Hookshot โ using the HookshotLauncher or Hookshot.exe โ it always crashes on exit instead of properly closing the game. I'm not sure if it also has to do with the No CD executable I'm using to play the game without having to use the disc in the CD drive to play it from the hard drive.
Hello,
https://steamcommunity.com/app/311730/discussions/0/3115898713386779166/
As seen on the above Steam post, I am trying to use Xidi on the game Dead or Alive 5 Last Round as I play with an Xbox One Controller.
After copying the Win32 files into the game directory, the tool works amazingly on its own as the Xbox One Controller works perfectly.
But I wish to use another tool called Autolink created by FallingCat, which adds many more features to the game:
https://steamcommunity.com/sharedfiles/filedetails/?id=1136603335
https://drive.google.com/file/d/1E1NPX-gWZeTwReYP4POzx2SjEmM5YsnO
Both tools use a dinput8.dll file that alters the game's controls upon launch.
Xidi fixes the problem of having no response on LT or RT, R3 registering as start, and start registering as the intended behavior of RT.
Autolink adds up keyboard commands only to the game.
I am clearly new to this, but could combining or merging both files to get one single dinput8.dll file work to get the best of both worlds?
Furthermore, the game won't launch with Hookshot.
Xidi v4.0.0, Windows 10 21H1 x64, 8Bitdo SN30 Pro+
Xidi_DInput_VRdirectx.exe_7544.log
Xidi_WinMM__HookshotLauncher_VRdirectx.exe_8084.log
Xidi_HookModule__HookshotLauncher_VRdirectx.exe_8084.log
It a little painfull to manually shape ini after downloading Xidi. Please consider to do a quick upate with base ini with all available options, mostly commented out
Hi, thanks for this interesting project.
I have Windows 7 x64 and I want to use Xidi with Xebra, a Playstation emulator.
This emulator uses winmm for joypads; however when I start Xebra with your dll it tells me that the XINPUT1_4.dll file is missing and the emulator does not take the commands.
I have read that that file is contained in the Windows 8 SDK libraries.
Can anything be done for Windows 7?
Thank you in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.