mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 07:49:19 +01:00
Fix a nasty dualcore hang in EFB read (see r3658 comment...)
Also fix an issue reported by baby.lueshi (issue 1074) in nJoy related to half press button being always pressed when unset. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3661 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
06b65ea425
commit
936225eee4
@ -161,6 +161,7 @@ void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, in
|
||||
}
|
||||
else
|
||||
{
|
||||
// XInput triggers for Xbox360 pads
|
||||
_PadState.axis[CTL_L_SHOULDER] = XInput::GetXI(0, _PadMapping.buttons[CTL_L_SHOULDER] - 1000);
|
||||
_PadState.axis[CTL_R_SHOULDER] = XInput::GetXI(0, _PadMapping.buttons[CTL_R_SHOULDER] - 1000);
|
||||
}
|
||||
@ -176,9 +177,12 @@ void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, in
|
||||
ReadButton(_PadState, _PadMapping, CTL_Z_TRIGGER, NumButtons);
|
||||
ReadButton(_PadState, _PadMapping, CTL_START, NumButtons);
|
||||
|
||||
//
|
||||
if (_PadMapping.halfpress < NumButtons)
|
||||
// Update Halfpress state, this one is not in the standard _PadState.buttons array
|
||||
if (_PadMapping.halfpress < NumButtons && _PadMapping.halfpress >= 0)
|
||||
_PadState.halfpress = SDL_JoystickGetButton(_PadState.joy, _PadMapping.halfpress);
|
||||
else
|
||||
_PadState.halfpress = 0;
|
||||
|
||||
|
||||
// Check if we have an analog or digital joypad
|
||||
if (_PadMapping.controllertype == CTL_DPAD_HAT)
|
||||
@ -187,8 +191,8 @@ void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, in
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Only do this if the assigned button is in range (to allow for the current way of saving keyboard
|
||||
keys in the same array) */
|
||||
// Only do this if the assigned button is in range (to allow for the current way of saving keyboard
|
||||
// keys in the same array)
|
||||
if(_PadMapping.dpad2[CTL_D_PAD_UP] <= NumButtons)
|
||||
_PadState.dpad2[CTL_D_PAD_UP] = SDL_JoystickGetButton(_PadState.joy, _PadMapping.dpad2[CTL_D_PAD_UP]);
|
||||
if(_PadMapping.dpad2[CTL_D_PAD_DOWN] <= NumButtons)
|
||||
|
@ -146,19 +146,19 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
|
||||
video_initialize.pPeekMessages();
|
||||
#endif
|
||||
|
||||
if (g_EFBAccessRequested)
|
||||
{
|
||||
Video_OnThreadAccessEFB();
|
||||
g_EFBAccessRequested = false;
|
||||
}
|
||||
|
||||
// Draw XFB if CP/GPfifo isn't used
|
||||
if (g_XFBUpdateRequested)
|
||||
{
|
||||
Video_UpdateXFB(NULL, 0, 0, 0, FALSE);
|
||||
}
|
||||
|
||||
if (g_EFBAccessRequested)
|
||||
{
|
||||
Video_OnThreadAccessEFB();
|
||||
}
|
||||
|
||||
s_criticalFifo.Enter();
|
||||
|
||||
// check if we are able to run this buffer
|
||||
if ((_fifo.bFF_GPReadEnable) && _fifo.CPReadWriteDistance && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint))
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ static bool s_PluginInitialized = false;
|
||||
static volatile u32 s_AccessEFBResult = 0, s_EFBx, s_EFBy;
|
||||
static volatile EFBAccessType s_AccessEFBType;
|
||||
static Common::Event s_AccessEFBDone;
|
||||
static Common::CriticalSection s_criticalEFB, s_criticalAccess;
|
||||
static Common::CriticalSection s_criticalEFB;
|
||||
|
||||
|
||||
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||
@ -520,6 +520,7 @@ void Video_OnThreadAccessEFB()
|
||||
break;
|
||||
}
|
||||
|
||||
g_EFBAccessRequested = false;
|
||||
s_AccessEFBDone.Set();
|
||||
|
||||
s_criticalEFB.Leave();
|
||||
@ -529,8 +530,6 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y)
|
||||
{
|
||||
u32 result;
|
||||
|
||||
s_criticalAccess.Enter();
|
||||
|
||||
s_criticalEFB.Enter();
|
||||
|
||||
s_AccessEFBType = type;
|
||||
@ -556,9 +555,8 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y)
|
||||
s_AccessEFBDone.Shutdown();
|
||||
|
||||
result = s_AccessEFBResult;
|
||||
s_criticalEFB.Leave();
|
||||
|
||||
s_criticalAccess.Leave();
|
||||
s_criticalEFB.Leave();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -76,23 +76,23 @@
|
||||
// Use PAD rumble
|
||||
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
|
||||
|
||||
void Pad_Use_Rumble(u8 _numPAD)//, SPADStatus* _pPADStatus)
|
||||
void Pad_Use_Rumble(u8 _numPAD)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
||||
if (PadMapping[_numPAD].rumble) {
|
||||
if (!g_Rumble) {
|
||||
if (PadMapping[_numPAD].rumble)
|
||||
{
|
||||
if (!g_Rumble)
|
||||
{
|
||||
// GetForegroundWindow() always sends the good HWND
|
||||
if (FAILED(InitRumble(GetForegroundWindow())))
|
||||
PanicAlert("Could not initialize Rumble!");
|
||||
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
// Acquire gamepad
|
||||
if (pRumble[_numPAD].g_pDevice != NULL)
|
||||
pRumble[_numPAD].g_pDevice->Acquire();
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(__linux__)
|
||||
if (!fd)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user