From f97ba160f941f2fe25d08a4d7c8aafcd386e2652 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 29 Oct 2002 22:02:57 +0000 Subject: [PATCH] Moved 16 bit joystick function to mmsystem.c. --- dlls/winmm/joystick.c | 124 +---------------------------------------- dlls/winmm/mmsystem.c | 127 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 123 deletions(-) diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c index c4ede34a2d..aea97d3e4c 100644 --- a/dlls/winmm/joystick.c +++ b/dlls/winmm/joystick.c @@ -35,7 +35,6 @@ #endif #include "mmsystem.h" -#include "winbase.h" #include "winnls.h" #include "wingdi.h" #include "winuser.h" @@ -44,7 +43,7 @@ #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL(mmsys); +WINE_DEFAULT_DEBUG_CHANNEL(winmm); #define MAXJOYSTICK (JOYSTICKID2 + 1) #define JOY_PERIOD_MIN (10) /* min Capture time period */ @@ -134,14 +133,6 @@ UINT WINAPI joyGetNumDevs(void) return ret; } -/************************************************************************** - * joyGetNumDevs [MMSYSTEM.101] - */ -UINT16 WINAPI joyGetNumDevs16(void) -{ - return joyGetNumDevs(); -} - /************************************************************************** * joyGetDevCapsA [WINMM.@] */ @@ -199,46 +190,6 @@ MMRESULT WINAPI joyGetDevCapsW(UINT wID, LPJOYCAPSW lpCaps, UINT wSize) return ret; } -/************************************************************************** - * joyGetDevCaps [MMSYSTEM.102] - */ -MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) -{ - JOYCAPSA jca; - MMRESULT ret = joyGetDevCapsA(wID, &jca, sizeof(jca)); - - if (ret != JOYERR_NOERROR) return ret; - lpCaps->wMid = jca.wMid; - lpCaps->wPid = jca.wPid; - strcpy(lpCaps->szPname, jca.szPname); - lpCaps->wXmin = jca.wXmin; - lpCaps->wXmax = jca.wXmax; - lpCaps->wYmin = jca.wYmin; - lpCaps->wYmax = jca.wYmax; - lpCaps->wZmin = jca.wZmin; - lpCaps->wZmax = jca.wZmax; - lpCaps->wNumButtons = jca.wNumButtons; - lpCaps->wPeriodMin = jca.wPeriodMin; - lpCaps->wPeriodMax = jca.wPeriodMax; - - if (wSize >= sizeof(JOYCAPS16)) { /* Win95 extensions ? */ - lpCaps->wRmin = jca.wRmin; - lpCaps->wRmax = jca.wRmax; - lpCaps->wUmin = jca.wUmin; - lpCaps->wUmax = jca.wUmax; - lpCaps->wVmin = jca.wVmin; - lpCaps->wVmax = jca.wVmax; - lpCaps->wCaps = jca.wCaps; - lpCaps->wMaxAxes = jca.wMaxAxes; - lpCaps->wNumAxes = jca.wNumAxes; - lpCaps->wMaxButtons = jca.wMaxButtons; - strcpy(lpCaps->szRegKey, jca.szRegKey); - strcpy(lpCaps->szOEMVxD, jca.szOEMVxD); - } - - return ret; -} - /************************************************************************** * joyGetPosEx [WINMM.@] */ @@ -264,14 +215,6 @@ MMRESULT WINAPI joyGetPosEx(UINT wID, LPJOYINFOEX lpInfo) return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETPOSEX, (DWORD)lpInfo, 0L); } -/************************************************************************** - * joyGetPosEx [MMSYSTEM.110] - */ -MMRESULT16 WINAPI joyGetPosEx16(UINT16 wID, LPJOYINFOEX lpInfo) -{ - return joyGetPosEx(wID, lpInfo); -} - /************************************************************************** * joyGetPos [WINMM.@] */ @@ -290,25 +233,6 @@ MMRESULT WINAPI joyGetPos(UINT wID, LPJOYINFO lpInfo) return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETPOS, (DWORD)lpInfo, 0L); } -/************************************************************************** - * joyGetPos [MMSYSTEM.103] - */ -MMRESULT16 WINAPI joyGetPos16(UINT16 wID, LPJOYINFO16 lpInfo) -{ - JOYINFO ji; - MMRESULT ret; - - TRACE("(%d, %p);\n", wID, lpInfo); - - if ((ret = joyGetPos(wID, &ji)) == JOYERR_NOERROR) { - lpInfo->wXpos = ji.wXpos; - lpInfo->wYpos = ji.wYpos; - lpInfo->wZpos = ji.wZpos; - lpInfo->wButtons = ji.wButtons; - } - return ret; -} - /************************************************************************** * joyGetThreshold [WINMM.@] */ @@ -322,19 +246,6 @@ MMRESULT WINAPI joyGetThreshold(UINT wID, LPUINT lpThreshold) return JOYERR_NOERROR; } -/************************************************************************** - * joyGetThreshold [MMSYSTEM.104] - */ -MMRESULT16 WINAPI joyGetThreshold16(UINT16 wID, LPUINT16 lpThreshold) -{ - TRACE("(%04X, %p);\n", wID, lpThreshold); - - if (wID >= MAXJOYSTICK) return JOYERR_PARMS; - - *lpThreshold = JOY_Sticks[wID].threshold; - return JOYERR_NOERROR; -} - /************************************************************************** * joyReleaseCapture [WINMM.@] */ @@ -353,14 +264,6 @@ MMRESULT WINAPI joyReleaseCapture(UINT wID) return JOYERR_NOERROR; } -/************************************************************************** - * joyReleaseCapture [MMSYSTEM.105] - */ -MMRESULT16 WINAPI joyReleaseCapture16(UINT16 wID) -{ - return joyReleaseCapture(wID); -} - /************************************************************************** * joySetCapture [WINMM.@] */ @@ -387,14 +290,6 @@ MMRESULT WINAPI joySetCapture(HWND hWnd, UINT wID, UINT wPeriod, BOOL bChanged) return JOYERR_NOERROR; } -/************************************************************************** - * joySetCapture [MMSYSTEM.106] - */ -MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd, UINT16 wID, UINT16 wPeriod, BOOL16 bChanged) -{ - return joySetCapture16(hWnd, wID, wPeriod, bChanged); -} - /************************************************************************** * joySetThreshold [WINMM.@] */ @@ -408,20 +303,3 @@ MMRESULT WINAPI joySetThreshold(UINT wID, UINT wThreshold) return JOYERR_NOERROR; } - -/************************************************************************** - * joySetThreshold [MMSYSTEM.107] - */ -MMRESULT16 WINAPI joySetThreshold16(UINT16 wID, UINT16 wThreshold) -{ - return joySetThreshold16(wID,wThreshold); -} - -/************************************************************************** - * joySetCalibration [MMSYSTEM.109] - */ -MMRESULT16 WINAPI joySetCalibration16(UINT16 wID) -{ - FIXME("(%04X): stub.\n", wID); - return JOYERR_NOCANDO; -} diff --git a/dlls/winmm/mmsystem.c b/dlls/winmm/mmsystem.c index a9663fc66e..fea33d6937 100644 --- a/dlls/winmm/mmsystem.c +++ b/dlls/winmm/mmsystem.c @@ -2965,3 +2965,130 @@ MMRESULT16 WINAPI mmioRename16(LPCSTR szFileName, LPCSTR szNewFileName, } return ret; } + +/* ################################################### + * # JOYSTICK # + * ################################################### + */ + +/************************************************************************** + * joyGetNumDevs [MMSYSTEM.101] + */ +UINT16 WINAPI joyGetNumDevs16(void) +{ + return joyGetNumDevs(); +} + +/************************************************************************** + * joyGetDevCaps [MMSYSTEM.102] + */ +MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) +{ + JOYCAPSA jca; + MMRESULT ret = joyGetDevCapsA(wID, &jca, sizeof(jca)); + + if (ret != JOYERR_NOERROR) return ret; + lpCaps->wMid = jca.wMid; + lpCaps->wPid = jca.wPid; + strcpy(lpCaps->szPname, jca.szPname); + lpCaps->wXmin = jca.wXmin; + lpCaps->wXmax = jca.wXmax; + lpCaps->wYmin = jca.wYmin; + lpCaps->wYmax = jca.wYmax; + lpCaps->wZmin = jca.wZmin; + lpCaps->wZmax = jca.wZmax; + lpCaps->wNumButtons = jca.wNumButtons; + lpCaps->wPeriodMin = jca.wPeriodMin; + lpCaps->wPeriodMax = jca.wPeriodMax; + + if (wSize >= sizeof(JOYCAPS16)) { /* Win95 extensions ? */ + lpCaps->wRmin = jca.wRmin; + lpCaps->wRmax = jca.wRmax; + lpCaps->wUmin = jca.wUmin; + lpCaps->wUmax = jca.wUmax; + lpCaps->wVmin = jca.wVmin; + lpCaps->wVmax = jca.wVmax; + lpCaps->wCaps = jca.wCaps; + lpCaps->wMaxAxes = jca.wMaxAxes; + lpCaps->wNumAxes = jca.wNumAxes; + lpCaps->wMaxButtons = jca.wMaxButtons; + strcpy(lpCaps->szRegKey, jca.szRegKey); + strcpy(lpCaps->szOEMVxD, jca.szOEMVxD); + } + + return ret; +} + +/************************************************************************** + * joyGetPosEx [MMSYSTEM.110] + */ +MMRESULT16 WINAPI joyGetPosEx16(UINT16 wID, LPJOYINFOEX lpInfo) +{ + return joyGetPosEx(wID, lpInfo); +} + +/************************************************************************** + * joyGetPos [MMSYSTEM.103] + */ +MMRESULT16 WINAPI joyGetPos16(UINT16 wID, LPJOYINFO16 lpInfo) +{ + JOYINFO ji; + MMRESULT ret; + + TRACE("(%d, %p);\n", wID, lpInfo); + + if ((ret = joyGetPos(wID, &ji)) == JOYERR_NOERROR) { + lpInfo->wXpos = ji.wXpos; + lpInfo->wYpos = ji.wYpos; + lpInfo->wZpos = ji.wZpos; + lpInfo->wButtons = ji.wButtons; + } + return ret; +} + +/************************************************************************** + * joyGetThreshold [MMSYSTEM.104] + */ +MMRESULT16 WINAPI joyGetThreshold16(UINT16 wID, LPUINT16 lpThreshold) +{ + UINT t; + MMRESULT ret; + + ret = joyGetThreshold(wID, &t); + if (ret == JOYERR_NOERROR) + *lpThreshold = t; + return ret; +} + +/************************************************************************** + * joyReleaseCapture [MMSYSTEM.105] + */ +MMRESULT16 WINAPI joyReleaseCapture16(UINT16 wID) +{ + return joyReleaseCapture(wID); +} + +/************************************************************************** + * joySetCapture [MMSYSTEM.106] + */ +MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd, UINT16 wID, UINT16 wPeriod, BOOL16 bChanged) +{ + return joySetCapture16(hWnd, wID, wPeriod, bChanged); +} + +/************************************************************************** + * joySetThreshold [MMSYSTEM.107] + */ +MMRESULT16 WINAPI joySetThreshold16(UINT16 wID, UINT16 wThreshold) +{ + return joySetThreshold16(wID,wThreshold); +} + +/************************************************************************** + * joySetCalibration [MMSYSTEM.109] + */ +MMRESULT16 WINAPI joySetCalibration16(UINT16 wID) +{ + FIXME("(%04X): stub.\n", wID); + return JOYERR_NOCANDO; +}