LilyPad: Fix for detecting devices whose instance IDs have changed (Either due to to changing OS or USB port).

Modified unplugged device behavior to match PadNull.  May work better with unplugged pads, may not.  No clue, just know the old behavior didn't work that well.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2552 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
MattMenke@gmail.com 2010-02-02 06:40:02 +00:00
parent 909a7de4f6
commit 1fd51a635e
3 changed files with 7 additions and 7 deletions

View File

@ -1709,8 +1709,8 @@ void UpdatePadList(HWND hWnd) {
item.iSubItem = 1;
if (2 < (unsigned int)config.padConfigs[port][slot].type) config.padConfigs[port][slot].type = Dualshock2Pad;
item.pszText = padTypes[config.padConfigs[port][slot].type];
if (!slot && !config.padConfigs[port][slot].type)
item.pszText = L"Unplugged (Kinda)";
//if (!slot && !config.padConfigs[port][slot].type)
// item.pszText = L"Unplugged (Kinda)";
ListView_SetItem(hWndList, &item);

View File

@ -511,7 +511,7 @@ void InputDeviceManager::CopyBindings(int numOldDevices, Device **oldDevices) {
if (!id1 || !id2) {
continue;
}
if (!wcsicmp(devices[j]->instanceID, oldDevices[i]->instanceID)) {
if (!wcsicmp(id1, id2)) {
matches[j] = i;
oldMatches[i] = j;
break;

View File

@ -385,8 +385,7 @@ void CapSum(ButtonSum *sum) {
// Counter similar to stateUpdated for each pad, except used for PADkeyEvent instead.
// Only matters when GS thread updates is disabled (Just like summed pad values
// for pads beyond the first slot). Also, it's set to 4 and decremented by 1 on each read,
// so it's less likely I'll control state on a PADkeyEvent call.
// for pads beyond the first slot).
// Values, in order, correspond to PADkeyEvent, PADupdate(0), PADupdate(1), and
// WndProc(WMA_FORCE_UPDATE). Last is always 0.
@ -1033,7 +1032,7 @@ void CALLBACK PADclose() {
u8 CALLBACK PADstartPoll(int port) {
DEBUG_NEW_SET();
port--;
if ((unsigned int)port <= 1) {
if ((unsigned int)port <= 1 && pads[port][slots[port]].enabled) {
query.queryDone = 0;
query.port = port;
query.slot = slots[port];
@ -1509,7 +1508,8 @@ s32 CALLBACK PADsetSlot(u8 port, u8 slot) {
// Even if no pad there, record the slot, as it is the active slot regardless.
slots[port] = slot;
// First slot always allowed.
return pads[port][slot].enabled | !slot;
// return pads[port][slot].enabled | !slot;
return 1;
}
// Little funkiness to handle rounding floating points to ints without the C runtime.