koku-xinput-wine icon indicating copy to clipboard operation
koku-xinput-wine copied to clipboard

Ineffective for Sonic & All-Stars Racing Transformed

Open chewi opened this issue 7 years ago • 11 comments

Hello. Thank you for your great work. I have seen this work for the XInputTest.exe program that can be found in the x360ce repository but unfortunately it seems ineffective for the one game I'm trying to play. I also tried your new and wine branches but they didn't help.

To cut a long story short, without XInput it's like one of the axis is permanently stuck, even under real Windows 10. x360ce works under Windows but it also has no effect under Wine for this particular game. I tried to get more information from the x360ce team in order to approach the Wine team but despite giving some hints to another user earlier this year, they decided they weren't going to help me today. I'd rather use your solution anyway.

This game requires x360ce's COM HookMask. After comparing your code against theirs, it looks as though you're doing something similar but not hooking as many functions. Perhaps CoGetClassObject is significant? I captured logging from starting Steam, starting the game, quitting the game, and then quitting Steam. I can see CoGetClassObject mentioned just before it outputs controller messages at line 1081 that you only see when it has fallen back to DirectInput.

One more thing, when using this project with Launcher.exe, the game's configurator, it crashes out on startup with a StackOverflowException after printing this over and over.

koku-xinput-wine: CoSetProxyBlanket(...);

This doesn't matter much as you generally don't need to use the configurator and this doesn't happen to the game itself. Just thought I should make you aware of it.

Please let me know if you need any more information.

chewi avatar Nov 20 '16 23:11 chewi

The whole COM thing is pretty ugly and stupid...

With https://github.com/KoKuToru/koku-xinput-wine/pull/9 I started to cleanup some stuff.. But the COM-Part is still pretty ugly. It's maybe much easier to add the "gamepads" to the wine devices.. I tried to find the code where the gamepad gets returned but couldn't find it.. The COM-Hack does nothing else then changing the Name/ID (or whatever) so the game thinks it's a XInput Controller.

Maybe I have time this holidays (~20.December) to check the wine code again.. if I don't forget..

KoKuToru avatar Nov 21 '16 19:11 KoKuToru

Thanks for the quick reply. I know that Wine's DirectInput code adds the devices here for js and here for event but I suspect that's not the code you meant. xboxdrv allows me to name the device whatever I like but if I try VID_3ED9&PID_9E57&IG_00, it doesn't make any difference, probably because this is only exposed through DirectInput. You're talking about WMI?

chewi avatar Nov 21 '16 21:11 chewi

well I am searching for the code which returns the PnP devices.. (and/or register the devices) the thing I hook

KoKuToru avatar Nov 23 '16 19:11 KoKuToru

Maybe I have time this holidays (~20.December) to check the wine code again.. if I don't forget..

So about that code... :wink: In your own time, man, have a good Christmas.

chewi avatar Dec 22 '16 22:12 chewi

The alternative project, wine-xinput, explains that this game doesn't work because it mixes DirectInput with XInput. I have heard that Wine's own XInput support is slowly progressing so hopefully something can be done to make this work.

chewi avatar Feb 26 '17 16:02 chewi

The same issue seem to affect Pro Evolution Soccer 2016/2017 as well, for the same reason. It does DInput enumeration before XInput, the same as Sonic ASRT.

Enverex avatar Oct 27 '17 18:10 Enverex

Sonic Racing Transformed now works perfectly. Its config program (Launcher.exe) will crash if Koku is loaded, but you don't need to use that program when using XInput anyway.

On the other hand, Pro Evo 2016/17 (and its config program) crash if you load Koku: =>0 0xf7f7b763 _ZN4koku16CoCreateInstanceERK5_GUIDP8IUnknownjS2_PPv+0xb3() in koku-xinput-wine.so (0x0032f328)

Enverex avatar Oct 28 '17 11:10 Enverex

Another one is Castle Crashers. With Koku loaded it sits at 100% CPU usage and never actually loads the game. Loads fine without Koku (but obviously the controllers then don't work).

And CEmu. It'll start, but if you try and go into the Inputs interface to select the controller, the program will hang.

Enverex avatar Oct 28 '17 12:10 Enverex

Sonic Racing Transformed now works perfectly. Its config program (Launcher.exe) will crash if Koku is loaded, but you don't need to use that program when using XInput anyway.

I found this hard to believe given how much trouble I'd had with it before but you are… almost right! It's not immediately apparent but I'm quite sure that you don't get full acceleration. When using the keyboard, I came 4th without trying that hard. When using the controller, I struggled to keep out of last place and the car felt a bit sluggish. I'm not sure why as XInputTest.exe shows what I believe is the full range of values for the trigger, 0-255. I usually use Thrustmaster controllers with xboxdrv. I tried to test with a real 360 controller but the wireless adapter wasn't playing ball today.

chewi avatar Oct 28 '17 14:10 chewi

Odd, I came second in B class after having not played for probably more than a year and repeatedly cocking up, so I wonder if that's not a universal problem.

Worth noting that Castle Crashers works with one of the DLL based XInput emulators so it's not universally broken.

Enverex avatar Oct 28 '17 14:10 Enverex

Here's an update for Wine 3.5. As you know, we can't build this project any more. If I run the game with xboxdrv but without any additional hacks, it seems to use XInput (the button icons are green A, red B, etc) and the menus work but I can't accelerate or reverse. I guess Wine didn't put it the extra stuff needed to make this one work yet.

This bug report suggests disabling all the controllers in joy.cpl but that didn't work for me, the game didn't detect a controller at all.

chewi avatar Apr 07 '18 08:04 chewi