mirror of https://github.com/PCSX2/pcsx2.git
LilyPad: Experimental deadzone code. Old pressure sensitive button bindings must be rebound (DS3 buttons, XInput triggers).
Currently anything below deadzone is mapped to 0. deadzone and above are mapped as if the control's true zero is 0 and 1/sensitivity is fully down (As opposed to deadzone being zero). May change in the future. Modified precompiled header to fix no-CRT build. List of bindings noew automatically jumps to new bindings. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1914 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
6b9ffd8132
commit
3a0ad40159
|
@ -1,6 +1,9 @@
|
|||
#include "Global.h"
|
||||
|
||||
#include "PS2Edefs.h"
|
||||
#include "resource.h"
|
||||
#include "InputManager.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "Diagnostics.h"
|
||||
#include "DeviceEnumerator.h"
|
||||
#include "KeyboardQueue.h"
|
||||
|
@ -96,6 +99,7 @@ void SetLogSliderVal(HWND hWnd, int id, HWND hWndText, int val) {
|
|||
int sliderPos = 0;
|
||||
wchar_t temp[30];
|
||||
EnableWindow(hWndSlider, val != 0);
|
||||
EnableWindow(hWndText, val != 0);
|
||||
EnableWindow(GetDlgItem(hWnd, id+1), val != 0);
|
||||
if (!val) val = BASE_SENSITIVITY;
|
||||
CheckDlgButton(hWnd, id+1, BST_CHECKED * (val<0));
|
||||
|
@ -268,7 +272,7 @@ inline void GetSettingsFileName(wchar_t *out) {
|
|||
}
|
||||
|
||||
int GetBinding(int port, int slot, int index, Device *&dev, Binding *&b, ForceFeedbackBinding *&ffb);
|
||||
int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int slot, int command, int sensitivity, int turbo);
|
||||
int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int slot, int command, int sensitivity, int turbo, int deadZone);
|
||||
|
||||
int CreateEffectBinding(Device *dev, wchar_t *effectName, unsigned int port, unsigned int slot, unsigned int motor, ForceFeedbackBinding **binding);
|
||||
|
||||
|
@ -283,6 +287,8 @@ void SelChanged(int port, int slot) {
|
|||
// Second value is now turbo.
|
||||
int turbo = -1;
|
||||
int sensitivity = 0;
|
||||
int deadZone = 0;
|
||||
int nonButtons = 0;
|
||||
// Set if sensitivity != 0, but need to disable flip anyways.
|
||||
// Only used to relative axes.
|
||||
int disableFlip = 0;
|
||||
|
@ -350,6 +356,10 @@ void SelChanged(int port, int slot) {
|
|||
else {
|
||||
sensitivity += b->sensitivity;
|
||||
}
|
||||
if (((control->uid >> 16)&0xFF) != PSHBTN && ((control->uid >> 16)&0xFF) != TGLBTN) {
|
||||
deadZone += b->deadZone;
|
||||
nonButtons++;
|
||||
}
|
||||
}
|
||||
else disableFlip = 1;
|
||||
}
|
||||
|
@ -360,6 +370,7 @@ void SelChanged(int port, int slot) {
|
|||
if ((bFound && ffbFound) || ffbFound > 1) {
|
||||
ffb = 0;
|
||||
turbo = -1;
|
||||
deadZone = 0;
|
||||
sensitivity = 0;
|
||||
disableFlip = 1;
|
||||
bFound = ffbFound = 0;
|
||||
|
@ -367,6 +378,9 @@ void SelChanged(int port, int slot) {
|
|||
else if (bFound) {
|
||||
turbo++;
|
||||
sensitivity /= bFound;
|
||||
if (nonButtons) {
|
||||
deadZone /= nonButtons;
|
||||
}
|
||||
if (bFound > 1) disableFlip = 1;
|
||||
else if (flipped) {
|
||||
sensitivity = -sensitivity;
|
||||
|
@ -419,6 +433,7 @@ void SelChanged(int port, int slot) {
|
|||
}
|
||||
if (!ffb) {
|
||||
SetLogSliderVal(hWnd, IDC_SLIDER1, GetDlgItem(hWnd, IDC_AXIS_SENSITIVITY1), sensitivity);
|
||||
SetLogSliderVal(hWnd, IDC_SLIDER_DEADZONE, GetDlgItem(hWnd, IDC_AXIS_DEADZONE), deadZone);
|
||||
|
||||
if (disableFlip) EnableWindow(GetDlgItem(hWnd, IDC_FLIP1), 0);
|
||||
|
||||
|
@ -570,7 +585,7 @@ int ListBoundEffect(int port, int slot, Device *dev, ForceFeedbackBinding *b) {
|
|||
}
|
||||
|
||||
// Only for use with control bindings. Affects all highlighted bindings.
|
||||
void ChangeValue(int port, int slot, int *newSensitivity, int *turbo) {
|
||||
void ChangeValue(int port, int slot, int *newSensitivity, int *newTurbo, int *newDeadZone) {
|
||||
if (!hWnds[port][slot]) return;
|
||||
HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST);
|
||||
int count = ListView_GetSelectedCount(hWndList);
|
||||
|
@ -590,8 +605,11 @@ void ChangeValue(int port, int slot, int *newSensitivity, int *turbo) {
|
|||
else
|
||||
b->sensitivity = *newSensitivity;
|
||||
}
|
||||
if (turbo) {
|
||||
b->turbo = *turbo;
|
||||
if (newDeadZone) {
|
||||
b->deadZone = *newDeadZone;
|
||||
}
|
||||
if (newTurbo) {
|
||||
b->turbo = *newTurbo;
|
||||
}
|
||||
}
|
||||
PropSheet_Changed(hWndProp, hWnds[port][slot]);
|
||||
|
@ -758,7 +776,7 @@ int SaveSettings(wchar_t *file=0) {
|
|||
Binding *b = dev->pads[port][slot].bindings+j;
|
||||
VirtualControl *c = &dev->virtualControls[b->controlIndex];
|
||||
wsprintfW(temp, L"Binding %i", bindingCount++);
|
||||
wsprintfW(temp2, L"0x%08X, %i, %i, %i, %i, %i", c->uid, port, b->command, b->sensitivity, b->turbo, slot);
|
||||
wsprintfW(temp2, L"0x%08X, %i, %i, %i, %i, %i, %i", c->uid, port, b->command, b->sensitivity, b->turbo, slot, b->deadZone);
|
||||
noError &= WritePrivateProfileStringW(id, temp, temp2, file);
|
||||
}
|
||||
for (int j=0; j<dev->pads[port][slot].numFFBindings; j++) {
|
||||
|
@ -891,7 +909,7 @@ int LoadSettings(int force, wchar_t *file) {
|
|||
}
|
||||
last = 1;
|
||||
unsigned int uid;
|
||||
int port, command, sensitivity, turbo, slot = 0;
|
||||
int port, command, sensitivity, turbo, slot = 0, deadZone = 0;
|
||||
int w = 0;
|
||||
char string[1000];
|
||||
while (temp2[w]) {
|
||||
|
@ -899,12 +917,12 @@ int LoadSettings(int force, wchar_t *file) {
|
|||
w++;
|
||||
}
|
||||
string[w] = 0;
|
||||
int len = sscanf(string, " %i , %i , %i , %i , %i , %i", &uid, &port, &command, &sensitivity, &turbo, &slot);
|
||||
int len = sscanf(string, " %i , %i , %i , %i , %i , %i , %i", &uid, &port, &command, &sensitivity, &turbo, &slot, &deadZone);
|
||||
if (len >= 5 && type) {
|
||||
VirtualControl *c = dev->GetVirtualControl(uid);
|
||||
if (!c) c = dev->AddVirtualControl(uid, -1);
|
||||
if (c) {
|
||||
BindCommand(dev, uid, port, slot, command, sensitivity, turbo);
|
||||
BindCommand(dev, uid, port, slot, command, sensitivity, turbo, deadZone);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1119,12 +1137,20 @@ int CreateEffectBinding(Device *dev, wchar_t *effectID, unsigned int port, unsig
|
|||
return ListBoundEffect(port, slot, dev, b);
|
||||
}
|
||||
|
||||
int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int slot, int command, int sensitivity, int turbo) {
|
||||
int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int slot, int command, int sensitivity, int turbo, int deadZone) {
|
||||
// Checks needed because I use this directly when loading bindings.
|
||||
if (port > 1 || slot>3) {
|
||||
return -1;
|
||||
}
|
||||
if (!sensitivity) sensitivity = BASE_SENSITIVITY;
|
||||
else if (!deadZone) {
|
||||
if (dev->api != DS3 || !((uid>>16) & PRESSURE_BTN)) {
|
||||
deadZone = DEFAULT_DEADZONE;
|
||||
}
|
||||
else {
|
||||
deadZone = 1;
|
||||
}
|
||||
}
|
||||
// Relative axes can have negative sensitivity.
|
||||
else if (((uid>>16) & 0xFF) == RELAXIS) {
|
||||
sensitivity = abs(sensitivity);
|
||||
|
@ -1146,6 +1172,7 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int s
|
|||
b->controlIndex = controlIndex;
|
||||
b->turbo = turbo;
|
||||
b->sensitivity = sensitivity;
|
||||
b->deadZone = deadZone;
|
||||
// Where it appears in listview.
|
||||
int count = ListBoundCommand(port, slot, dev, b);
|
||||
|
||||
|
@ -1253,8 +1280,8 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
slot = (int)((PROPSHEETPAGE *)lParam)->lParam >> 1;
|
||||
hWnds[port][slot] = hWnd;
|
||||
SendMessage(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
|
||||
HWND hWndSlider = GetDlgItem(hWnd, IDC_SLIDER1);
|
||||
SetupLogSlider(hWndSlider);
|
||||
SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER1));
|
||||
SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER_DEADZONE));
|
||||
if (port || slot)
|
||||
EnableWindow(GetDlgItem(hWnd, ID_IGNORE), 0);
|
||||
|
||||
|
@ -1286,14 +1313,15 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
UnselectAll(hWndList);
|
||||
int index = -1;
|
||||
if (command == 0x7F && dev->api == IGNORE_KEYBOARD) {
|
||||
index = BindCommand(dev, uid, 0, 0, command, BASE_SENSITIVITY, 0);
|
||||
index = BindCommand(dev, uid, 0, 0, command, BASE_SENSITIVITY, 0, 0);
|
||||
}
|
||||
else if (command < 0x30) {
|
||||
index = BindCommand(dev, uid, port, slot, command, BASE_SENSITIVITY, 0);
|
||||
index = BindCommand(dev, uid, port, slot, command, BASE_SENSITIVITY, 0, 0);
|
||||
}
|
||||
if (index >= 0) {
|
||||
PropSheet_Changed(hWndProp, hWnds[port][slot]);
|
||||
ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_EnsureVisible(hWndList, index, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1355,7 +1383,10 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
int id = GetDlgCtrlID((HWND)lParam);
|
||||
int val = GetLogSliderVal(hWnd, id);
|
||||
if (id == IDC_SLIDER1) {
|
||||
ChangeValue(port, slot, &val, 0);
|
||||
ChangeValue(port, slot, &val, 0, 0);
|
||||
}
|
||||
else if (id == IDC_SLIDER_DEADZONE) {
|
||||
ChangeValue(port, slot, 0, 0, &val);
|
||||
}
|
||||
else {
|
||||
ChangeEffect(port, slot, id, &val, 0);
|
||||
|
@ -1377,7 +1408,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
uid = (uid&0x00FFFFFF) | axisUIDs[cbsel];
|
||||
Binding backup = *b;
|
||||
DeleteSelected(port, slot);
|
||||
int index = BindCommand(dev, uid, port, slot, backup.command, backup.sensitivity, backup.turbo);
|
||||
int index = BindCommand(dev, uid, port, slot, backup.command, backup.sensitivity, backup.turbo, backup.deadZone);
|
||||
ListView_SetItemState(hWndList, index, LVIS_SELECTED, LVIS_SELECTED);
|
||||
PropSheet_Changed(hWndProp, hWnd);
|
||||
}
|
||||
|
@ -1464,6 +1495,7 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
}
|
||||
UnselectAll(hWndList);
|
||||
ListView_SetItemState(hWndList, count, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_EnsureVisible(hWndList, count, 0);
|
||||
}
|
||||
PropSheet_Changed(hWndProp, hWnd);
|
||||
}
|
||||
|
@ -1532,11 +1564,11 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l
|
|||
// Don't allow setting it back to indeterminate.
|
||||
SendMessage(GetDlgItem(hWnd, IDC_TURBO), BM_SETSTYLE, BS_AUTOCHECKBOX, 0);
|
||||
int turbo = (IsDlgButtonChecked(hWnd, IDC_TURBO) == BST_CHECKED);
|
||||
ChangeValue(port, slot, 0, &turbo);
|
||||
ChangeValue(port, slot, 0, &turbo, 0);
|
||||
}
|
||||
else if (cmd == IDC_FLIP1 || cmd == IDC_TURBO) {
|
||||
else if (cmd == IDC_FLIP1) {
|
||||
int val = GetLogSliderVal(hWnd, IDC_SLIDER1);
|
||||
ChangeValue(port, slot, &val, 0);
|
||||
ChangeValue(port, slot, &val, 0, 0);
|
||||
}
|
||||
else if (cmd >= IDC_FF_AXIS1_ENABLED && cmd < IDC_FF_AXIS8_ENABLED + 16) {
|
||||
int index = (cmd - IDC_FF_AXIS1_ENABLED)/16;
|
||||
|
@ -1825,26 +1857,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
|||
}
|
||||
|
||||
int mtap = config.multitap[0] + 2*config.multitap[1];
|
||||
|
||||
if (IsDlgButtonChecked(hWnd, IDC_G_DS3) && !config.gameApis.dualShock3) {
|
||||
if (IDOK !=
|
||||
MessageBoxA(hWnd,
|
||||
"This option will attempt to connect directly to any connected\n"
|
||||
"DualShock 3 devices. It is completely experimental, and based\n"
|
||||
"on no published specs.\n"
|
||||
"\n"
|
||||
"Furthermore, It uses libusb to Initialize DS3 pads. Libusb can\n"
|
||||
"do odd things to USB and non-USB devices when it enumerates them.\n"
|
||||
"\n"
|
||||
"That having been said, I know of no serious problems with it.\n"
|
||||
"\n"
|
||||
"I have no idea if it works with bluetooth or not.\n"
|
||||
"\n"
|
||||
"Are you sure you wish to continue?", "Warning", MB_OKCANCEL | MB_ICONWARNING)) {
|
||||
CheckDlgButton(hWnd, IDC_G_DS3, BST_UNCHECKED);
|
||||
}
|
||||
|
||||
}
|
||||
int vistaVol = config.vistaVolume;
|
||||
|
||||
for (int j=0; j<sizeof(BoolOptionsInfo)/sizeof(BoolOptionsInfo[0]); j++) {
|
||||
config.bools[j] = (IsDlgButtonChecked(hWnd, BoolOptionsInfo[j].ControlId) == BST_CHECKED);
|
||||
|
@ -1854,7 +1867,12 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
|||
((IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK2) == BST_CHECKED)<<1);
|
||||
|
||||
if (!config.vistaVolume) {
|
||||
SetVolume(100);
|
||||
if (vistaVol) {
|
||||
// Restore volume if just disabled. Don't touch, otherwise, just in case
|
||||
// sound plugin plays with it.
|
||||
SetVolume(100);
|
||||
}
|
||||
config.vistaVolume = 100;
|
||||
}
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#include "Global.h"
|
||||
#include "InputManager.h"
|
||||
|
||||
#include "DeviceEnumerator.h"
|
||||
#include "WindowsMessaging.h"
|
||||
#include "DirectInput.h"
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
#include "DeviceEnumerator.h"
|
||||
#include "KeyboardQueue.h"
|
||||
|
||||
#include "resource.h"
|
||||
#include "InputManager.h"
|
||||
|
||||
Device *dev;
|
||||
|
||||
INT_PTR CALLBACK DiagDialog(HWND hWnd, unsigned int uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#include "Global.h"
|
||||
#include <dinput.h>
|
||||
#include "InputManager.h"
|
||||
|
||||
#include "VKey.h"
|
||||
#include "DirectInput.h"
|
||||
#include <dinput.h>
|
||||
#include "DeviceEnumerator.h"
|
||||
#include "PS2Etypes.h"
|
||||
|
||||
|
@ -597,7 +598,13 @@ BOOL CALLBACK EnumCallback (LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) {
|
|||
}
|
||||
IDirectInputDevice8 *did;
|
||||
if (DI_OK == di8->CreateDevice(lpddi->guidInstance, &did, 0)) {
|
||||
dm->AddDevice(new DirectInputDevice(type, did, fullName, instanceID, productID, lpddi->guidInstance));
|
||||
DirectInputDevice *dev = new DirectInputDevice(type, did, fullName, instanceID, productID, lpddi->guidInstance);
|
||||
if (dev->numPhysicalControls || dev->numFFAxes) {
|
||||
dm->AddDevice(dev);
|
||||
}
|
||||
else {
|
||||
delete dev;
|
||||
}
|
||||
}
|
||||
free(fullName);
|
||||
return DIENUM_CONTINUE;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#include "Global.h"
|
||||
#include "InputManager.h"
|
||||
|
||||
#include "usb.h"
|
||||
#include "HidDevice.h"
|
||||
|
||||
|
@ -242,7 +244,12 @@ public:
|
|||
this->index = index;
|
||||
int i;
|
||||
for (i=0; i<16; i++) {
|
||||
AddPhysicalControl(PSHBTN, i, 0);
|
||||
if (i != 14 && i != 15 && i != 8 && i != 9) {
|
||||
AddPhysicalControl(PRESSURE_BTN, i, 0);
|
||||
}
|
||||
else {
|
||||
AddPhysicalControl(PSHBTN, i, 0);
|
||||
}
|
||||
}
|
||||
for (; i<23; i++) {
|
||||
AddPhysicalControl(ABSAXIS, i, 0);
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
|
||||
#ifdef NO_CRT
|
||||
#define _CRT_ALLOCATION_DEFINED
|
||||
|
||||
inline void * malloc(size_t size);
|
||||
inline void * calloc(size_t num, size_t size);
|
||||
inline void free(void * mem);
|
||||
inline void * realloc(void *mem, size_t size);
|
||||
#endif
|
||||
|
||||
#define UNICODE
|
||||
|
@ -50,10 +55,6 @@
|
|||
#include "PS2Etypes.h"
|
||||
#include "PS2Edefs.h"
|
||||
|
||||
#include "resource.h"
|
||||
#include "InputManager.h"
|
||||
#include "Config.h"
|
||||
|
||||
extern HINSTANCE hInst;
|
||||
// Needed for config screen
|
||||
void GetNameAndVersionString(wchar_t *out);
|
||||
|
@ -92,10 +93,6 @@ EXPORT_C_(s32) PADqueryMtap(u8 port);
|
|||
|
||||
#ifdef NO_CRT
|
||||
|
||||
#define malloc MyMalloc
|
||||
#define calloc MyCalloc
|
||||
#define free MyFree
|
||||
#define realloc MyRealloc
|
||||
#define wcsdup MyWcsdup
|
||||
#define wcsicmp MyWcsicmp
|
||||
|
||||
|
@ -110,7 +107,7 @@ inline void * calloc(size_t num, size_t size) {
|
|||
return out;
|
||||
}
|
||||
|
||||
inline void free(__inout_opt void * mem) {
|
||||
inline void free(void * mem) {
|
||||
if (mem) HeapFree(GetProcessHeap(), 0, mem);
|
||||
}
|
||||
|
||||
|
@ -126,14 +123,6 @@ inline void * realloc(void *mem, size_t size) {
|
|||
return HeapReAlloc(GetProcessHeap(), 0, mem, size);
|
||||
}
|
||||
|
||||
inline wchar_t * __cdecl wcsdup(const wchar_t *in) {
|
||||
size_t size = sizeof(wchar_t) * (1+wcslen(in));
|
||||
wchar_t *out = (wchar_t*) malloc(size);
|
||||
if (out)
|
||||
memcpy(out, in, size);
|
||||
return out;
|
||||
}
|
||||
|
||||
inline void * __cdecl operator new(size_t lSize) {
|
||||
return HeapAlloc(GetProcessHeap(), 0, lSize);
|
||||
}
|
||||
|
@ -142,6 +131,14 @@ inline void __cdecl operator delete(void *pBlock) {
|
|||
HeapFree(GetProcessHeap(), 0, pBlock);
|
||||
}
|
||||
|
||||
inline wchar_t * __cdecl wcsdup(const wchar_t *in) {
|
||||
size_t size = sizeof(wchar_t) * (1+wcslen(in));
|
||||
wchar_t *out = (wchar_t*) malloc(size);
|
||||
if (out)
|
||||
memcpy(out, in, size);
|
||||
return out;
|
||||
}
|
||||
|
||||
inline int __cdecl wcsicmp(const wchar_t *s1, const wchar_t *s2) {
|
||||
int res = CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, s1, -1, s2, -1);
|
||||
if (res) return res-2;
|
||||
|
|
|
@ -392,6 +392,10 @@ Device *InputDeviceManager::GetActiveDevice(InitInfo *info, unsigned int *uid, i
|
|||
if (((devices[i]->virtualControls[j].uid>>16) & 0xFF) == RELAXIS) {
|
||||
diff = diff/4+1;
|
||||
}
|
||||
// Less pressure needed to bind DS3 buttons.
|
||||
if (devices[i]->api == DS3 && (((devices[i]->virtualControls[j].uid>>16) & 0xFF) & BUTTON)) {
|
||||
diff *= 4;
|
||||
}
|
||||
if (diff > bestDiff) {
|
||||
if (devices[i]->virtualControls[j].uid & UID_AXIS) {
|
||||
if ((((devices[i]->virtualControls[j].uid>>16)&0xFF) != ABSAXIS)) continue;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#define BASE_SENSITIVITY (1<<16)
|
||||
#define FULLY_DOWN (1<<16)
|
||||
|
||||
#define DEFAULT_DEADZONE (BASE_SENSITIVITY/0x10)
|
||||
|
||||
/* Idea is for this file and the associated cpp file to be Windows independent.
|
||||
* Still more effort than it's worth to port to Linux, however.
|
||||
|
@ -34,16 +35,19 @@ enum ControlType {
|
|||
// that range is treated as -1 (Though 36000-37000 is treated
|
||||
// like 0 to 1000, just in case).
|
||||
POV = 16,
|
||||
PRESSURE_BTN = 32,
|
||||
};
|
||||
|
||||
// Masks to determine button type. Don't need one for POV.
|
||||
#define BUTTON 12
|
||||
#define BUTTON (PSHBTN | TGLBTN | PRESSURE_BTN)
|
||||
#define BINARY_BUTTON (PSHBTN | TGLBTN)
|
||||
#define AXIS 3
|
||||
|
||||
struct Binding {
|
||||
int controlIndex;
|
||||
int command;
|
||||
int sensitivity;
|
||||
int deadZone;
|
||||
unsigned char turbo;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#include "Global.h"
|
||||
#include "InputManager.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include "KeyboardHook.h"
|
||||
#include "WindowsKeyboard.h"
|
||||
#include "VKey.h"
|
||||
#include "WndProcEater.h"
|
||||
#include "DeviceEnumerator.h"
|
||||
|
||||
extern HINSTANCE hInst;
|
||||
LRESULT CALLBACK IgnoreKeyboardHook(int code, WPARAM wParam, LPARAM lParam);
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
// For escape timer, so as not to break GSDX+DX9.
|
||||
#include <time.h>
|
||||
#include "resource.h"
|
||||
#include "InputManager.h"
|
||||
#include "Config.h"
|
||||
|
||||
#define PADdefs
|
||||
|
||||
|
@ -328,21 +331,24 @@ void AddForce(ButtonSum *sum, u8 cmd, int delta = 255) {
|
|||
}
|
||||
|
||||
void ProcessButtonBinding(Binding *b, ButtonSum *sum, int value) {
|
||||
if (value < b->deadZone || !value) return;
|
||||
|
||||
int sensitivity = b->sensitivity;
|
||||
if (sensitivity < 0) {
|
||||
sensitivity = -sensitivity;
|
||||
value = (1<<16)-value;
|
||||
}
|
||||
if (value > 0) {
|
||||
/* Note: Value ranges of FULLY_DOWN, and sensitivity of
|
||||
* BASE_SENSITIVITY corresponds to an axis/button being exactly fully down.
|
||||
* Math in next line takes care of those two conditions, rounding as necessary.
|
||||
* Done using __int64s because overflows will occur when
|
||||
* sensitivity > BASE_SENSITIVITY and/or value > FULLY_DOWN. Latter only happens
|
||||
* for relative axis.
|
||||
*/
|
||||
AddForce(sum, b->command, (int)((((sensitivity*(255*(__int64)value)) + BASE_SENSITIVITY/2)/BASE_SENSITIVITY + FULLY_DOWN/2)/FULLY_DOWN));
|
||||
}
|
||||
if (value < 0) return;
|
||||
|
||||
/* Note: Value ranges of FULLY_DOWN, and sensitivity of
|
||||
* BASE_SENSITIVITY corresponds to an axis/button being exactly fully down.
|
||||
* Math in next line takes care of those two conditions, rounding as necessary.
|
||||
* Done using __int64s because overflows will occur when
|
||||
* sensitivity > BASE_SENSITIVITY and/or value > FULLY_DOWN. Latter only happens
|
||||
* for relative axis.
|
||||
*/
|
||||
int force = (int)((((sensitivity*(255*(__int64)value)) + BASE_SENSITIVITY/2)/BASE_SENSITIVITY + FULLY_DOWN/2)/FULLY_DOWN);
|
||||
AddForce(sum, b->command, force);
|
||||
}
|
||||
|
||||
// Restricts d-pad/analog stick values to be from -255 to 255 and button values to be from 0 to 255.
|
||||
|
@ -1020,20 +1026,20 @@ u8 CALLBACK PADpoll(u8 value) {
|
|||
|
||||
u8 b1 = 0xFF, b2 = 0xFF;
|
||||
for (i = 0; i<4; i++) {
|
||||
b1 -= (sum->buttons[i]>=0x10) << i;
|
||||
b1 -= (sum->buttons[i] > 0) << i;
|
||||
}
|
||||
for (i = 0; i<8; i++) {
|
||||
b2 -= (sum->buttons[i+4]>=0x10) << i;
|
||||
b2 -= (sum->buttons[i+4] > 0) << i;
|
||||
}
|
||||
if (config.padConfigs[query.port][query.slot].type == GuitarPad && !config.GH2) {
|
||||
sum->sticks[0].horiz = -255;
|
||||
// Not sure about this. Forces wammy to be from 0 to 0x7F.
|
||||
// if (sum->sticks[2].vert > 0) sum->sticks[2].vert = 0;
|
||||
}
|
||||
b1 -= ((sum->sticks[0].vert<=-0x10) << 4);
|
||||
b1 -= ((sum->sticks[0].horiz>=0x10) << 5);
|
||||
b1 -= ((sum->sticks[0].vert>=0x10) << 6);
|
||||
b1 -= ((sum->sticks[0].horiz<=-0x10) << 7);
|
||||
b1 -= ((sum->sticks[0].vert < 0) << 4);
|
||||
b1 -= ((sum->sticks[0].horiz > 0) << 5);
|
||||
b1 -= ((sum->sticks[0].vert > 0) << 6);
|
||||
b1 -= ((sum->sticks[0].horiz < 0) << 7);
|
||||
query.response[3] = b1;
|
||||
query.response[4] = b2;
|
||||
|
||||
|
|
|
@ -117,14 +117,18 @@ BEGIN
|
|||
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,59,15
|
||||
PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15
|
||||
GROUPBOX "Sensitivity",ID_SENSITIVITY,195,188,222,66
|
||||
EDITTEXT IDC_AXIS_DEVICE1,203,202,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
COMBOBOX IDC_AXIS_DIRECTION,202,218,70,47,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,203,240,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 "Configure Binding",ID_SENSITIVITY,195,186,222,70
|
||||
EDITTEXT IDC_AXIS_DEVICE1,202,199,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
COMBOBOX IDC_AXIS_DIRECTION,276,197,70,47,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,349,199,65,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
LTEXT "Sensitivity",IDC_LABEL_SENSITIVITY,202,215,42,8
|
||||
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,225,34,10
|
||||
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,240,215,131,17
|
||||
EDITTEXT IDC_AXIS_SENSITIVITY1,377,213,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,385,224,27,10
|
||||
LTEXT "Dead Zone",IDC_LABEL_DEADZONE,202,240,42,8
|
||||
CONTROL "",IDC_SLIDER_DEADZONE,"msctls_trackbar32",WS_TABSTOP,240,236,131,17
|
||||
EDITTEXT IDC_AXIS_DEADZONE,377,239,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15
|
||||
PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15
|
||||
PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15
|
||||
|
@ -181,18 +185,22 @@ BEGIN
|
|||
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,59,15
|
||||
PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15
|
||||
GROUPBOX "Binding Details",ID_SENSITIVITY,195,188,222,66
|
||||
EDITTEXT IDC_AXIS_DEVICE1,203,202,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
COMBOBOX IDC_AXIS_DIRECTION,202,218,70,47,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,203,240,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 "Configure Binding",ID_SENSITIVITY,195,186,222,70
|
||||
EDITTEXT IDC_AXIS_DEVICE1,202,199,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
COMBOBOX IDC_AXIS_DIRECTION,276,197,70,47,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
EDITTEXT IDC_AXIS_CONTROL1,349,199,65,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
LTEXT "Sensitivity",IDC_LABEL_SENSITIVITY,202,215,42,8
|
||||
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,225,34,10
|
||||
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,240,215,131,17
|
||||
EDITTEXT IDC_AXIS_SENSITIVITY1,377,213,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,385,224,27,10
|
||||
LTEXT "Dead Zone",IDC_LABEL_DEADZONE,202,240,42,8
|
||||
CONTROL "",IDC_SLIDER_DEADZONE,"msctls_trackbar32",WS_TABSTOP,240,236,131,17
|
||||
EDITTEXT IDC_AXIS_DEADZONE,377,239,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||
PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15
|
||||
PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15
|
||||
PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15
|
||||
GROUPBOX "New Force Feedback Effect",IDC_STATIC,262,260,155,51
|
||||
GROUPBOX "Add Force Feedback Effect",IDC_STATIC,262,260,155,51
|
||||
COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14
|
||||
PUSHBUTTON "Small Motor",ID_SMALL_MOTOR,347,291,64,14
|
||||
|
|
|
@ -96,6 +96,89 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\common\vsprops\BaseProperties.vsprops;..\..\common\vsprops\3rdpartyDeps.vsprops"
|
||||
UseOfMFC="0"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="3"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TEST_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="Global.h"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4995, 4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="ntdll.lib Setupapi.lib Winmm.lib ole32.lib advapi32.lib user32.lib kernel32.lib Comdlg32.lib dinput8.lib dxguid.lib comctl32.lib"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
ConfigurationType="2"
|
||||
|
@ -180,177 +263,6 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release No CRT|Win32"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets=".\ProjectRootDir.vsprops;..\..\common\vsprops\BaseProperties.vsprops;..\..\common\vsprops\CodeGen_Release.vsprops"
|
||||
UseOfMFC="0"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
WholeProgramOptimization="false"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;TEST_EXPORTS;NO_CRT"
|
||||
ExceptionHandling="0"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="Global.h"
|
||||
CallingConvention="1"
|
||||
DisableSpecificWarnings="4995, 4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="ntdll.lib Setupapi.lib Winmm.lib ole32.lib advapi32.lib user32.lib kernel32.lib Comdlg32.lib dinput8.lib dxguid.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)-no CRT.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
IgnoreAllDefaultLibraries="true"
|
||||
ModuleDefinitionFile=".\LilyPad.def"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
LinkTimeCodeGeneration="0"
|
||||
EntryPointSymbol="DllMain"
|
||||
RandomizedBaseAddress="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="..\..\common\vsprops\plugin_svnroot.vsprops;.\ProjectRootDir.vsprops;..\..\common\vsprops\BaseProperties.vsprops;..\..\common\vsprops\3rdpartyDeps.vsprops"
|
||||
UseOfMFC="0"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="3"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TEST_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="Global.h"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4995, 4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="ntdll.lib Setupapi.lib Winmm.lib ole32.lib advapi32.lib user32.lib kernel32.lib Comdlg32.lib dinput8.lib dxguid.lib comctl32.lib"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
ConfigurationType="2"
|
||||
|
@ -381,10 +293,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
WholeProgramOptimization="true"
|
||||
|
@ -453,6 +363,93 @@
|
|||
ExcludedFromBuild="true"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release No CRT|Win32"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets=".\ProjectRootDir.vsprops;..\..\common\vsprops\BaseProperties.vsprops;..\..\common\vsprops\CodeGen_Release.vsprops"
|
||||
UseOfMFC="0"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
WholeProgramOptimization="false"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;TEST_EXPORTS;NO_CRT"
|
||||
ExceptionHandling="0"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="Global.h"
|
||||
CallingConvention="1"
|
||||
DisableSpecificWarnings="4995, 4996"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="ntdll.lib Setupapi.lib Winmm.lib ole32.lib advapi32.lib user32.lib kernel32.lib Comdlg32.lib dinput8.lib dxguid.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName)-no CRT.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
IgnoreAllDefaultLibraries="true"
|
||||
ModuleDefinitionFile=".\LilyPad.def"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
LinkTimeCodeGeneration="0"
|
||||
EntryPointSymbol="DllMain"
|
||||
RandomizedBaseAddress="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release No CRT|x64"
|
||||
ConfigurationType="2"
|
||||
|
@ -483,7 +480,6 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
|
@ -572,6 +568,14 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -581,23 +585,6 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
|
@ -608,6 +595,15 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|x64"
|
||||
>
|
||||
|
@ -642,6 +638,14 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -651,23 +655,6 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
|
@ -678,6 +665,15 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|x64"
|
||||
>
|
||||
|
@ -705,22 +701,6 @@
|
|||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
|
@ -729,6 +709,14 @@
|
|||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
|
@ -737,6 +725,14 @@
|
|||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|x64"
|
||||
>
|
||||
|
@ -778,22 +774,6 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
|
@ -802,6 +782,14 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
|
@ -810,6 +798,14 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|x64"
|
||||
>
|
||||
|
@ -938,6 +934,14 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
|
@ -947,23 +951,6 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
|
@ -974,6 +961,15 @@
|
|||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release No CRT|x64"
|
||||
>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "Global.h"
|
||||
#include "InputManager.h"
|
||||
#include "WindowsMessaging.h"
|
||||
#include "VKey.h"
|
||||
#include "DeviceEnumerator.h"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "Global.h"
|
||||
#include "InputManager.h"
|
||||
#include "VKey.h"
|
||||
#include "WindowsKeyboard.h"
|
||||
#include "KeyboardQueue.h"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "Global.h"
|
||||
#include "InputManager.h"
|
||||
#include "WindowsMessaging.h"
|
||||
#include "VKey.h"
|
||||
#include "DeviceEnumerator.h"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "Global.h"
|
||||
#include "InputManager.h"
|
||||
#include "VKey.h"
|
||||
#include "WindowsMouse.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "Global.h"
|
||||
#include "VKey.h"
|
||||
#include <xinput.h>
|
||||
#include "VKey.h"
|
||||
#include "InputManager.h"
|
||||
|
||||
// This way, I don't require that XInput junk be installed.
|
||||
typedef void (CALLBACK *_XInputEnable)(BOOL enable);
|
||||
|
@ -36,10 +37,14 @@ public:
|
|||
memset(&xInputVibration, 0, sizeof(xInputVibration));
|
||||
this->index = index;
|
||||
int i;
|
||||
for (i=0; i<16; i++) {
|
||||
for (i=0; i<14; i++) {
|
||||
// The i > 9 accounts for the 2 bit skip in button flags.
|
||||
AddPhysicalControl(PSHBTN, i + 2*(i > 9), 0);
|
||||
}
|
||||
for (i=14; i<16; i++) {
|
||||
// The i > 9 accounts for the 2 bit skip in button flags.
|
||||
AddPhysicalControl(PRESSURE_BTN, i + 2*(i > 9), 0);
|
||||
}
|
||||
for (; i<20; i++) {
|
||||
AddPhysicalControl(ABSAXIS, i + 2, 0);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,10 @@
|
|||
#define IDC_DPAD 0x1008
|
||||
#define IDC_LSTICK 0x1009
|
||||
#define IDC_RSTICK 0x100A
|
||||
#define IDC_SLIDER_DEADZONE 0x1010
|
||||
#define IDC_AXIS_DEADZONE 0x1014
|
||||
#define IDC_LABEL_SENSITIVITY 0x1020
|
||||
#define IDC_LABEL_DEADZONE 0x1021
|
||||
#define ID_LOCK_BUTTONS 0x10FC
|
||||
#define ID_LOCK 0x10FD
|
||||
#define ID_LOCK_DIRECTION 0x10FE
|
||||
|
|
Loading…
Reference in New Issue