KoKuToru / koku-xinput-wine

Adds xinput support to wine, without changing the source of wine.
BSD 2-Clause "Simplified" License
69 stars 21 forks source link

Fixing IEnumWbemClassObject_Next_Koku logic #31

Closed kenshaw closed 6 years ago

kenshaw commented 6 years ago

IEnumWbemClassObject_NextKoku was not returning the appropriate WBEM* result values.

See: https://msdn.microsoft.com/en-us/library/aa390860(v=vs.85).aspx

This fixes an infinite loop bug with Cemu and likely other apps iterating over the XInput controllers through COM.

Tested with DualShock4, Xbox360, and WiiU gamepads.

flatwhatson commented 6 years ago

Excellent, thanks! This fixes hanging/crashing issues with Dark Souls, no more x360ce required there.

kenshaw commented 6 years ago

@flatwhatson I haven't purchased the latest Dark Souls -- which one did you test this with? I have a much bigger logic fix coming, in general, as there's still issues with some other games, but I don't have an ETA on when I'll be able to finish it, as I've got a lot of other coding on my plate ...

flatwhatson commented 6 years ago

I'm talking about "Dark Souls: Prepare to Die Edition" through Steam.

Originally, it would crash when loaded with koku-xinput-wine due to a memory protection bug. After we fixed that, it would hang after a minute of gameplay (or even in the menu). Your patch appears to have fixed that hang, at least with my testing for a few minutes.

Having koku-xinput-wine working makes Dark Souls much easier to play through wine. Previously x360ce and a dinput8 blocker were required to get a controller working at all. Installing x360ce in wine is a pain due to its winetricks requirements, and finding a working dinput8 blocker is a wild goose chase (hint: not the ones provided by x360ce).

Now, I have a clean wine prefix with Steam and Dark Souls installed. You need wine-staging with CSMT enabled to get decent framerates. Install the DSfix mod (optional but recommended), and run with the following:

# dinput8 override for dsfix
# winegstreamer override to fix movies crash
LD_PRELOAD="/usr/local/lib/koku-xinput-wine.so" \
WINEDLLOVERRIDES="dinput8=n,b;winegstreamer=" \
wine Steam.exe -applaunch 211420 # DARKSOULS.EXE

Also, "Dark Souls II: Scholar of the First Sin" has been working since koku added x64 support. I'm using it with Durazno (an xinput wrapper DLL) to fix joystick deadzones. Unfortunately "Dark Souls III" doesn't run well in wine yet; fingers crossed.

kenshaw commented 6 years ago

Interesting. I've bought the first 2 Dark Souls games, never got around to playing them because of the controller issue. Thanks for the input, I'll try Dark Souls on Steam with Wine then, after I finish BoTW. I'm writing a motion server for cemuhook so that I can use a DualShock 4 properly on Wine. Depending on how much time I waste playing BoTW (and my regular coding work...), hopefully should have that done / available soon. Not sure if there are any other apps besides Cemu that would benefit from what I'm doing there ...