Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: The Adventures of Xinput and the Search for the Center Spring!  (Read 7138 times)

0 Members and 1 Guest are viewing this topic.

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:January 20, 2025, 08:08:03 pm
  • I'm a llama!
Hi guys,


In response to the discussion Howard and I had, as depicted in the comments from the following thread:



Spring centering is a very simple thing to enable via direct input though... it's literally two lines of code.  If Model 2 is running in non-exclusive mode a little app could easily be written to turn it on.  I'm not sure if model 2 would override the settings or not, but considering I use mamehooker to send FF effects while mame is actively polling the joystick, I doubt it.  That is the other option btw... to fully externalize FF effects and have mamehooker deal with them.  I've gotten most of the games mapped out the new troubleshooter app.



Howard if you can convert or write from scratch a new ffb DInput dll file that does what my current xinput one does, that would be fantastic.  :cheers:

Well a dll is a way to do it, but I don't think that it's the best way.

The spring setting is just that, a setting,... it isn't something that has to be constantly changed. 

How directinput usually works:

1.  DX and DI are initalized

2.  Settings (such as deazones, calibrations ect and yes spring centering) are applied to found joysticks

3.  The joystick is polled in the game loop and/or the joystick sends an event notification to the window.
3b.  Again, within the game loop Force effects, if any, are loaded or tweaked as needed

4.  Game closes, all the DX stuff is destroyed.   

Now as it relates to us, this is a very good thing.  Direct Input allows you to change settings for a joystick at any time.  Since normally the spring setting is only set at the start of a game, we can just set it to something else later.  It won't interfere with model 2 and (hopefully) it won't get set back, so there isn't any need to override the entire dll, which takes a lot of time and effort to write. 

For the record I know nothing about FF in xinput though.  I wasn't even aware that they had figured out how to control wheels with xinput actually.  News to me!

I don't know if this fix would help you with your particular problem though.  Center Spring is just a generic bit of math applied to real effects.  If your wheel motors are so strong that they override the spring, then your effects are set too high.  Not much I can do about that.  Now fancy racers will fake a center spring manually by applying custom math to their effects, but that's well about my pay grade.  I'm too stupid to do that kind of math.  ;)



http://forum.arcadecontrols.com/index.php/topic,130376.msg1339049.html#msg1339049



Something very interesting has come up since then that I would like to share with you. Yes my friends, a solution has been found  :applaud:


Earlier in that thread I had asked Howard if he could make a .dll file that would deliver a center spring effect to my wheel, and make it so that even when I click away to another program or window it doesn't lose focus, returning my wheel to its loose and sloppy feeling. I had been using Fedit to accomplish this but having been fed up with fedit and the way it would sometimes lose focus any way, I stopped using it altogether. After all this time, little did I know that the solution to this problem was right under my nose the whole time.... it is the SAME XINPUT.DLL Racer_S wrote for me!!!!!! That's right, other than allowing me to use my wheel with xinput supported emulators and games, this little file can provide my wheel with a nice center spring effect for ANY game and at ANY time *without* losing focus.....at least not until I exit the game!


Being that the file is a .dll file, it never dawned on me that I could use this same xinput.dll file for the same task I was using fedit for. The thing I that blew my mind, was that all I needed to do was open the XinputTest.exe or ANY program that triggers the .dll file, and simply keep it running in the background! I discovered this when using a PS1 emulator called PCSX. When I launch PCSX, it automatically activates the xinput.dll and you hear a "beep" sound and suddenly the wheel receives the spring signal. All this time I didn't know that the signal to the wheel will not lose focus *even* when clicking away or starting a game!

Whether it's the xinputTest.exe or a PS1 emulator, whatever triggers and activates the dll will cause it to grab your wheel exclusively and keep hold of it until you exit a game! This is a **HUGE** game changer for me, and will definitely suffice until Howard releases FFB Troubleshooter!

This amazing discovery is one of the main reasons I've gotten back into playing OutRun 2006 PC recently, and is a GODSEND for Ridge Racers 2 on the PPSSPP emulator....for without it, I'd be playing the game with very loose and sloppy feeling wheel. I can now have a very nice and bouncy spring feel to any game that doesn't support ffb, even MAME!

Speaking of MAME, it's ironic, because this dll file is the same one I was trying to get MAME to activate, but it doesn't(not directly). Now, after putting two and two together, I realize I can get any MAME racing game to activate the xinput.dll by simply writing a batch command that launches both the rom and xinputTest.exe, which in turn activates the dll file..all in one simple click! I even have it set up so that the racing games from MAME are in my steam library and when I click on them in steam it launches the game and the xinputTest.dll. Boom, instant center spring!

The only thing I can't figure out is how to write a batch command that *closes* the xinputTest.exe. That way I don't have to click on it manually to close it. I've tried commands like "Exit xinputTest.exe", "Killtask xinputTest.exe", and "Close xinputTest.exe" but none of them works.

