[v3 1/4] winejoystick.drv/joystick_osx.c: fixes Ry/Rx -> U/V axes mapping
David Lawrie
david.dljunk at gmail.com
Sun Jun 12 22:44:55 CDT 2016
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.
v2: whitespace fixes v3: split patch up
Signed-off-by: David Lawrie david.dljunk at gmail.com
---
dlls/winejoystick.drv/joystick_osx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/winejoystick.drv/joystick_osx.c b/dlls/winejoystick.drv/joystick_osx.c
index 48c05a0..77dbef8 100644
--- a/dlls/winejoystick.drv/joystick_osx.c
+++ b/dlls/winejoystick.drv/joystick_osx.c
@@ -9,6 +9,7 @@
* Copyright 2002 David Hagood
* Copyright 2009 CodeWeavers, Aric Stewart
* Copyright 2015 Ken Thomases for CodeWeavers Inc.
+ * Copyright 2016 David Lawrie
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -97,8 +98,8 @@ enum {
AXIS_X,
AXIS_Y,
AXIS_Z,
- AXIS_RX,
AXIS_RY,
+ AXIS_RX,
AXIS_RZ,
NUM_AXES
};
@@ -617,8 +618,8 @@ LRESULT driver_joyGetDevCaps(DWORD_PTR device_id, JOYCAPSW* caps, DWORD size)
switch (i)
{
case AXIS_Z: caps->wCaps |= JOYCAPS_HASZ; break;
- case AXIS_RX: caps->wCaps |= JOYCAPS_HASU; break;
- case AXIS_RY: caps->wCaps |= JOYCAPS_HASV; break;
+ case AXIS_RY: caps->wCaps |= JOYCAPS_HASU; break;
+ case AXIS_RX: caps->wCaps |= JOYCAPS_HASV; break;
case AXIS_RZ: caps->wCaps |= JOYCAPS_HASR; break;
}
}
--
2.5.4 (Apple Git-61)
More information about the wine-patches
mailing list