<div dir="ltr"><div>On Mon, Jun 13, 2016 at 2:44 PM, Ken Thomases <span dir="ltr"><<a href="mailto:ken@codeweavers.com" target="_blank">ken@codeweavers.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Jun 13, 2016, at 12:11 AM, David Lawrie <<a href="mailto:david.dljunk@gmail.com">david.dljunk@gmail.com</a>> wrote:<br>
><br>
> Ry now maps to U, Rx now maps to V. Windows defines Winmm U as Dinput Ry<br>
> and V as Dinput Rx. Original joystick_osx.c mapping was other way<br>
> around. This is also a bug in the Linux Winmm joystick version (not<br>
> fixed with this patch).<br>
><br>
> Sources:<br>
> <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff538340(v=vs.85).aspx" rel="noreferrer" target="_blank">https://msdn.microsoft.com/en-us/library/windows/hardware/ff538340(v=vs.85).aspx</a><br>
> <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff543445(v=vs.85).aspx" rel="noreferrer" target="_blank">https://msdn.microsoft.com/en-us/library/windows/hardware/ff543445(v=vs.85).aspx</a><br>
><br>
> Tested on OS X 10.10.5.<br>
><br>
> Tested on Red Baron 3D, X-wing vs Tie Fighter, X-wing Alliance,<br>
> Independence War deluxe w/ Logitech Extreme 3D pro and ControllerMate<br>
> virtual joystick with 5/6 axes.<br>
<br>
</span>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.</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
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.<br></blockquote><div><br></div><div>It's certainly possible that "case 3" in the Linux code is actually Ry, I don't actually know. However, I wanted to make a note of it, just in case, as at least the labels are reversed as to how the documentation says they should be (I agree they are not the most clear documents and I don't know why Ry,Rx <-> U,V rather than other way around, but consistently in the document tables, Winmm U maps to Dinput Ry and V maps to Rx and visa versa). This is not a scenario that would come up very often, if at all. For controllers: only 6-axes mice, multi-joystick setups, and virtual joysticks/gamepads created from a combination of physically created joysticks, none of which are common. For apps: I have no idea how many Winmm applications/games actually pay attention to input from Ry,Rx/U,V axes. Even if one does and if the person has the multiple axes, they may not even realize that two of those axes *should've* been swapped by default depending on how they are used. So it's possible for it to have been wrong and simply no one noticed or thought much of it. I only changed the mapping in the mac version, not because I encountered a problem, but because when reading about Winmm, Dinput, and HID I realized that both the Linux and Mac mappings were inconsistent with the documentation. I would've made the exact same original mapping a priori and it isn't explained in the documentation why Ry should map to U and not Rx to U. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
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.<br></blockquote><div><br></div><div>Sure I think I can change that. To make certain (line #s are for fully patched file): so instead of swapping lines 101-102 as I did, I would swap lines 734 & 735? That seems like the only change I would have to make to keep the original enum order and change the axes mapping ... does that seem right? (lines 687 & 688 would stay as I have them)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888"><br>
-Ken<br>
<br>
</font></span></blockquote></div><br></div></div>