Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Ineffective for Sonic & All-Stars Racing Transformed #13

Open
chewi opened this issue Nov 20, 2016 · 11 comments
Open

Ineffective for Sonic & All-Stars Racing Transformed #13

chewi opened this issue Nov 20, 2016 · 11 comments

Comments

@chewi
Copy link

chewi commented Nov 20, 2016

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.

@KoKuToru
Copy link
Owner

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

With #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..

@chewi
Copy link
Author

chewi commented Nov 21, 2016

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?

@KoKuToru
Copy link
Owner

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

@chewi
Copy link
Author

chewi commented Dec 22, 2016

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

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

@chewi
Copy link
Author

chewi commented Feb 26, 2017

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.

@Enverex
Copy link

Enverex commented Oct 27, 2017

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
Copy link

Enverex commented Oct 28, 2017

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
Copy link

Enverex commented Oct 28, 2017

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.

@chewi
Copy link
Author

chewi commented Oct 28, 2017

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.

@Enverex
Copy link

Enverex commented Oct 28, 2017

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.

@chewi
Copy link
Author

chewi commented Apr 7, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants