mirror of https://github.com/PCSX2/pcsx2.git
parent
d62d2abf59
commit
ac0e40a2b7
|
@ -23,12 +23,27 @@ void GamePad::EnumerateGamePads(vector<GamePad*>& vgamePad)
|
||||||
JoystickInfo::EnumerateJoysticks(vgamePad);
|
JoystickInfo::EnumerateJoysticks(vgamePad);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamePad::UpdateReleaseState()
|
void GamePad::UpdateReleaseState()
|
||||||
{
|
{
|
||||||
#ifdef SDL_BUILD
|
#ifdef SDL_BUILD
|
||||||
JoystickInfo::UpdateReleaseState();
|
JoystickInfo::UpdateReleaseState();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Safely dispatch to the Rumble method above
|
||||||
|
**/
|
||||||
|
void GamePad::DoRumble(int type, int pad)
|
||||||
|
{
|
||||||
|
u32 id = conf->get_joyid(pad);
|
||||||
|
if (GamePadIdWithinBounds(id)) {
|
||||||
|
GamePad* gamePad = s_vgamePad[id];
|
||||||
|
if (gamePad)
|
||||||
|
gamePad->Rumble(type, pad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update state of every attached devices
|
* Update state of every attached devices
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -43,6 +43,10 @@ class GamePad
|
||||||
* Rumble will differ according to type which is either 0(small motor) or 1(big motor)
|
* Rumble will differ according to type which is either 0(small motor) or 1(big motor)
|
||||||
**/
|
**/
|
||||||
virtual void Rumble(int type,int pad){return;}
|
virtual void Rumble(int type,int pad){return;}
|
||||||
|
/**
|
||||||
|
* Safely dispatch to the Rumble method above
|
||||||
|
**/
|
||||||
|
static void DoRumble(int type, int pad);
|
||||||
|
|
||||||
virtual bool Init(int id){return false;} // opens a handle and gets information
|
virtual bool Init(int id){return false;} // opens a handle and gets information
|
||||||
|
|
||||||
|
|
|
@ -418,9 +418,7 @@ u8 _PADpoll(u8 value)
|
||||||
if (padVibF[curPad][2] != vib_small)
|
if (padVibF[curPad][2] != vib_small)
|
||||||
{
|
{
|
||||||
padVibF[curPad][2] = vib_small;
|
padVibF[curPad][2] = vib_small;
|
||||||
// SetDeviceForceS (padVibC[curPad], vib_small);
|
GamePad::DoRumble(0, curPad);
|
||||||
GamePad* gamePad = s_vgamePad[conf->get_joyid(curPad)];
|
|
||||||
gamePad->Rumble(0,curPad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Big Motor */
|
/* Big Motor */
|
||||||
|
@ -429,9 +427,7 @@ u8 _PADpoll(u8 value)
|
||||||
if (padVibF[curPad][3] != vib_big)
|
if (padVibF[curPad][3] != vib_big)
|
||||||
{
|
{
|
||||||
padVibF[curPad][3] = vib_big;
|
padVibF[curPad][3] = vib_big;
|
||||||
// SetDeviceForceB (padVibC[curPad], vib_big);
|
GamePad::DoRumble(1, curPad);
|
||||||
GamePad* gamePad = s_vgamePad[conf->get_joyid(curPad)];
|
|
||||||
gamePad->Rumble(1,curPad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return padID[curPad];
|
return padID[curPad];
|
||||||
|
|
Loading…
Reference in New Issue