diff --git a/src/drivers/win/joystick.cpp b/src/drivers/win/joystick.cpp index 88d5e849..23dd1039 100644 --- a/src/drivers/win/joystick.cpp +++ b/src/drivers/win/joystick.cpp @@ -191,79 +191,6 @@ int DTestButtonJoy(ButtConfig *bc) return(0); } -// Ugetab: I can't test this. It may be inefficient, or even ineffective -int DTestButtonJoyImmediate(ButtConfig *bc) -{ - uint32 x; //mbg merge 7/17/06 changed to uint - - for(x=0;xNumC;x++) - { - HRESULT dival; - int n = bc->DeviceNum[x]; - - if(n == 0xFF) - continue; - - if(bc->ButtType[x] != BUTTC_JOYSTICK) continue; - if(n >= numjoysticks) continue; - - while((dival = IDirectInputDevice7_Poll(Joysticks[n])) != DI_OK) - { - if(dival == DI_NOEFFECT) break; - - if(!JoyAutoRestore(dival,Joysticks[n])) - { - return(0); - } - } - - IDirectInputDevice7_GetDeviceState(Joysticks[n],sizeof(DIJOYSTATE2),&StatusSaveImmediate[n]); - HavePolled[n] = 1; - - - if(bc->ButtonNum[x]&0x8000) /* Axis "button" */ - { - int sa = bc->ButtonNum[x]&3; - long source; - - if(sa == 0) source=((int64)StatusSaveImmediate[n].lX - ranges[n].MinX) * 262144 / - (ranges[n].MaxX - ranges[n].MinX) - 131072; - else if(sa == 1) source=((int64)StatusSaveImmediate[n].lY - ranges[n].MinY) * 262144 / - (ranges[n].MaxY - ranges[n].MinY) - 131072; - else if(sa == 2) source=((int64)StatusSaveImmediate[n].lZ - ranges[n].MinZ) * 262144 / - (ranges[n].MaxZ - ranges[n].MinZ) - 131072; - - /* Now, source is of the range -131072 to 131071. Good enough. */ - if(bc->ButtonNum[x] & 0x4000) - { - if(source <= (0 - 262144/4)) - return(1); - } - else - { - if(source >= (262144/4)) - return(1); - } - } - else if(bc->ButtonNum[x]&0x2000) /* Hat "button" */ - { - int wpov = StatusSaveImmediate[n].rgdwPOV[(bc->ButtonNum[x] >> 4) &3]; - int tpov = bc->ButtonNum[x] & 3; - - if(POVFix(wpov, 0) == tpov || POVFix(wpov, 1) == tpov) - return(1); - } - else /* Normal button */ - { - if(StatusSaveImmediate[n].rgbButtons[bc->ButtonNum[x] & 127]&0x80) - return(1); - } - - } - - return(0); -} - static int canax[MAX_JOYSTICKS][3]; /* Now the fun configuration test begins. */ diff --git a/src/drivers/win/joystick.h b/src/drivers/win/joystick.h index 5a0ac14a..4b524c8e 100644 --- a/src/drivers/win/joystick.h +++ b/src/drivers/win/joystick.h @@ -17,7 +17,6 @@ void JoyClearBC(ButtConfig *bc); void UpdateJoysticks(void); int DTestButtonJoy(ButtConfig *bc); -int DTestButtonJoyImmediate(ButtConfig *bc); #define JOYBACKACCESS_OLDSTYLE 1 #define JOYBACKACCESS_TASEDIT 2 diff --git a/src/drivers/win/keyboard.cpp b/src/drivers/win/keyboard.cpp index 1a0d1d49..9938f297 100644 --- a/src/drivers/win/keyboard.cpp +++ b/src/drivers/win/keyboard.cpp @@ -58,14 +58,14 @@ int DTestButtonImmediate(ButtConfig *bc) } } } - if(DTestButtonJoyImmediate(bc)) return(1); // Needs joystick.h + if(DTestButtonJoy(bc)) return(1); // Needs joystick.h. Tested with PPJoy mapped with Print Screen return(0); } uint32 GetGamepadPressedImmediate() { // Get selected joypad buttons, ignoring NES polling - // Basically checks for immediate joypad input. + // Basically checks for immediate gamepad input. extern ButtConfig GamePadConfig[4][10]; extern int allowUDLR;