Anyway long story short, for those of you with ffb steering wheels that want to play OutRun 2006 PC, MAME or any other non-ffb games/emulators, this is THE best solution. Just download the attached files and place them whereever you want. Double click the ini file and change the parameters under "WheelSpringGain" and "WheelIntertiaGain" until you find one that suits you. The settings in the file I'm uploading are pretty good for me already but since most of you guys are using a G25/G27 results may vary. Then, simply open the XinputTest.exe file and voila, instant spring effect via Xinput!

Any questions just ask.  :cheers:
« Last Edit: May 23, 2013, 02:05:10 am by isamu »

Fursphere

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1266
  • Last login:Today at 12:08:31 am
Re: The Adventures of Xinput and the Search for the Center Spring!
« Reply #1 on: May 23, 2013, 09:21:15 am »
Unless I'm reading something wrong there, the Logitech Profiler does this on a user set pre-program basis.

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9269
  • Last login:Today at 07:04:08 pm
  • ...
Re: The Adventures of Xinput and the Search for the Center Spring!
« Reply #2 on: May 23, 2013, 09:29:03 am »
Unless I'm reading something wrong there, the Logitech Profiler does this on a user set pre-program basis.

Logitech Profiler only works on Logitech wheels.  ;)

isamu is rocking an ECCI7000 which is awesome, but like most other wheels lacks useful profiler type software.
http://www.ecci7000.com/
It uses the Immersion arcade board and drivers, so this also applies to anyone using that board.

Normally, the wheel has no resistance if the game isn't sending the ffb signal for it.
It's kinda nice to at least have centering feedback for MAME and games that don't have any ffb.
This adds that option.
« Last Edit: May 23, 2013, 09:30:59 am by BadMouth »

Fursphere

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1266
  • Last login:Today at 12:08:31 am
Re: The Adventures of Xinput and the Search for the Center Spring!
« Reply #3 on: May 23, 2013, 09:35:33 am »
Gotcha. 

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:January 20, 2025, 08:08:03 pm
  • I'm a llama!
Re: The Adventures of Xinput and the Search for the Center Spring!
« Reply #4 on: May 23, 2013, 08:18:49 pm »
What Badmouth said!

Also, the thing about it is, this dll file doesn't just have one simple center spring effect, it has multiple spring effect parameters *and* the inertia effect!

This is important and something I specifically asked Racer_S for, because it actually allows me to give my ECCI 7000 just the right amount of spring stiffness I want. If I set all 12 Spring parameters to their max at 9999, my wheel will be too hard to turn and that will be over doing it. So I have about 4 parameter lines set to 9900 and the 5th one set around 2000.

In addition, and I cannot stress this enough....the inertia parameter setting is EXTREMELY helpful in getting that extra spring bouncy-ness. A setting of around 3500, when coupled with the other spring settings, does wonders to the feel of the wheel. I know it's strange, but with the inertia setting, my wheel starts to feel like it has real springs in it. It really lends itself well to the normal spring effects already in place.

I guarantee you even if Immersion allowed their Touchsense Software Center Spring settings to go higher, it still wouldn't match the superb center spring feeling this xinput.dll delivers to my wheel! The cusomizability the ini file has is insane. Like Badmouth said it's great MAME and is a must have for OutRun 2k6!

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:January 20, 2025, 08:08:03 pm
  • I'm a llama!
Re: The Adventures of Xinput and the Search for the Center Spring!
« Reply #5 on: February 20, 2014, 06:36:15 pm »
Bump for Boomslang, and anyone else who may want this  :angel:

Boomslang

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1063
  • Last login:January 01, 2024, 08:20:43 pm
  • I want to build my own arcade controls!
Re: The Adventures of Xinput and the Search for the Center Spring!
« Reply #6 on: March 09, 2014, 12:13:41 am »
This doesn't seem to work for me. Dunno why

Im using a fanatic gt2 but even if I put wheel into Logitech G25 mode it still doesn't work

When I load testinput it always says Not Connected...is it meant to connect?

isamu

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:January 20, 2025, 08:08:03 pm
  • I'm a llama!
Re: The Adventures of Xinput and the Search for the Center Spring!
« Reply #7 on: March 09, 2014, 06:42:42 pm »
This doesn't seem to work for me. Dunno why

Im using a fanatic gt2 but even if I put wheel into Logitech G25 mode it still doesn't work

When I load testinput it always says Not Connected...is it meant to connect?

Try messing around with the settings in the ini file. Make sure the index under "PAD1" matches the order of your wheel in Windows. So if Your wheel is the first controller on the list, the index should be either 0 or 1.

Quote
[Options]
UseAutoPad=0         #use 0 to 1; automatically make other PAD to PAD1 after detecting movement
UseInitBeep=1         #use 0 to 1; default 1; beep on init
UsePad2Trigger=0      #use 0 to 1; uses triggers from pad2 for pad1 (for separate usb pedals)


#Logitech G25 Racing Wheel / Generic Wheel
[PAD1]

Index=0          #controller index in game controllers list; 0 is first; -1 to ignore this pad