Disabled the rumblepad hack.

If you want to use it, uncomment #define USE_RUMBLE_DINPUT_HACK in nJoy.h.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@172 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Laurence Muller
2008-08-10 18:46:55 +00:00
parent 3540466f63
commit 5fc50dc63c
3 changed files with 30 additions and 10 deletions

View File

@ -44,10 +44,15 @@ bool emulator_running = FALSE;
// Handle to window
HWND m_hWnd;
#ifdef USE_RUMBLE_DINPUT_HACK
bool g_rumbleEnable = FALSE;
#endif
// Rumble in windows
#ifdef _WIN32
#ifdef USE_RUMBLE_DINPUT_HACK
LPDIRECTINPUT8 g_pDI = NULL;
LPDIRECTINPUTDEVICE8 g_pDevice = NULL;
LPDIRECTINPUTEFFECT g_pEffect = NULL;
@ -65,6 +70,8 @@ BOOL CALLBACK EnumAxesCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* pCont
HRESULT SetDeviceForcesXY();
#endif
#endif
//////////////////////////////////////////////////////////////////////////////////////////
// wxWidgets
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@ -282,8 +289,10 @@ void PAD_Shutdown()
emulator_running = FALSE;
#ifdef _WIN32
#ifdef USE_RUMBLE_DINPUT_HACK
FreeDirectInput();
#endif
#endif
}
// Set PAD status
@ -400,6 +409,7 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus)
#ifdef _WIN32
#ifdef USE_RUMBLE_DINPUT_HACK
if(joystate[_numPAD].halfpress)
if(!g_pDI)
if(FAILED(InitDirectInput(m_hWnd)))
@ -419,6 +429,7 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus)
g_pEffect->Start(1, 0);
}
#endif
#endif
}
// Set PAD rumble
@ -426,12 +437,13 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus)
// (Stop=0, Rumble=1)
void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength)
{
if(_numPAD > 0)
return;
//if(_numPAD > 0)
// return;
// not supported by SDL
// So we need to use platform specific stuff
#ifdef _WIN32
#ifdef USE_RUMBLE_DINPUT_HACK
static int a = 0;
if ((_uType == 0) || (_uType == 2))
@ -454,7 +466,7 @@ void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength)
g_nYForce = a;
SetDeviceForcesXY();
}
#endif
#endif
}
@ -707,7 +719,7 @@ void LoadConfig()
// Rumble stuff :D!
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//
#ifdef USE_RUMBLE_DINPUT_HACK
HRESULT InitDirectInput( HWND hDlg )
{
DIPROPDWORD dipdw;
@ -883,5 +895,5 @@ HRESULT SetDeviceForcesXY()
// Now set the new parameters and start the effect immediately.
return g_pEffect->SetParameters(&eff, DIEP_DIRECTION | DIEP_TYPESPECIFICPARAMS | DIEP_START);
}
#endif
#endif