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/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`.
--
v7: dinput/tests: Add tests for 6-axis ff joystick
winebus: Get the number of haptic axes from SDL
winebus: Support creation of arbitrary number of PID axes
https://gitlab.winehq.org/wine/wine/-/merge_requests/7422
--
v2: ws2_32: Support bind for Bluetooth RFCOMM addresses.
ws2_32: Add bind tests for Bluetooth RFCOMM sockets.
server: Add support for creating Bluetooth RFCOMM sockets.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7634
For https://gitlab.winehq.org/wine/wine/-/merge_requests/7512 to use it to locate window shared objects.
--
v8: win32u: Use the session shared object to implement is_window.
win32u: Use the session shared object for user handle entries.
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.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7610
If the `FT_MULFIX_ASSEMBLER` macro is not used during the compilation of FreeType,
unsigned extension to `FT_Fixed` will cause `FT_MulFix` to produce incorrect results.
The usage of the attached code is for compilation with GCC on x86_64.
Toggling the `FT_MULFIX_ASSEMBLER` macro will produce different results.
demo: [main.c](/uploads/18e77f790be1cb5acf2ef8f52b61bf39/main.c)
Signed-off-by: YeshunYe <yeyeshun(a)uniontech.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7633
Some console objects currently do several unique things:
* Delegate waits onto the queue of another object. This is not really a problem
for in-process waits, since we can just return the sync object for the
delegate. However, it's also unnecessary, adds to the complexity of the server
logic, and is one out of one places where this is done.
* Make the wait state dependent on the process. This is difficult to emulate
with ntsync and would require creating separate server objects for each
process, hacking into duplicate_handle.
* Fail a wait entirely in certain circumstances. This is pretty much impossible
to emulate with in-process waits.
Although ntsync has been in development for some time, I have regrettably failed
to notice these problems until now.
Fortunately, none of these behaviours happen on modern Windows. Although I/O on
unbound handles delegates to the console of the current process, the signaled
state does not. As the tests here show, the signaled state of a handle depends
on the active console of the process in which the handle was created. If that
console no longer exists, the signaled state is no longer updated [with one
rather inexplicable exception].
Crucially, in current Windows waits never fail, and the state of an object is
the same across all process which hold handles to it. Therefore this patch
brings our behaviour to closer match current Windows.
In theory these are fds and should use default_fd_signaled(). However, the
points at which the handles are signaled are completely different, and I/O does
not trigger console handles to become signaled when it normally would. Therefore
for the time being I've kept the code using custom signaled ops.
There is one other oddity related to consoles, which is the existence of
console_add_queue(), which seeks to lazily create an input thread when a console
is first waited on. This is one out of two places, after this patch, when the
wait process is hijacked (the other being message queues). Fortunately this is
easy to handle for in-process synchronization objects, by queueing the ioctl
from the callback used to retrieve the in-process synchronization object itself.
--
v3: server: Track unbound output signaled state based on its original console.
server: Track unbound input signaled state based on its original console.
server: Allow waiting on an orphaned screen buffer.
server: Use a list of screen buffers per console.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7608