From 7f95ad831fb9d43f4200a869c78f5c20371823b4 Mon Sep 17 00:00:00 2001 From: Laurence Muller Date: Tue, 22 Jul 2008 14:32:13 +0000 Subject: [PATCH] nJoy: Shoulder button fixed, I forgot to set a value for the pressure. Currently it set at max (0xFF) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@57 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp | 24 +++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index 0c293761e6..59f61c8664 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -206,10 +206,26 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) if ((sub_stick_y < deadzone2) || (sub_stick_y > deadzone)) _pPADStatus->substickY += sub_stick_y; // Set buttons - if (joystate[_numPAD].buttons[CTL_L_SHOULDER]) _pPADStatus->button|=PAD_TRIGGER_L; - if (joystate[_numPAD].buttons[CTL_R_SHOULDER]) _pPADStatus->button|=PAD_TRIGGER_R; - if (joystate[_numPAD].buttons[CTL_A_BUTTON]) _pPADStatus->button|=PAD_BUTTON_A; - if (joystate[_numPAD].buttons[CTL_B_BUTTON]) _pPADStatus->button|=PAD_BUTTON_B; + if (joystate[_numPAD].buttons[CTL_L_SHOULDER]) + { + _pPADStatus->button|=PAD_TRIGGER_L; + _pPADStatus->triggerLeft = 255; // Perhaps support halfpress/pressure + } + if (joystate[_numPAD].buttons[CTL_R_SHOULDER]) + { + _pPADStatus->button|=PAD_TRIGGER_R; + _pPADStatus->triggerRight = 255; // Perhaps support halfpress/pressure + } + if (joystate[_numPAD].buttons[CTL_A_BUTTON]) + { + _pPADStatus->button|=PAD_BUTTON_A; + _pPADStatus->analogA = 255; // Perhaps support halfpress/pressure + } + if (joystate[_numPAD].buttons[CTL_B_BUTTON]) + { + _pPADStatus->button|=PAD_BUTTON_B; + _pPADStatus->analogB = 255; // Perhaps support halfpress/pressure + } if (joystate[_numPAD].buttons[CTL_X_BUTTON]) _pPADStatus->button|=PAD_BUTTON_X; if (joystate[_numPAD].buttons[CTL_Y_BUTTON]) _pPADStatus->button|=PAD_BUTTON_Y; if (joystate[_numPAD].buttons[CTL_Z_TRIGGER]) _pPADStatus->button|=PAD_TRIGGER_Z;