Commit 028e9a17 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Implemented DirectInput Joystick support (tested with WC:Prophecy).

parent 5910c681
......@@ -506,6 +506,7 @@ AC_CHECK_HEADERS(\
float.h \
libio.h \
linux/cdrom.h \
linux/joystick.h \
linux/ucdrom.h \
ncurses.h \
net/if.h \
......@@ -541,6 +542,27 @@ AC_C_INLINE()
AC_TYPE_SIZE_T()
AC_CHECK_SIZEOF(long long,0)
if test "$ac_cv_header_linux_joystick_h" = "yes"
then
AC_CACHE_CHECK("whether linux/joystick.h uses the Linux 2.2+ API",
wine_cv_linux_joystick_22_api,
AC_TRY_COMPILE([
#include <sys/ioctl.h>
#include <linux/joystick.h>
struct js_event blub;
],/*empty*/,
wine_cv_linux_joystick_22_api=yes,
wine_cv_linux_joystick_22_api=no,
wine_cv_linux_joystick_22_api=no
)
)
if test "$wine_cv_linux_joystick_22_api"
then
AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API)
fi
fi
dnl **** statfs checks ****
if test "$ac_cv_header_sys_vfs_h" = "yes"
......
......@@ -95,3 +95,6 @@
/* Define if the system has dynamic link library support with the dl* API */
#undef HAVE_DL_API
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
#undef HAVE_LINUX_22_JOYSTICK_API
......@@ -124,6 +124,9 @@
/* Define if the system has dynamic link library support with the dl* API */
#undef HAVE_DL_API
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
#undef HAVE_LINUX_22_JOYSTICK_API
/* The number of bytes in a long long. */
#undef SIZEOF_LONG_LONG
......@@ -226,6 +229,9 @@
/* Define if you have the <linux/cdrom.h> header file. */
#undef HAVE_LINUX_CDROM_H
/* Define if you have the <linux/joystick.h> header file. */
#undef HAVE_LINUX_JOYSTICK_H
/* Define if you have the <linux/ucdrom.h> header file. */
#undef HAVE_LINUX_UCDROM_H
......
......@@ -643,6 +643,95 @@ typedef struct DIEFFESCAPE {
DWORD cbOutBuffer;
} DIEFFESCAPE, *LPDIEFFESCAPE;
typedef struct DIJOYSTATE {
LONG lX;
LONG lY;
LONG lZ;
LONG lRx;
LONG lRy;
LONG lRz;
LONG rglSlider[2];
DWORD rgdwPOV[4];
BYTE rgbButtons[32];
} DIJOYSTATE, *LPDIJOYSTATE;
typedef struct DIJOYSTATE2 {
LONG lX;
LONG lY;
LONG lZ;
LONG lRx;
LONG lRy;
LONG lRz;
LONG rglSlider[2];
DWORD rgdwPOV[4];
BYTE rgbButtons[128];
LONG lVX; /* 'v' as in velocity */
LONG lVY;
LONG lVZ;
LONG lVRx;
LONG lVRy;
LONG lVRz;
LONG rglVSlider[2];
LONG lAX; /* 'a' as in acceleration */
LONG lAY;
LONG lAZ;
LONG lARx;
LONG lARy;
LONG lARz;
LONG rglASlider[2];
LONG lFX; /* 'f' as in force */
LONG lFY;
LONG lFZ;
LONG lFRx; /* 'fr' as in rotational force aka torque */
LONG lFRy;
LONG lFRz;
LONG rglFSlider[2];
} DIJOYSTATE2, *LPDIJOYSTATE2;
#define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
#define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
#define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
#define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
#define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
#define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
#define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
(n) * sizeof(LONG))
#define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
(n) * sizeof(DWORD))
#define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
#define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
#define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
#define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
#define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
#define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
#define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
#define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
#define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
#define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
#define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
#define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
#define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
#define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
#define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
#define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
#define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
#define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
#define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
#define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
#define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
#define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
#define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
#define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
#define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
#define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
#define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
#define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
#define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
#define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
#define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
#define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
#define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
/*****************************************************************************
* IDirectInputEffect interface
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment