[v4 1/4] winejoystick.drv/joystick_osx.c: fixes Ry/Rx -> U/V axes mapping

Ken Thomases ken at codeweavers.com
Mon Jun 13 16:44:59 CDT 2016


On Jun 13, 2016, at 12:11 AM, David Lawrie <david.dljunk at gmail.com> wrote:
> 
> Ry now maps to U, Rx now maps to V. Windows defines Winmm U as Dinput Ry
> and V as Dinput Rx. Original joystick_osx.c mapping was other way
> around. This is also a bug in the Linux Winmm joystick version (not
> fixed with this patch).
> 
> Sources:
> https://msdn.microsoft.com/en-us/library/windows/hardware/ff538340(v=vs.85).aspx
> https://msdn.microsoft.com/en-us/library/windows/hardware/ff543445(v=vs.85).aspx
> 
> Tested on OS X 10.10.5.
> 
> Tested on Red Baron 3D, X-wing vs Tie Fighter, X-wing Alliance,
> Independence War deluxe w/ Logitech Extreme 3D pro and ControllerMate
> virtual joystick with 5/6 axes.

I originally wrote this code, but I think I was largely basing it on the Linux code without having a strong handle on the behavior of the R* axes.  Your testing is probably the most thorough that's been done for the Mac code, although I would expect the Linux code to have been tested pretty well.  Maybe the Linux code is correct and it's only the comments about what the joystick device is providing that are wrong.

So, the code changes appear to properly implement the logic you've described above, but I don't know if that's correct.  The cited MSDN pages are not terribly clear.

That said, I would prefer if you kept the order of the axes enum the same (consistently x, y, z order) and changed the order of the axis_map table in driver_joyGetPosEx(), instead.

-Ken




More information about the wine-devel mailing list