mirror of https://github.com/PCSX2/pcsx2.git
LilyPad: Removed "Axis" binding buttons. Try to autodetect full axis bindings instead, also a dropdown in case that fails. Experimental, untested PADFreeze() implemented.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@786 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
64a1b3fb45
commit
bb47813a3c
|
@ -180,18 +180,6 @@ void RefreshEnabledDevicesAndDisplay(int updateDeviceList = 0, HWND hWnd = 0, in
|
|||
|
||||
wchar_t *GetCommandStringW(u8 command, int pad) {
|
||||
static wchar_t temp[34];
|
||||
if (command >= 0x30 && command <= 0x35) {
|
||||
if (config.guitar[pad] && (command == 0x31 || command == 0x33)) {
|
||||
HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command);
|
||||
int res = GetWindowTextW(hWnd, temp, 20);
|
||||
if ((unsigned int)res-1 <= 18) return temp;
|
||||
}
|
||||
static wchar_t *axisCommands[] = {
|
||||
L"D-Pad Horiz", L"D-Pad Vert",
|
||||
L"L-Stick Horiz", L"L-Stick Vert",
|
||||
L"R-Stick Horiz", L"R-Stick Vert"};
|
||||
return axisCommands[command-0x30];
|
||||
}
|
||||
if (command >= 0x20 && command <= 0x27) {
|
||||
if (config.guitar[pad] && (command == 0x20 || command == 0x22)) {
|
||||
HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command);
|
||||
|
@ -206,9 +194,42 @@ wchar_t *GetCommandStringW(u8 command, int pad) {
|
|||
return temp;
|
||||
}
|
||||
/* Get text from the buttons. */
|
||||
if (command >= 0x0B && command <=0x28 ||
|
||||
(command >= 0x36 && command <=0x38)) {
|
||||
if (command >= 0x0C && command <=0x28) {
|
||||
HWND hWnd = GetDlgItem(hWnds[pad], 0x10F0+command);
|
||||
if (!hWnd) {
|
||||
wchar_t *strings[] = {
|
||||
L"Lock Buttons",
|
||||
L"Lock Input",
|
||||
L"Lock Direction",
|
||||
L"Mouse",
|
||||
L"Select",
|
||||
L"L3",
|
||||
L"R3",
|
||||
L"Start",
|
||||
L"Up",
|
||||
L"Right",
|
||||
L"Down",
|
||||
L"Left",
|
||||
L"L2",
|
||||
L"R2",
|
||||
L"L1",
|
||||
L"R1",
|
||||
L"Triangle",
|
||||
L"Circle",
|
||||
L"Square",
|
||||
L"Cross",
|
||||
L"L-Stick Up",
|
||||
L"L-Stick Right",
|
||||
L"L-Stick Down",
|
||||
L"L-Stick Left",
|
||||
L"R-Stick Up",
|
||||
L"R-Stick Right",
|
||||
L"R-Stick Down",
|
||||
L"R-Stick Left",
|
||||
L"Analog",
|
||||
};
|
||||
return strings[command - 0xC];
|
||||
}
|
||||
int res = GetWindowTextW(hWnd, temp, 20);
|
||||
if ((unsigned int)res-1 <= 18) return temp;
|
||||
}
|
||||
|
@ -241,15 +262,15 @@ void SelChanged(int pad) {
|
|||
// Set if sensitivity != 0, but need to disable flip anyways.
|
||||
// Only used to relative axes.
|
||||
int disableFlip = 0;
|
||||
wchar_t temp[3][1000];
|
||||
wchar_t temp[4][1000];
|
||||
Device *dev;
|
||||
int bFound = 0;
|
||||
int ffbFound = 0;
|
||||
ForceFeedbackBinding *ffb = 0;
|
||||
Binding *b = 0;
|
||||
if (i >= 1) {
|
||||
int index = -1;
|
||||
int flipped = 0;
|
||||
Binding *b;
|
||||
while (1) {
|
||||
index = ListView_GetNextItem(hWndList, index, LVNI_SELECTED);
|
||||
if (index < 0) break;
|
||||
|
@ -257,10 +278,31 @@ void SelChanged(int pad) {
|
|||
item.iItem = index;
|
||||
item.mask = LVIF_TEXT;
|
||||
for (j=0; j<3; j++) {
|
||||
item.pszText = temp[j];
|
||||
item.pszText = temp[3];
|
||||
item.iSubItem = j;
|
||||
item.cchTextMax = sizeof(temp[0])/sizeof(temp[0][0]);
|
||||
item.cchTextMax = sizeof(temp[0])/sizeof(temp[3][0]);
|
||||
if (!ListView_GetItem(hWndList, &item)) break;
|
||||
if (!bFound && !ffbFound)
|
||||
wcscpy(temp[j], temp[3]);
|
||||
else if (wcsicmp(temp[j], temp[3])) {
|
||||
int q = 0;
|
||||
while (temp[j][q] == temp[3][q]) q++;
|
||||
if (q && temp[j][q-1] == ' ' && temp[j][q] && temp[j][q+1] == 0) q--;
|
||||
if (j == 1) {
|
||||
// Really ugly, but merges labels for multiple directions for same axis.
|
||||
if ((temp[j][q] == 0 || (temp[j][q] == ' ' && temp[j][q+2] == 0)) &&
|
||||
(temp[3][q] == 0 || (temp[3][q] == ' ' && temp[3][q+2] == 0))) {
|
||||
temp[j][q] = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Merge different directions for same stick.
|
||||
else if (j == 2 && q > 4) {
|
||||
temp[j][q] = 0;
|
||||
continue;
|
||||
}
|
||||
wcscpy(temp[j], L"*");
|
||||
}
|
||||
}
|
||||
if (j == 3) {
|
||||
devName = temp[0];
|
||||
|
@ -352,10 +394,6 @@ void SelChanged(int pad) {
|
|||
}
|
||||
}
|
||||
if (!ffb) {
|
||||
SetWindowText(GetDlgItem(hWnd, IDC_AXIS_DEVICE1), devName);
|
||||
SetWindowText(GetDlgItem(hWnd, IDC_AXIS1), key);
|
||||
SetWindowText(GetDlgItem(hWnd, IDC_AXIS_CONTROL1), command);
|
||||
|
||||
SetLogSliderVal(hWnd, IDC_SLIDER1, GetDlgItem(hWnd, IDC_AXIS_SENSITIVITY1), sensitivity);
|
||||
|
||||
if (disableFlip) EnableWindow(GetDlgItem(hWnd, IDC_FLIP1), 0);
|
||||
|
@ -369,11 +407,45 @@ void SelChanged(int pad) {
|
|||
SendMessage(GetDlgItem(hWnd, IDC_TURBO), BM_SETSTYLE, BS_AUTOCHECKBOX, 0);
|
||||
CheckDlgButton(hWnd, IDC_TURBO, BST_CHECKED * (bFound && turbo == bFound));
|
||||
}
|
||||
HWND hWndCombo = GetDlgItem(hWnd, IDC_AXIS_DIRECTION);
|
||||
int enableCombo = 0;
|
||||
SendMessage(hWndCombo, CB_RESETCONTENT, 0, 0);
|
||||
if (b && bFound == 1) {
|
||||
VirtualControl *control = &dev->virtualControls[b->controlIndex];
|
||||
unsigned int uid = control->uid;
|
||||
if (((uid>>16) & 0xFF) == ABSAXIS) {
|
||||
enableCombo = 1;
|
||||
wchar_t *endings[3] = {L" -", L" +", L""};
|
||||
wchar_t *string = temp[3];
|
||||
wcscpy(string, key);
|
||||
wchar_t *end = wcschr(string, 0);
|
||||
int sel = 2;
|
||||
if (!(uid & UID_AXIS)) {
|
||||
end[-2] = 0;
|
||||
sel = (end[-1] == '+');
|
||||
end -= 2;
|
||||
}
|
||||
for (int i=0; i<3; i++) {
|
||||
wcscpy(end, endings[i]);
|
||||
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) string);
|
||||
if (i == sel)
|
||||
SendMessage(hWndCombo, CB_SETCURSEL, i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
EnableWindow(hWndCombo, enableCombo);
|
||||
if (!enableCombo) {
|
||||
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) key);
|
||||
SendMessage(hWndCombo, CB_SELECTSTRING, i, (LPARAM) key);
|
||||
}
|
||||
|
||||
SetDlgItemText(hWnd, IDC_AXIS_DEVICE1, devName);
|
||||
SetDlgItemText(hWnd, IDC_AXIS_CONTROL1, command);
|
||||
}
|
||||
else {
|
||||
wchar_t temp2[2000];
|
||||
wsprintfW(temp2, L"%s / %s", devName, command);
|
||||
SetWindowText(GetDlgItem(hWnd, ID_FF), temp2);
|
||||
SetDlgItemText(hWnd, ID_FF, temp2);
|
||||
|
||||
hWndTemp = GetDlgItem(hWnd, IDC_FF_EFFECT);
|
||||
SendMessage(hWndTemp, CB_RESETCONTENT, 0, 0);
|
||||
|
@ -626,7 +698,6 @@ int SaveSettings(wchar_t *file=0) {
|
|||
WritePrivateProfileInt(L"General Settings", L"Mouse Unfocus", config.mouseUnfocus, file);
|
||||
WritePrivateProfileInt(L"General Settings", L"Pad1 Disable", config.disablePad[0], file);
|
||||
WritePrivateProfileInt(L"General Settings", L"Pad2 Disable", config.disablePad[1], file);
|
||||
WritePrivateProfileInt(L"General Settings", L"Axis Buttons", config.axisButtons, file);
|
||||
WritePrivateProfileInt(L"General Settings", L"Logging", config.debug, file);
|
||||
WritePrivateProfileInt(L"General Settings", L"Keyboard Mode", config.keyboardApi, file);
|
||||
WritePrivateProfileInt(L"General Settings", L"Mouse Mode", config.mouseApi, file);
|
||||
|
@ -746,7 +817,6 @@ int LoadSettings(int force, wchar_t *file) {
|
|||
config.disablePad[0] = GetPrivateProfileBool(L"General Settings", L"Pad1 Disable", 0, file);
|
||||
config.disablePad[1] = GetPrivateProfileBool(L"General Settings", L"Pad2 Disable", 0, file);
|
||||
config.debug = GetPrivateProfileBool(L"General Settings", L"Logging", 0, file);
|
||||
config.axisButtons = GetPrivateProfileBool(L"General Settings", L"Axis Buttons", 0, file);
|
||||
config.multipleBinding = GetPrivateProfileBool(L"General Settings", L"Multiple Bindings", 0, file);
|
||||
config.forceHide = GetPrivateProfileBool(L"General Settings", L"Force Cursor Hide", 0, file);
|
||||
|
||||
|
@ -1184,11 +1254,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
int value;
|
||||
InitInfo info = {selected==0x7F, hWndProp, hWnd, GetDlgItem(hWnd, selected)};
|
||||
int hint = 0;
|
||||
if (selected < 0x30) {
|
||||
// 1 will accept absolute axes, in addition to buttons.
|
||||
hint = config.axisButtons;
|
||||
}
|
||||
else if (selected < 0x7F) {
|
||||
if (selected < 0x7F) {
|
||||
// 2 will accept relative axes, absolute axes, and POV controls.
|
||||
hint = 2;
|
||||
}
|
||||
|
@ -1355,7 +1421,27 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
}
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_FF_EFFECT) {
|
||||
if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_AXIS_DIRECTION) {
|
||||
int index = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED);
|
||||
if (index >= 0) {
|
||||
int cbsel = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
|
||||
if (cbsel >= 0) {
|
||||
ForceFeedbackBinding *ffb;
|
||||
Binding *b;
|
||||
Device *dev;
|
||||
if (GetBinding(pad, index, dev, b, ffb)) {
|
||||
int uid = dev->virtualControls[b->controlIndex].uid;
|
||||
const static unsigned int axisUIDs[3] = {UID_AXIS_NEG, UID_AXIS_POS, UID_AXIS};
|
||||
uid = (uid&0x00FFFFFF) | axisUIDs[cbsel];
|
||||
Binding backup = *b;
|
||||
DeleteSelected(pad);
|
||||
int index = BindCommand(dev, uid, pad, backup.command, backup.sensitivity, backup.turbo);
|
||||
ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (HIWORD(wParam)==CBN_SELCHANGE && LOWORD(wParam) == IDC_FF_EFFECT) {
|
||||
unsigned int typeIndex = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
|
||||
if (typeIndex >= 0)
|
||||
ChangeEffect(pad, 0, 0, &typeIndex);
|
||||
|
@ -1559,7 +1645,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
|||
CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED * config.AutoAnalog[0]);
|
||||
CheckDlgButton(hWnd, IDC_ANALOG_START2, BST_CHECKED * config.AutoAnalog[1]);
|
||||
CheckDlgButton(hWnd, IDC_DEBUG_FILE, BST_CHECKED * config.debug);
|
||||
CheckDlgButton(hWnd, IDC_AXIS_BUTTONS, BST_CHECKED * config.axisButtons);
|
||||
CheckDlgButton(hWnd, IDC_MULTIPLE_BINDING, BST_CHECKED * config.multipleBinding);
|
||||
|
||||
|
||||
|
@ -1673,25 +1758,8 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
|||
config.AutoAnalog[0] = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED);
|
||||
config.AutoAnalog[1] = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START2) == BST_CHECKED);
|
||||
config.debug = (IsDlgButtonChecked(hWnd, IDC_DEBUG_FILE) == BST_CHECKED);
|
||||
int temp = config.axisButtons;
|
||||
config.axisButtons = (IsDlgButtonChecked(hWnd, IDC_AXIS_BUTTONS) == BST_CHECKED);
|
||||
if (!temp && config.axisButtons) {
|
||||
int res = MessageBoxA(hWnd,
|
||||
"Enabling this completely changes the way that binding objects other than buttons works.\n"
|
||||
"Such devices include POV controls and joysticks. It has no effect on the bind to axis buttons, \n"
|
||||
"but many people seem to have trouble figuring out how to click on those buttons.\n\n"
|
||||
"Are you sure you want to enable this?\n\n"
|
||||
"If you do, and then you have issues, don't waste my time complaining.\n\n",
|
||||
"Are you sure?", MB_YESNO | MB_ICONEXCLAMATION);
|
||||
if (res != IDYES) {
|
||||
config.axisButtons = 0;
|
||||
CheckDlgButton(hWnd, IDC_AXIS_BUTTONS, BST_CHECKED * config.axisButtons);
|
||||
}
|
||||
}
|
||||
config.multipleBinding = (IsDlgButtonChecked(hWnd, IDC_MULTIPLE_BINDING) == BST_CHECKED);
|
||||
|
||||
CheckDlgButton(hWnd, IDC_AXIS_BUTTONS, BST_CHECKED * config.axisButtons);
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
if (IsDlgButtonChecked(hWnd, IDC_KB_DISABLE+i) == BST_CHECKED) {
|
||||
if (i != NO_API || config.keyboardApi == NO_API || IDOK == MessageBoxA(hWnd,
|
||||
|
@ -1715,13 +1783,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
|||
config.gameApis.directInput = (IsDlgButtonChecked(hWnd, IDC_G_DI) == BST_CHECKED);
|
||||
config.gameApis.xInput = (IsDlgButtonChecked(hWnd, IDC_G_XI) == BST_CHECKED);
|
||||
|
||||
if (test == IDC_FORCEFEEDBACK_HACK1) {
|
||||
CheckDlgButton(hWnd, IDC_FORCEFEEDBACK_HACK2, BST_UNCHECKED);
|
||||
}
|
||||
else if (test == IDC_FORCEFEEDBACK_HACK2) {
|
||||
CheckDlgButton(hWnd, IDC_FORCEFEEDBACK_HACK1, BST_UNCHECKED);
|
||||
}
|
||||
|
||||
config.forceHide = (IsDlgButtonChecked(hWnd, IDC_FORCE_HIDE) == BST_CHECKED);
|
||||
|
||||
RefreshEnabledDevicesAndDisplay(0, hWnd, 1);
|
||||
|
|
|
@ -14,7 +14,6 @@ public:
|
|||
u8 disableScreenSaver;
|
||||
u8 closeHacks;
|
||||
|
||||
u8 axisButtons;
|
||||
DeviceAPI keyboardApi;
|
||||
DeviceAPI mouseApi;
|
||||
struct {
|
||||
|
|
|
@ -62,6 +62,7 @@ EXPORT_C_(u32) PADreadPort2 (PadDataS* pads);
|
|||
EXPORT_C_(u32) PSEgetLibType();
|
||||
EXPORT_C_(u32) PSEgetLibVersion();
|
||||
EXPORT_C_(void) PADconfigure();
|
||||
EXPORT_C_(s32) PADfreeze(int mode, freezeData *data);
|
||||
|
||||
#ifdef NO_CRT
|
||||
inline void * malloc(size_t size) {
|
||||
|
|
|
@ -161,7 +161,7 @@ void Device::CalcVirtualState() {
|
|||
}
|
||||
}
|
||||
else if (c->type & ABSAXIS) {
|
||||
virtualControlState[index] = val;
|
||||
virtualControlState[index] = (val + FULLY_DOWN)/2;
|
||||
// Positive. Overkill.
|
||||
virtualControlState[index+1] = (val & ~(val>>31));
|
||||
// Negative
|
||||
|
@ -382,7 +382,10 @@ Device *InputDeviceManager::GetActiveDevice(void *info, int axisHint, unsigned i
|
|||
if (axisHint != 2) {
|
||||
if (devices[i]->virtualControls[j].uid & UID_POV) continue;
|
||||
if (devices[i]->virtualControls[j].uid & UID_AXIS) {
|
||||
if (!axisHint || (((devices[i]->virtualControls[j].uid>>16)&0xFF) != ABSAXIS)) continue;
|
||||
if ((((devices[i]->virtualControls[j].uid>>16)&0xFF) != ABSAXIS)) continue;
|
||||
// Very picky when binding entire axes. Prefer binding half-axes.
|
||||
if (devices[i]->oldVirtualControlState[j] >= FULLY_DOWN/8 &&
|
||||
devices[i]->oldVirtualControlState[j] <= FULLY_DOWN*7/8) continue;
|
||||
}
|
||||
}
|
||||
bestDiff = diff;
|
||||
|
|
|
@ -547,7 +547,15 @@ inline void ResetVibrate(Pad *pad) {
|
|||
((int*)(pad->vibrate))[1] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
|
||||
void ResetPad(int pad) {
|
||||
memset(&pads[pad], 0, sizeof(pads[0]));
|
||||
pads[pad].mode = MODE_DIGITAL;
|
||||
pads[pad].umask[0] = pads[pad].umask[1] = 0xFF;
|
||||
ResetVibrate(pads+pad);
|
||||
if (config.AutoAnalog[pad]) {
|
||||
pads[pad].mode = MODE_ANALOG;
|
||||
}
|
||||
}
|
||||
|
||||
s32 CALLBACK PADinit(u32 flags) {
|
||||
// Note: Won't load settings if already loaded.
|
||||
|
@ -566,13 +574,7 @@ s32 CALLBACK PADinit(u32 flags) {
|
|||
#endif
|
||||
pad --;
|
||||
|
||||
memset(&pads[pad], 0, sizeof(pads[0]));
|
||||
pads[pad].mode = MODE_DIGITAL;
|
||||
pads[pad].umask[0] = pads[pad].umask[1] = 0xFF;
|
||||
ResetVibrate(pads+pad);
|
||||
if (config.AutoAnalog[pad]) {
|
||||
pads[pad].mode = MODE_ANALOG;
|
||||
}
|
||||
ResetPad(pad);
|
||||
|
||||
pads[pad].initialized = 1;
|
||||
|
||||
|
@ -1173,6 +1175,84 @@ keyEvent* CALLBACK PADkeyEvent() {
|
|||
return &ev;
|
||||
}
|
||||
|
||||
#define PAD_SAVE_STATE_VERSION 0
|
||||
|
||||
struct PadFreezeData {
|
||||
u8 mode;
|
||||
u8 locked;
|
||||
u8 config;
|
||||
u8 vibrate[8];
|
||||
u8 umask[2];
|
||||
};
|
||||
|
||||
struct PadPluginFreezeData {
|
||||
char format[8];
|
||||
// Currently all different versions are incompatible.
|
||||
// May split into major/minor with some compatibility rules.
|
||||
u32 version;
|
||||
PadFreezeData padData[2];
|
||||
};
|
||||
|
||||
s32 CALLBACK PADfreeze(int mode, freezeData *data) {
|
||||
if (mode == FREEZE_SIZE) {
|
||||
data->size = sizeof(PadPluginFreezeData);
|
||||
}
|
||||
else if (mode == FREEZE_LOAD) {
|
||||
if (data->size < sizeof(PadPluginFreezeData)) return 0;
|
||||
PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data);
|
||||
strcpy(pdata.format, "PadMode");
|
||||
pdata.version = PAD_SAVE_STATE_VERSION;
|
||||
for (int i=0; i<2; i++) {
|
||||
pdata.padData[i].mode = pads[i].mode;
|
||||
pdata.padData[i].locked = pads[i].modeLock;
|
||||
memcpy(pdata.padData[i].umask, pads[i].umask, sizeof(pads[i].umask));
|
||||
memcpy(pdata.padData[i].vibrate, pads[i].vibrate, sizeof(pads[i].vibrate));
|
||||
|
||||
|
||||
// Means I only have to have one chunk of code to parse vibrate info.
|
||||
// Other plugins don't store it exactly, but think it's technically correct
|
||||
// to do so, though I could be wrong.
|
||||
pads[i].config = 1;
|
||||
PADstartPoll(i+1);
|
||||
PADpoll(0x4D);
|
||||
PADpoll(0x00);
|
||||
for (int j=0; j<7; j++) {
|
||||
PADpoll(pdata.padData[i].vibrate[j]);
|
||||
}
|
||||
|
||||
pdata.padData[i].config = pads[i].config;
|
||||
}
|
||||
}
|
||||
else if (mode == FREEZE_SAVE) {
|
||||
if (data->size != sizeof(PadPluginFreezeData)) return 0;
|
||||
PadPluginFreezeData &pdata = *(PadPluginFreezeData*)(data->data);
|
||||
if (pdata.version != PAD_SAVE_STATE_VERSION || !stricmp(pdata.format, "PadMode")) return 0;
|
||||
StopVibrate();
|
||||
for (int i=0; i<2; i++) {
|
||||
u8 mode = pads[i].mode = pdata.padData[i].mode;
|
||||
if (mode != MODE_DIGITAL && mode != MODE_ANALOG && mode != MODE_DS2_NATIVE) {
|
||||
ResetPad(i);
|
||||
continue;
|
||||
}
|
||||
pads[i].config = pdata.padData[i].config;
|
||||
pads[i].modeLock = pdata.padData[i].locked;
|
||||
memcpy(pads[i].umask, pdata.padData[i].umask, sizeof(pads[i].umask));
|
||||
|
||||
// Means I only have to have one chunk of code to parse vibrate info.
|
||||
// Other plugins don't store it exactly, but think it's technically correct
|
||||
// to do so, though I could be wrong.
|
||||
PADstartPoll(i+1);
|
||||
PADpoll(0x4D);
|
||||
PADpoll(0x00);
|
||||
for (int j=0; j<7; j++) {
|
||||
PADpoll(pdata.padData[i].vibrate[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 CALLBACK PADreadPort1 (PadDataS* pads) {
|
||||
PADstartPoll(1);
|
||||
PADpoll(0x42);
|
||||
|
|
|
@ -19,4 +19,4 @@ EXPORTS
|
|||
PADtest
|
||||
PADabout
|
||||
PADupdate
|
||||
|
||||
PADfreeze
|
||||
|
|
|
@ -74,38 +74,21 @@ BEGIN
|
|||
PUSHBUTTON "R2",ID_R2,372,73,45,15
|
||||
PUSHBUTTON "L3",ID_L3,195,93,45,15
|
||||
PUSHBUTTON "R3",ID_R3,371,93,46,15
|
||||
GROUPBOX "D-Pad",ID_DPAD,251,44,110,68
|
||||
PUSHBUTTON "Up",ID_DPAD_UP,275,54,35,15
|
||||
PUSHBUTTON "Left",ID_DPAD_LEFT,257,73,35,15
|
||||
PUSHBUTTON "Right",ID_DPAD_RIGHT,297,73,35,15
|
||||
PUSHBUTTON "Down",ID_DPAD_DOWN,275,92,35,15
|
||||
PUSHBUTTON "Vert Axis",ID_DPAD_UDAXIS,314,54,40,15
|
||||
PUSHBUTTON "Horiz Axis",ID_DPAD_LRAXIS,314,92,40,15
|
||||
PUSHBUTTON "L1/R1 Axis",ID_L1R1,231,117,45,15
|
||||
PUSHBUTTON "L2/R2 Axis",ID_L2R2,281,117,45,15
|
||||
PUSHBUTTON "L3/R3 Axis",ID_L3R3,331,117,45,15
|
||||
GROUPBOX "Left Analog Stick",ID_LSTICK,195,135,108,70
|
||||
PUSHBUTTON "Up",ID_LSTICK_UP,218,145,35,15
|
||||
PUSHBUTTON "Left",ID_LSTICK_LEFT,200,164,35,15
|
||||
PUSHBUTTON "Right",ID_LSTICK_RIGHT,240,164,35,15
|
||||
PUSHBUTTON "Down",ID_LSTICK_DOWN,218,184,35,15
|
||||
PUSHBUTTON "Vert Axis",ID_LSTICK_UDAXIS,257,145,40,15
|
||||
PUSHBUTTON "Horiz Axis",ID_LSTICK_LRAXIS,257,184,40,15
|
||||
GROUPBOX "Right Analog Stick",ID_RSTICK,309,135,108,70
|
||||
PUSHBUTTON "Up",ID_RSTICK_UP,332,145,35,15
|
||||
PUSHBUTTON "Left",ID_RSTICK_LEFT,314,164,35,15
|
||||
PUSHBUTTON "Right",ID_RSTICK_RIGHT,354,164,35,15
|
||||
PUSHBUTTON "Down",ID_RSTICK_DOWN,332,184,35,15
|
||||
PUSHBUTTON "Vert Axis",ID_RSTICK_UDAXIS,371,145,40,15
|
||||
PUSHBUTTON "Horiz Axis",ID_RSTICK_LRAXIS,371,184,40,15
|
||||
GROUPBOX "Sensitivity",ID_SENSITIVITY,195,207,222,49
|
||||
EDITTEXT IDC_AXIS_DEVICE1,201,218,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS1,201,230,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,201,242,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17
|
||||
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10
|
||||
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10
|
||||
EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
GROUPBOX "D-Pad",IDC_STATIC,251,44,110,68
|
||||
PUSHBUTTON "Up",ID_DPAD_UP,285,54,35,15
|
||||
PUSHBUTTON "Left",ID_DPAD_LEFT,267,73,35,15
|
||||
PUSHBUTTON "Right",ID_DPAD_RIGHT,307,73,35,15
|
||||
PUSHBUTTON "Down",ID_DPAD_DOWN,285,92,35,15
|
||||
GROUPBOX "Left Analog Stick",IDC_STATIC,195,115,108,70
|
||||
PUSHBUTTON "Up",ID_LSTICK_UP,228,125,35,15
|
||||
PUSHBUTTON "Left",ID_LSTICK_LEFT,210,144,35,15
|
||||
PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,144,35,15
|
||||
PUSHBUTTON "Down",ID_LSTICK_DOWN,228,164,35,15
|
||||
GROUPBOX "Right Analog Stick",IDC_STATIC,309,115,108,70
|
||||
PUSHBUTTON "Up",ID_RSTICK_UP,342,125,35,15
|
||||
PUSHBUTTON "Left",ID_RSTICK_LEFT,324,144,35,15
|
||||
PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,144,35,15
|
||||
PUSHBUTTON "Down",ID_RSTICK_DOWN,342,164,35,15
|
||||
GROUPBOX "",ID_FF,195,6,222,250
|
||||
COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17
|
||||
|
@ -133,6 +116,14 @@ BEGIN
|
|||
CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10
|
||||
EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
PUSHBUTTON "Test",ID_TEST,196,260,62,15
|
||||
GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67
|
||||
EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17
|
||||
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10
|
||||
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10
|
||||
EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15
|
||||
PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15
|
||||
PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15
|
||||
|
@ -159,31 +150,9 @@ BEGIN
|
|||
PUSHBUTTON "Start",ID_START,256,122,45,15
|
||||
PUSHBUTTON "Select/Tilt",ID_SELECT,307,122,45,15
|
||||
PUSHBUTTON "Whammy Bar Up",ID_LSTICK_UP,219,146,69,15
|
||||
PUSHBUTTON "Whammy Bar Axis",ID_LSTICK_UDAXIS,212,165,84,15
|
||||
PUSHBUTTON "Whammy Bar Down",ID_LSTICK_DOWN,219,184,69,15
|
||||
PUSHBUTTON "Analog",ID_ANALOG,372,7,45,12,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Mouse",ID_MOUSE,372,51,45,12,NOT WS_VISIBLE
|
||||
PUSHBUTTON "L3",ID_L3,203,7,45,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "R3",ID_R3,203,23,46,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Whammy Bar Down",ID_LSTICK_DOWN,219,164,69,15
|
||||
PUSHBUTTON "Strum Bar Up",ID_DPAD_UP,336,146,58,15
|
||||
PUSHBUTTON "Strum Bar Axis",ID_DPAD_UDAXIS,328,165,74,15
|
||||
PUSHBUTTON "Strum Bar Down",ID_DPAD_DOWN,336,184,58,15
|
||||
PUSHBUTTON "Left",ID_DPAD_LEFT,342,28,35,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Right",ID_DPAD_RIGHT,382,28,35,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "L1",ID_L1,372,85,45,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "R1",ID_R1,372,67,45,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "L2",ID_L2,372,103,45,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "L1/R1 Axis",ID_L1R1,203,74,45,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "L2/R2 Axis",ID_L2R2,203,58,45,15,NOT WS_VISIBLE
|
||||
PUSHBUTTON "L3/R3 Axis",ID_L3R3,203,42,45,15,NOT WS_VISIBLE
|
||||
GROUPBOX "Sensitivity",ID_SENSITIVITY,195,207,222,49
|
||||
EDITTEXT IDC_AXIS_DEVICE1,201,218,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS1,201,230,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,201,242,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17
|
||||
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10
|
||||
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10
|
||||
EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
PUSHBUTTON "Strum Bar Down",ID_DPAD_DOWN,336,164,58,15
|
||||
GROUPBOX "",ID_FF,195,6,222,250
|
||||
COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17
|
||||
|
@ -211,6 +180,14 @@ BEGIN
|
|||
CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10
|
||||
EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
PUSHBUTTON "Test",ID_TEST,196,260,62,15
|
||||
GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67
|
||||
EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17
|
||||
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10
|
||||
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10
|
||||
EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15
|
||||
PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15
|
||||
PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15
|
||||
|
@ -236,16 +213,16 @@ BEGIN
|
|||
CONTROL "DirectInput",IDC_G_DI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,65,10
|
||||
CONTROL "XInput",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,104,39,10
|
||||
CONTROL "Monitor when in background",IDC_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,116,106,10
|
||||
GROUPBOX "Mouse API",IDC_STATIC,216,16,192,73
|
||||
GROUPBOX "Mouse API",IDC_STATIC,216,16,192,85
|
||||
CONTROL "Windows messaging",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,224,27,112,10
|
||||
CONTROL "Raw input (XP and later only)",IDC_M_RAW,"Button",BS_AUTORADIOBUTTON,224,39,112,10
|
||||
CONTROL "DirectInput",IDC_M_DI,"Button",BS_AUTORADIOBUTTON,224,51,112,10
|
||||
CONTROL "Disable",IDC_M_DISABLE,"Button",BS_AUTORADIOBUTTON,224,63,39,10
|
||||
CONTROL "Start without mouse focus",IDC_MOUSE_UNFOCUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,75,97,10
|
||||
GROUPBOX "Advanced",IDC_STATIC,216,92,192,38
|
||||
CONTROL "Allow binding entire axes to single buttons",IDC_AXIS_BUTTONS,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,104,177,10
|
||||
CONTROL "Allow multiple binding",IDC_MULTIPLE_BINDING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,116,83,10
|
||||
CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,87,71,10
|
||||
GROUPBOX "Advanced",IDC_STATIC,216,103,192,27
|
||||
CONTROL "Allow binding multiple PS2 controls to one PC control",IDC_MULTIPLE_BINDING,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,115,182,10
|
||||
GROUPBOX "Pad Options",IDC_STATIC,7,140,410,67
|
||||
GROUPBOX "Pad 1",IDC_STATIC,16,150,192,49
|
||||
CONTROL "Disable pad",IDC_DISABLE_PAD1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,162,53,10
|
||||
|
@ -268,10 +245,9 @@ BEGIN
|
|||
CONTROL "Safe fullscreen exit on escape",IDC_ESCAPE_FULLSCREEN_HACK,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,259,112,10
|
||||
CONTROL "Use GS thread (Recommended)",IDC_GS_THREAD_INPUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,271,116,10
|
||||
CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,71,10
|
||||
CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,79,10
|
||||
CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,77,10
|
||||
CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,259,76,10
|
||||
CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,79,10
|
||||
CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,77,10
|
||||
CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,76,10
|
||||
GROUPBOX "Debugging",IDC_STATIC,216,285,79,25
|
||||
CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,296,63,10
|
||||
PUSHBUTTON "Load",ID_LOAD,313,295,48,15
|
||||
|
|
|
@ -34,32 +34,22 @@
|
|||
#define IDC_DISABLE_SCREENSAVER 1119
|
||||
#define IDC_MOUSE_UNFOCUS 1120
|
||||
#define IDC_MOUSE_UNFOCUS2 1121
|
||||
#define IDC_AXIS_BUTTONS 1121
|
||||
#define IDC_BACKGROUND 1122
|
||||
#define IDC_MULTIPLE_BINDING 1123
|
||||
#define IDC_DISABLE_SCREENSAVER2 1124
|
||||
#define IDC_FORCE_HIDE 1124
|
||||
#define IDC_FORCE_HIDE2 1125
|
||||
#define IDC_GH2_HACK 1125
|
||||
#define IDC_FORCEFEEDBACK_HACK1 1126
|
||||
#define IDC_GH2_HACK2 1126
|
||||
#define IDC_VISTA_VOLUME 1126
|
||||
#define IDC_DISABLE_SCREENSAVER4 1127
|
||||
#define IDC_FORCEFEEDBACK_HACK2 1127
|
||||
#define IDC_FORCE_HIDE3 1127
|
||||
#define IDC_GS_THREAD_INPUT 1128
|
||||
#define IDC_GS_THREAD_INPUT2 1129
|
||||
#define IDC_SAVE_STATE_TITLE 1129
|
||||
#define IDC_SLIDER1 0x1000
|
||||
#define IDC_FLIP1 0x1001
|
||||
#define IDC_AXIS1 0x1002
|
||||
#define IDC_AXIS_DIRECTION 0x1002
|
||||
#define IDC_AXIS_CONTROL1 0x1003
|
||||
#define IDC_AXIS_SENSITIVITY1 0x1004
|
||||
#define IDC_TURBO 0x1005
|
||||
#define IDC_AXIS_DEVICE1 0x1006
|
||||
#define ID_SENSITIVITY 0x1007
|
||||
#define ID_DPAD 0x1008
|
||||
#define ID_LSTICK 0x1009
|
||||
#define ID_RSTICK 0x100A
|
||||
#define ID_GUITAR_HERO 0x10FB
|
||||
#define ID_LOCK_BUTTONS 0x10FC
|
||||
#define ID_LOCK 0x10FD
|
||||
|
|
Loading…
Reference in New Issue