Merge pull request #1398 from FlatOutPS2/PS1

LilyPad PS1 analog mode fix and UI improvement
This commit is contained in:
Jonathan Li 2016-06-13 22:39:16 +01:00 committed by GitHub
commit 5aa3d71eaf
4 changed files with 88 additions and 84 deletions

View File

@ -1323,7 +1323,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
ListView_SetExtendedListViewStyleEx(hWndList, LVS_EX_DOUBLEBUFFER, LVS_EX_DOUBLEBUFFER); ListView_SetExtendedListViewStyleEx(hWndList, LVS_EX_DOUBLEBUFFER, LVS_EX_DOUBLEBUFFER);
LVCOLUMN c; LVCOLUMN c;
c.mask = LVCF_TEXT | LVCF_WIDTH; c.mask = LVCF_TEXT | LVCF_WIDTH;
c.cx = 101; c.cx = 100;
c.pszText = L"Device"; c.pszText = L"Device";
ListView_InsertColumn(hWndList, 0, &c); ListView_InsertColumn(hWndList, 0, &c);
c.cx = 70; c.cx = 70;

View File

@ -773,9 +773,6 @@ void ResetPad(int port, int slot) {
pads[port][slot].umask[0] = pads[port][slot].umask[1] = 0xFF; pads[port][slot].umask[0] = pads[port][slot].umask[1] = 0xFF;
// Sets up vibrate variable. // Sets up vibrate variable.
ResetVibrate(port, slot); ResetVibrate(port, slot);
if (config.padConfigs[port][slot].autoAnalog && !ps2e) {
pads[port][slot].mode = MODE_ANALOG;
}
pads[port][slot].initialized = 1; pads[port][slot].initialized = 1;
pads[port][slot].enabled = enabled; pads[port][slot].enabled = enabled;
@ -1176,6 +1173,9 @@ u8 CALLBACK PADpoll(u8 value) {
// CONFIG_MODE // CONFIG_MODE
case 0x43: case 0x43:
if (pad->config) { if (pad->config) {
if (pad->mode == MODE_DIGITAL && config.padConfigs[query.port][query.slot].autoAnalog && !ps2e) {
pad->mode = MODE_ANALOG;
}
// In config mode. Might not actually be leaving it. // In config mode. Might not actually be leaving it.
SET_RESULT(ConfigExit); SET_RESULT(ConfigExit);
DEBUG_OUT(0xF3); DEBUG_OUT(0xF3);

View File

@ -54,86 +54,88 @@ IDD_CONFIG DIALOGEX 0, 0, 424, 318
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
FONT 8, "MS Shell Dlg", 0, 0, 0x1 FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN BEGIN
CONTROL "",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,7,7,183,285,WS_EX_CLIENTEDGE CONTROL "",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,7,7,183,288,WS_EX_CLIENTEDGE
PUSHBUTTON "Delete Selected",ID_DELETE,7,296,59,15 PUSHBUTTON "Delete Selected",ID_DELETE,7,299,59,15
PUSHBUTTON "Clear All",ID_CLEAR,71,296,56,15 PUSHBUTTON "Clear All",ID_CLEAR,71,299,56,15
PUSHBUTTON "Ignore Key",ID_IGNORE,132,296,58,15 PUSHBUTTON "Ignore Key",ID_IGNORE,132,299,58,15
PUSHBUTTON "Square",ID_SQUARE,196,7,45,15 PUSHBUTTON "Select",ID_SELECT,328,13,34,15
PUSHBUTTON "Cross",ID_CROSS,196,26,45,15 PUSHBUTTON "Start",ID_START,366,13,34,15
PUSHBUTTON "Triangle",ID_TRIANGLE,246,7,45,15 PUSHBUTTON "Analog",ID_ANALOG,328,30,34,15
PUSHBUTTON "Circle",ID_CIRCLE,246,26,45,15 PUSHBUTTON "Mouse",ID_MOUSE,366,30,34,15
PUSHBUTTON "Select",ID_SELECT,306,7,45,15 GROUPBOX "Shoulder buttons",IDC_SHOULDER,196,3,108,46
PUSHBUTTON "Start",ID_START,306,26,45,15 PUSHBUTTON "L1",ID_L1,210,13,34,15
PUSHBUTTON "Analog",ID_ANALOG,372,7,45,15 PUSHBUTTON "R1",ID_R1,254,13,34,15
PUSHBUTTON "Mouse",ID_MOUSE,372,26,45,15 PUSHBUTTON "L2",ID_L2,210,30,34,15
PUSHBUTTON "L1",ID_L1,196,52,45,15 PUSHBUTTON "R2",ID_R2,254,30,34,15
PUSHBUTTON "R1",ID_R1,372,52,45,15 GROUPBOX "D-Pad",IDC_DPAD,196,48,108,70
PUSHBUTTON "L2",ID_L2,196,73,45,15 PUSHBUTTON "Up",ID_DPAD_UP,233,59,34,15
PUSHBUTTON "R2",ID_R2,372,73,45,15 PUSHBUTTON "Left",ID_DPAD_LEFT,214,78,34,15
PUSHBUTTON "L3",ID_L3,195,93,45,15 PUSHBUTTON "Right",ID_DPAD_RIGHT,252,78,34,15
PUSHBUTTON "R3",ID_R3,371,93,46,15 PUSHBUTTON "Down",ID_DPAD_DOWN,233,97,34,15
GROUPBOX "D-Pad",IDC_DPAD,251,44,110,70 GROUPBOX "Face buttons",IDC_FACE,310,48,108,70
PUSHBUTTON "Up",ID_DPAD_UP,285,55,35,15 PUSHBUTTON "Triangle",ID_TRIANGLE,347,59,34,15
PUSHBUTTON "Left",ID_DPAD_LEFT,267,74,35,15 PUSHBUTTON "Square",ID_SQUARE,328,78,34,15
PUSHBUTTON "Right",ID_DPAD_RIGHT,307,74,35,15 PUSHBUTTON "Circle",ID_CIRCLE,366,78,34,15
PUSHBUTTON "Down",ID_DPAD_DOWN,285,93,35,15 PUSHBUTTON "Cross",ID_CROSS,347,97,34,15
GROUPBOX "Left Analog Stick",IDC_LSTICK,195,115,108,70 GROUPBOX "Left Analog Stick",IDC_LSTICK,196,119,108,70
PUSHBUTTON "Up",ID_LSTICK_UP,228,126,35,15 PUSHBUTTON "Up",ID_LSTICK_UP,234,130,30,15
PUSHBUTTON "Left",ID_LSTICK_LEFT,210,145,35,15 PUSHBUTTON "Left",ID_LSTICK_LEFT,202,149,30,15
PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,145,35,15 PUSHBUTTON "L3",ID_L3,234,149,30,15
PUSHBUTTON "Down",ID_LSTICK_DOWN,228,165,35,15 PUSHBUTTON "Right",ID_LSTICK_RIGHT,266,149,30,15
GROUPBOX "Right Analog Stick",IDC_RSTICK,309,115,108,70 PUSHBUTTON "Down",ID_LSTICK_DOWN,234,169,30,15
PUSHBUTTON "Up",ID_RSTICK_UP,342,126,35,15 GROUPBOX "Right Analog Stick",IDC_RSTICK,310,119,108,70
PUSHBUTTON "Left",ID_RSTICK_LEFT,324,145,35,15 PUSHBUTTON "Up",ID_RSTICK_UP,348,130,30,15
PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,145,35,15 PUSHBUTTON "Left",ID_RSTICK_LEFT,316,149,30,15
PUSHBUTTON "Down",ID_RSTICK_DOWN,342,165,35,15 PUSHBUTTON "R3",ID_R3,348,149,30,15
GROUPBOX "",ID_FF,195,6,222,248 PUSHBUTTON "Right",ID_RSTICK_RIGHT,380,149,30,15
COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Down",ID_RSTICK_DOWN,348,169,30,15
CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17 GROUPBOX "",ID_FF,195,9,222,248
CONTROL "Axis 1",IDC_FF_AXIS1_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,60,91,10 COMBOBOX IDC_FF_EFFECT,203,23,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Flip",IDC_FF_AXIS1_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,60,35,10 CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,43,214,17
EDITTEXT IDC_FF_AXIS1_SCALE,375,60,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING CONTROL "Axis 1",IDC_FF_AXIS1_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,63,91,10
CONTROL "",IDC_FF_AXIS2,"msctls_trackbar32",WS_TABSTOP,199,76,214,17 CONTROL "Flip",IDC_FF_AXIS1_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,63,35,10
CONTROL "Axis 2",IDC_FF_AXIS2_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,96,91,10 EDITTEXT IDC_FF_AXIS1_SCALE,375,63,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
CONTROL "Flip",IDC_FF_AXIS2_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,96,35,10 CONTROL "",IDC_FF_AXIS2,"msctls_trackbar32",WS_TABSTOP,199,79,214,17
EDITTEXT IDC_FF_AXIS2_SCALE,375,96,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING CONTROL "Axis 2",IDC_FF_AXIS2_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,99,91,10
CONTROL "",IDC_FF_AXIS3,"msctls_trackbar32",WS_TABSTOP,199,112,214,17 CONTROL "Flip",IDC_FF_AXIS2_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,99,35,10
CONTROL "Axis 3",IDC_FF_AXIS3_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,132,91,10 EDITTEXT IDC_FF_AXIS2_SCALE,375,92,40,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
CONTROL "Flip",IDC_FF_AXIS3_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,132,35,10 CONTROL "",IDC_FF_AXIS3,"msctls_trackbar32",WS_TABSTOP,199,115,214,17
EDITTEXT IDC_FF_AXIS3_SCALE,375,132,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING CONTROL "Axis 3",IDC_FF_AXIS3_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,135,91,10
CONTROL "",IDC_FF_AXIS4,"msctls_trackbar32",WS_TABSTOP,199,148,214,17 CONTROL "Flip",IDC_FF_AXIS3_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,135,35,10
CONTROL "Axis 4",IDC_FF_AXIS4_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,168,91,10 EDITTEXT IDC_FF_AXIS3_SCALE,375,135,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
CONTROL "Flip",IDC_FF_AXIS4_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,168,35,10 CONTROL "",IDC_FF_AXIS4,"msctls_trackbar32",WS_TABSTOP,199,151,214,17
EDITTEXT IDC_FF_AXIS4_SCALE,375,168,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING CONTROL "Axis 4",IDC_FF_AXIS4_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,171,91,10
CONTROL "",IDC_FF_AXIS5,"msctls_trackbar32",WS_TABSTOP,199,184,214,17 CONTROL "Flip",IDC_FF_AXIS4_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,171,35,10
CONTROL "Axis 5",IDC_FF_AXIS5_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,204,91,10 EDITTEXT IDC_FF_AXIS4_SCALE,375,171,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
CONTROL "Flip",IDC_FF_AXIS5_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,204,35,10 CONTROL "",IDC_FF_AXIS5,"msctls_trackbar32",WS_TABSTOP,199,187,214,17
EDITTEXT IDC_FF_AXIS5_SCALE,375,204,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING CONTROL "Axis 5",IDC_FF_AXIS5_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,207,91,10
CONTROL "",IDC_FF_AXIS6,"msctls_trackbar32",WS_TABSTOP,199,220,214,17 CONTROL "Flip",IDC_FF_AXIS5_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,207,35,10
CONTROL "Axis 6",IDC_FF_AXIS6_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,240,91,10 EDITTEXT IDC_FF_AXIS5_SCALE,375,207,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10 CONTROL "",IDC_FF_AXIS6,"msctls_trackbar32",WS_TABSTOP,199,223,214,17
EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING CONTROL "Axis 6",IDC_FF_AXIS6_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,243,91,10
PUSHBUTTON "Test",ID_TEST,196,260,59,15 CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,243,35,10
PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15 EDITTEXT IDC_FF_AXIS6_SCALE,375,243,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
GROUPBOX "Configure Binding",ID_SENSITIVITY,195,186,222,70 PUSHBUTTON "Test",ID_TEST,196,263,59,15
EDITTEXT IDC_AXIS_DEVICE1,202,199,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP PUSHBUTTON "Back to Controls",ID_CONTROLS,196,299,59,15
COMBOBOX IDC_AXIS_DIRECTION,276,197,70,47,CBS_DROPDOWNLIST | WS_TABSTOP GROUPBOX "Configure Binding",ID_SENSITIVITY,195,189,222,70
EDITTEXT IDC_AXIS_CONTROL1,349,199,65,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP EDITTEXT IDC_AXIS_DEVICE1,202,202,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
LTEXT "Sensitivity",IDC_LABEL_SENSITIVITY,202,215,42,8 COMBOBOX IDC_AXIS_DIRECTION,276,200,70,47,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,225,34,10 EDITTEXT IDC_AXIS_CONTROL1,349,202,65,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,240,215,131,17 LTEXT "Sensitivity",IDC_LABEL_SENSITIVITY,202,218,42,8
EDITTEXT IDC_AXIS_SENSITIVITY1,377,213,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,228,34,10
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,385,224,27,10 CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,240,218,131,17
LTEXT "Dead Zone",IDC_LABEL_DEADZONE,202,240,42,8 EDITTEXT IDC_AXIS_SENSITIVITY1,377,216,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
CONTROL "",IDC_SLIDER_DEADZONE,"msctls_trackbar32",WS_TABSTOP,240,236,131,17 CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,385,227,27,10
EDITTEXT IDC_AXIS_DEADZONE,377,239,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING LTEXT "Dead Zone",IDC_LABEL_DEADZONE,202,243,42,8
PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15 CONTROL "",IDC_SLIDER_DEADZONE,"msctls_trackbar32",WS_TABSTOP,240,239,131,17
PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15 EDITTEXT IDC_AXIS_DEADZONE,377,242,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15 PUSHBUTTON "Lock Input",ID_LOCK,196,263,59,15
GROUPBOX "Add Force Feedback Effect",IDC_STATIC,262,260,155,51 PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,281,59,15
COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,299,59,15
PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14 GROUPBOX "Add Force Feedback Effect",IDC_STATIC,262,263,155,51
PUSHBUTTON "Small Motor",ID_SMALL_MOTOR,347,291,64,14 COMBOBOX IDC_FORCEFEEDBACK,269,276,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,294,64,14
PUSHBUTTON "Small Motor",ID_SMALL_MOTOR,347,294,64,14
END END
IDD_CONFIG_POPN DIALOGEX 0, 0, 424, 318 IDD_CONFIG_POPN DIALOGEX 0, 0, 424, 318

View File

@ -57,6 +57,8 @@
#define IDC_DPAD 0x1008 #define IDC_DPAD 0x1008
#define IDC_LSTICK 0x1009 #define IDC_LSTICK 0x1009
#define IDC_RSTICK 0x100A #define IDC_RSTICK 0x100A
#define IDC_FACE 0x100B
#define IDC_SHOULDER 0x100C
#define IDC_SLIDER_DEADZONE 0x1010 #define IDC_SLIDER_DEADZONE 0x1010
#define IDC_AXIS_DEADZONE 0x1014 #define IDC_AXIS_DEADZONE 0x1014
#define IDC_LABEL_SENSITIVITY 0x1020 #define IDC_LABEL_SENSITIVITY 0x1020