[PATCH v2] winebus.sys: Allow XBOX Masquerade to be turned off

Zebediah Figura z.figura12 at gmail.com
Mon Nov 19 19:17:15 CST 2018


On 11/19/2018 06:29 PM, Brendan McGrath wrote:
> Elite Dangerous appears to iterate input devices via
> DInput and will only defer to XInput if there is a
> HID device with a matching VID and PID.
> 
> The current behaviour of the SDLBUS is to masquerade
> any controller as an XBOX controller. This causes
> Elite Dangerous to treat any other type of contoller
> as a Joystick.
> 
> This patch allows this masquerading behaviour to be
> switched off via two REG_DWORD registry entries under
> HKLM\System\CurrentControlSet\Services\SDLJOY:
> - 'Controller VID'
> - 'Controller PID'
> 
> 0 - Turns it off (so it uses the real VID and PID)
> 
> Any other value will define the value used in the masquerade.
> 
> If the values are missing, the default behaviour is to leave
> it as is (i.e an XBOX controller).
> 
> Signed-off-by: Brendan McGrath <brendan at redmandi.com>
> ---
> Changes since v2:
>    - allow VID and PID to be defined (as well as switched off)
>    - use the existing SDLJOY registry entry
> 
> I'm using a Logitech F310 gamepad. SDL recognises it as a controller
> but Elite Dangerous ignores it (due to the masquerade).
> 
> At the moment, if 'Map Controllers' is set to '1' - the
> VID and PID is hard-coded to be an XBOX controller (I'm not familiar with
> the history to understand why that is - but I suspect for better game support).
> 
> So I would say the device is able to be programmatically recognised by using the
> the SDL_IsGameController API. But this is currently only used when 'Map Controllers' is set
> to '1' and thus the real VID and PID values are lost (note that Proton does not have this
> masquerade thus the controller is working).
> 
> When I set 'Map Controllers' to '0' - the correct VID and PID are added, but not as
> a gamepad (it uses an 'IM' entry instead of 'IG'). So again Elite Dangerous ignores the entry.
> 
> This is because my controller reports 11 buttons where as the code expects a gamepad to report
> 14 or more.
> 
> I changed it to look for 10 and a hat and this worked - but the mapping was all wrong. This
> is an approach I could explore further - but I feel the SDL_IsGameController approach is already
> working - but for the masquerade.

Be that as it may, I'm not sure that a registry hack is the approach we 
want to take. If the game doesn't work with controllers that don't 
report themselves as gamepads, but should, then we should fix it to work.

At the same time, as regards your original problem, we should look to 
rewrite the dinput joystick code on top of Wine's HID stack, so that it 
will report the same VID/PID as xinput does. I believe Aric is working 
on some patches to this effect ;-)



More information about the wine-devel mailing list