Related Wine issue: https://bugs.winehq.org/show_bug.cgi?id=52714
I'm starting work on updating/extending Linux force feedback API and one of my goals is to expose the number and an array that contains the device's ffb-enabled axes. As I'm mainly working with USB PID driver, I already have a POC of obtaining this data.
What prompted this is that currently Wine always creates virtual joysticks with two PID ffb axes. This causes issues with [Richard Burns Rally](https://github.com/ValveSoftware/…
[View More]Proton/issues/6702#issuecomment-267…, as this game incorrectly initializes a `CONSTANT_FORCE` effect with all the FFB axes that contain `DIDOI_FFACTUATOR` flag and then trying to update `cAxes` and `rgdwAxes` values which leads to `DIERR_INVALIDPARAM`.
Now, this flag is set by wine while enumerating virtual device's axes and while `(axis index < FFB axes)`, flag is applied. This means, that every device which has FFB functionality and at least two axes, will report FFB on `X`, `Y`.
While updated API would mean a lot of steering wheels would correctly report only 1 axis, a lot of USB PID wheels still include `X` and `Y` in their `AXES_ENABLE` and `DIRECTION` usages. This, again, would lead to broken FFB (in affected games).
On Windows, there's a possibility of overwriting some joystick capabilities with registry entries, which ends up removing `DIDOI_FFACTUATOR` flag from a selected axis. This doesn't work in Wine.
This MR allows Wine to add an arbitrary number (up to `PID_AXES_MAX`) of axes to the PID descriptor, based on the value of Haptic Axes from SDL or from Linux FF api in the future (I'm working on it). Additionally, to work around RBR and other games with similar, wrong FFB handling, I introduced a [hint](https://github.com/libsdl-org/SDL/issues/12341) to SDL that allows a dynamic overwrite of the number of haptic axes. For the Linux API, I'll figure out a nice way to override when the number of axes will be exposed.
With these changes, I was able to successfully get force feedback on my Moza Racing R9 with all axes usable. With additional traces in the dinput code, I confirmed that with one axis defined in the PID descriptor, the game created a constant force effect with just one axis and `cAxes = 1`.
--
v30: dinput/tests: Add tests for 6-axis ff joystick
https://gitlab.winehq.org/wine/wine/-/merge_requests/7422
[View Less]
Related Wine issue: https://bugs.winehq.org/show_bug.cgi?id=52714
I'm starting work on updating/extending Linux force feedback API and one of my goals is to expose the number and an array that contains the device's ffb-enabled axes. As I'm mainly working with USB PID driver, I already have a POC of obtaining this data.
What prompted this is that currently Wine always creates virtual joysticks with two PID ffb axes. This causes issues with [Richard Burns Rally](https://github.com/ValveSoftware/…
[View More]Proton/issues/6702#issuecomment-267…, as this game incorrectly initializes a `CONSTANT_FORCE` effect with all the FFB axes that contain `DIDOI_FFACTUATOR` flag and then trying to update `cAxes` and `rgdwAxes` values which leads to `DIERR_INVALIDPARAM`.
Now, this flag is set by wine while enumerating virtual device's axes and while `(axis index < FFB axes)`, flag is applied. This means, that every device which has FFB functionality and at least two axes, will report FFB on `X`, `Y`.
While updated API would mean a lot of steering wheels would correctly report only 1 axis, a lot of USB PID wheels still include `X` and `Y` in their `AXES_ENABLE` and `DIRECTION` usages. This, again, would lead to broken FFB (in affected games).
On Windows, there's a possibility of overwriting some joystick capabilities with registry entries, which ends up removing `DIDOI_FFACTUATOR` flag from a selected axis. This doesn't work in Wine.
This MR allows Wine to add an arbitrary number (up to `PID_AXES_MAX`) of axes to the PID descriptor, based on the value of Haptic Axes from SDL or from Linux FF api in the future (I'm working on it). Additionally, to work around RBR and other games with similar, wrong FFB handling, I introduced a [hint](https://github.com/libsdl-org/SDL/issues/12341) to SDL that allows a dynamic overwrite of the number of haptic axes. For the Linux API, I'll figure out a nice way to override when the number of axes will be exposed.
With these changes, I was able to successfully get force feedback on my Moza Racing R9 with all axes usable. With additional traces in the dinput code, I confirmed that with one axis defined in the PID descriptor, the game created a constant force effect with just one axis and `cAxes = 1`.
--
v29: Little fix
https://gitlab.winehq.org/wine/wine/-/merge_requests/7422
[View Less]
Related Wine issue: https://bugs.winehq.org/show_bug.cgi?id=52714
I'm starting work on updating/extending Linux force feedback API and one of my goals is to expose the number and an array that contains the device's ffb-enabled axes. As I'm mainly working with USB PID driver, I already have a POC of obtaining this data.
What prompted this is that currently Wine always creates virtual joysticks with two PID ffb axes. This causes issues with [Richard Burns Rally](https://github.com/ValveSoftware/…
[View More]Proton/issues/6702#issuecomment-267…, as this game incorrectly initializes a `CONSTANT_FORCE` effect with all the FFB axes that contain `DIDOI_FFACTUATOR` flag and then trying to update `cAxes` and `rgdwAxes` values which leads to `DIERR_INVALIDPARAM`.
Now, this flag is set by wine while enumerating virtual device's axes and while `(axis index < FFB axes)`, flag is applied. This means, that every device which has FFB functionality and at least two axes, will report FFB on `X`, `Y`.
While updated API would mean a lot of steering wheels would correctly report only 1 axis, a lot of USB PID wheels still include `X` and `Y` in their `AXES_ENABLE` and `DIRECTION` usages. This, again, would lead to broken FFB (in affected games).
On Windows, there's a possibility of overwriting some joystick capabilities with registry entries, which ends up removing `DIDOI_FFACTUATOR` flag from a selected axis. This doesn't work in Wine.
This MR allows Wine to add an arbitrary number (up to `PID_AXES_MAX`) of axes to the PID descriptor, based on the value of Haptic Axes from SDL or from Linux FF api in the future (I'm working on it). Additionally, to work around RBR and other games with similar, wrong FFB handling, I introduced a [hint](https://github.com/libsdl-org/SDL/issues/12341) to SDL that allows a dynamic overwrite of the number of haptic axes. For the Linux API, I'll figure out a nice way to override when the number of axes will be exposed.
With these changes, I was able to successfully get force feedback on my Moza Racing R9 with all axes usable. With additional traces in the dinput code, I confirmed that with one axis defined in the PID descriptor, the game created a constant force effect with just one axis and `cAxes = 1`.
--
v28: Change few things around
dinput/tests: Add tests for 6-axis ff joystick
https://gitlab.winehq.org/wine/wine/-/merge_requests/7422
[View Less]
The last of the saving patches for d3dx9. :)
--
v2: d3dx9: Add support for saving IDirect3DVolumeTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory().
d3dx9: Add support for saving IDirect3DCubeTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory().
d3dx9: Add support for saving IDirect3DTexture9 textures to DDS files in D3DXSaveTextureToFileInMemory().
d3dx9/tests: Add more tests for saving textures to DDS files.
d3dx9/tests: Add a test for …
[View More]reading back a texture saved as D3DXIFF_JPG.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7636
[View Less]
Jinoh Kang (@iamahuman) commented about server/user.c:
> + * need atomic intrinsics to guarantee that. */
> +#if defined(__i386__) || defined(__x86_64__)
> + *ptr = value;
> +#else
> + __atomic_store_n(ptr, value, __ATOMIC_SEQ_CST);
> +#endif
> +}
> +
> +static void atomic_store_u64(volatile unsigned __int64 *ptr, unsigned __int64 value)
> +{
> + /* on x86 there should be total store order guarantees, so volatile is
> + * enough to ensure the …
[View More]stores aren't reordered by the compiler, and then
> + * they will always be seen in-order from other CPUs. On other archs, we
> + * need atomic intrinsics to guarantee that. */
> +#if defined(__i386__) || defined(__x86_64__)
> + *ptr = value;
64-bit volatile stores are not atomic on `__i386__`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7610#note_98862
[View Less]
This workarounds KWin and Mutter window manager bugs/fanciness. The KWin bug is with maximized windows getting broken after sending a configure request, and which fix has been merged upstream already. The Mutter issue is unlikely to be fixed upstream, at least not its specific behavior, and we would instead better handle it as well as we can.
--
v5: winex11: Workaround KWin bug with maximized windows.
winex11: Set _NET_WM_USER_TIME to 0 to implement SWP_NOACTIVATE.
winex11: Keep …
[View More]track of the SWP flags to be used when mapping windows.
winex11: Keep _NET_WM_USER_TIME on the individual windows.
winex11: Workaround Mutter bug when changing decorations.
winex11: Update _MOTIF_WM_HINTS after _NET_WM_STATE and config.
winex11: Avoid creating windows with override-redirect flag set.
winex11: Track _MOTIF_WM_HINTS property in the state tracker.
winex11: Introduce a new handle_state_change helper.
winex11: Ignore transient state changes in other processes.
winex11: Give focus to the expected window when unampping with focus.
winex11: Use the current state when deciding how to reply to WM_TAKE_FOCUS.
winex11: Use the state tracker for the desktop window _NET_WM_STATE.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6944
[View Less]
For https://gitlab.winehq.org/wine/wine/-/merge_requests/7512 to use it to locate window shared objects.
--
v10: win32u: Use the session shared object for user handle entries.
win32u: Use the session shared object to implement is_window.
server: Move the user object handle table to the shared memory.
server: Use NTUSER_OBJ constants for user object types.
server: Create a shared memory object for the global session.
include: Implement ReadAcquire64.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7610