Sonic and Sega Retro Message Board: SADX Input Mod - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

SADX Input Mod v1.8, 01/22/2016 (formerly "SADX PC '04 XInput")

#1 User is offline Morph 

Posted 01 January 2015 - 02:51 AM

  • AKA SonicFreak94.
  • Posts: 603
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA2 netplay & hax, SADX:FE
  • Wiki edits:11
This mod fixes issues with XInput controllers (camera problems, adds rumble) and some DirectInput controllers. It uses SDL2 to allow simultaneous usage of XInput and DirectInput controllers, and increases the maximum number of controllers from 4 (sometimes 8 depending on where you look in SADX's code) to 8.

Requirements:


What it does:
  • Configurable deadzones per stick
  • Configurable rumble intensity
  • XInput rumble
  • Per-Controller rumble
  • Fixes right analog stick (first person camera bug) for XInput and some DirectInput controllers
  • Extended buttons - LB is Dreamcast C, RB is Z, and Back is D.


What it doesn't:
  • Configurable controls.


Configuration:
To configure deadzones and the like, create a text file called "config.ini" in the mod's folder (as in, mods/input-mod, where input-mod.dll is). As for the contents, here's an example of my deadzones I use for my DualShock 4.

[Controller 1]
DeadzoneL = 4096
DeadzoneR = 4096
TriggerThreshold = -1


The deadzone can be anywhere from 0 to 32767. A value of -1 means that it will use the default XInput deadzone.

You can also enable or disable radial input using the following parameters. By default, it's enabled for the left stick and disabled for the right stick.

RadialL = (0/1, 1 by default)
RadialR = (0/1, 0 by default)


And for reference, these are the default XInput deadzones.
  • 7849 for the left stick
  • 8689 for the right stick
  • 30 for the triggers


Other configuration fields:
  • RumbleFactor - Rumble intensity factor; floating point. 1.0 by default. This value can be as low as 0.0 and as high as you want, but it might cause issues with really high values.
  • Debug - (0/1) Enables display of ingame debug information about your controller when you press L1/LB.


To change the controller you're configuring for, simply change the number after "Controller" in the first example (e.g [Controller 1] -> [Controller 2]). You can configure up to 8 controllers.

Download:


p.s xinput sucks, signed gerbilsoft-senpai
This post has been edited by Morph: 23 January 2016 - 01:58 AM

#2 User is offline Tweedle 

Posted 01 January 2015 - 02:55 AM

  • Posts: 9
  • Joined: 15-September 13
  • Gender:Female
  • Location:Texas, US
Happy new year, This looks very helpful, I'll try it out later!

#3 User is offline IndyTheGreat 

Posted 01 January 2015 - 02:26 PM

  • Posts: 46
  • Joined: 28-August 14
  • Gender:Male
  • Project:Fixed Water (SADX PC)
You CAN use the triggers in the Steam release though... just go into the config and move the camera controls from the bumpers to the triggers.

#4 User is offline Morph 

Posted 01 January 2015 - 06:55 PM

  • AKA SonicFreak94.
  • Posts: 603
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA2 netplay & hax, SADX:FE
  • Wiki edits:11
I suppose you're right. Last time I had tried, it didn't work, but that could have actually been DS4Windows doing its occasional "who needs button presses!" thing. I've still got the D-Pad and not-as-overbearing rumble though (which is still subject to adjustment) =P

Edit: see below
This post has been edited by Morph: 07 January 2015 - 07:25 PM

#5 User is offline Morph 

Posted 02 January 2015 - 05:09 AM

  • AKA SonicFreak94.
  • Posts: 603
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA2 netplay & hax, SADX:FE
  • Wiki edits:11
Updated it the day after I released it. Fantastic :v:

I modified this to link with XInput 1.3 specifically which is available in the DirectX End-User Runtime. I also fixed an oversight which would cause it to crash on Windows XP.

That's about it, really.

#6 User is offline Morph 

Posted 06 January 2015 - 11:06 PM

  • AKA SonicFreak94.
  • Posts: 603
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA2 netplay & hax, SADX:FE
  • Wiki edits:11
Bug fix!

With the help of some testers in #x-hax: fixed an integer rollover which--even though it shouldn't have, and I did many tests to ensure it didn't--caused the axes to reverse direction under certain conditions (third party controllers).
This post has been edited by Morph: 06 January 2015 - 11:12 PM

#7 User is offline Conzuh 

Posted 07 January 2015 - 05:15 PM

  • Gumball Eyes!
  • Posts: 56
  • Joined: 19-March 12
  • Gender:Male
  • Project:Realising two years of ideas.
I just wanted to say thank you, Morph. I can't believe we've gone this long with only a hodgepodge of a hack to get 360 controllers semi-working.

You're doing SEGA's work.

#8 User is offline ShadowBlitz 

Posted 07 January 2015 - 07:00 PM

  • Posts: 11
  • Joined: 28-October 14
  • Gender:Male
This mod is pretty awesome. Makes it a lot more natural to use a 360 controller. I'm assuming this probably works with Xbone's controller as well, but I don't feel like using that until I can get a wireless adapter for it.

#9 User is offline Morph 

Posted 07 January 2015 - 07:35 PM

  • AKA SonicFreak94.
  • Posts: 603
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA2 netplay & hax, SADX:FE
  • Wiki edits:11
Thanks guys!

If you end up trying it out, let me know if that controller works, ShadowBlitz.

#10 User is offline ShadowBlitz 

Posted 09 January 2015 - 12:48 AM

  • Posts: 11
  • Joined: 28-October 14
  • Gender:Male

View PostMorph, on 07 January 2015 - 07:35 PM, said:

Thanks guys!

If you end up trying it out, let me know if that controller works, ShadowBlitz.


I gave it a try and it definitely does work fine with a One controller. No obvious issues for sure.

#11 User is offline Morph 

Posted 12 February 2015 - 07:10 PM

  • AKA SonicFreak94.
  • Posts: 603
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA2 netplay & hax, SADX:FE
  • Wiki edits:11
Quick update. I've disabled the debug display by request (which would normally appear when LB/L1 is pressed); compatibility doesn't seem to be an issue at this point anyway. The functionality is otherwise the same.

This brings the version number to 1.3. You can grab it from the first post, or from GitHub. If you have problems with your controller, you can use the previous version (1.2) from GitHub as well, and the debug information will be available again. Alternatively, you can compile your own Debug build, but that's not the most user friendly option given that I haven't provided instructions, I suppose =P

#12 User is offline Morph 

Posted 26 March 2015 - 07:20 PM

  • AKA SonicFreak94.
  • Posts: 603
  • Joined: 01-August 08
  • Gender:Male
  • Location:Utah
  • Project:SA2 netplay & hax, SADX:FE
  • Wiki edits:11
Here's another rather minor update.

I may or may not have been handling button presses incorrectly, so I've made it pretty much exactly the same as found in the original (albeit disassembled) code. I've also updated the mod loader to v3.2, which is now a hard requirement. You'll have to update it before you can use the latest mod.

I've also disabled per-controller rumble until I can figure out how to detect if a player is currently AI controlled.

This brings the version number to 1.4. As always, you can grab the latest version from the first post or the GitHub release page. Let me know if I broke anything.
This post has been edited by Morph: 26 March 2015 - 07:25 PM

#13 User is offline CheatFreak 

Posted 24 June 2015 - 10:42 PM

  • Everything or Nothing.
  • Posts: 28
  • Joined: 22-May 13
  • Gender:Male
  • Location:Michigan
  • Project:BetterSADX Patch
I don't seem to be getting any rumble on my Logitech F710 Xinput controller- the rumble works fine in any other game- is the rumble disabled entirely as of now?
Also- Xinput Button Prompts for english speakers! (DL: https://u.teknik.io/MSktVp.zip)
Spoiler

This post has been edited by CheatFreak: 25 June 2015 - 11:32 PM

#14 User is offline Ch1pper 

Posted 25 June 2015 - 11:42 AM

  • Fighting the Battle of Who Could Care Less
  • Posts: 568
  • Joined: 01-November 09
  • Gender:Male
  • Project:Life.
  • Wiki edits:40
I'd love to try that out, but after clicking the link I'm getting multiple "Warning: mysql_connect(): No connection could be made because the target machine actively refused it."

#15 User is offline CheatFreak 

Posted 25 June 2015 - 04:26 PM

  • Everything or Nothing.
  • Posts: 28
  • Joined: 22-May 13
  • Gender:Male
  • Location:Michigan
  • Project:BetterSADX Patch

View PostCh1pper, on 25 June 2015 - 11:42 AM, said:

I'd love to try that out, but after clicking the link I'm getting multiple "Warning: mysql_connect(): No connection could be made because the target machine actively refused it."

If you were talking about my button prompts- I think it's because teknik was down earlier- it's back up now.

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users