mirror of https://github.com/snes9xgit/snes9x.git
win32: detect gamepad changes
This commit is contained in:
parent
532a76ddc0
commit
5b4df91b41
|
@ -980,6 +980,13 @@ void S9xWinScanJoypads ()
|
|||
#endif
|
||||
}
|
||||
|
||||
void S9xDetectJoypads()
|
||||
{
|
||||
for (int C = 0; C != 16; C ++)
|
||||
Joystick[C].Attached = joyGetDevCaps (JOYSTICKID1+C, &Joystick[C].Caps,
|
||||
sizeof( JOYCAPS)) == JOYERR_NOERROR;
|
||||
}
|
||||
|
||||
void InitSnes9X( void)
|
||||
{
|
||||
#ifdef DEBUGGER
|
||||
|
@ -1023,9 +1030,7 @@ void InitSnes9X( void)
|
|||
|
||||
S9xMovieInit ();
|
||||
|
||||
for (int C = 0; C != 16; C ++)
|
||||
Joystick[C].Attached = joyGetDevCaps (JOYSTICKID1+C, &Joystick[C].Caps,
|
||||
sizeof( JOYCAPS)) == JOYERR_NOERROR;
|
||||
S9xDetectJoypads();
|
||||
}
|
||||
void DeinitS9x()
|
||||
{
|
||||
|
|
|
@ -282,6 +282,8 @@ HRESULT CALLBACK EnumModesCallback( LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpCo
|
|||
|
||||
VOID CALLBACK HotkeyTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
|
||||
|
||||
void S9xDetectJoypads();
|
||||
|
||||
#define NOTKNOWN "Unknown Company "
|
||||
#define HEADER_SIZE 512
|
||||
#define INFO_LEN (0xFF - 0xC0)
|
||||
|
@ -2685,6 +2687,9 @@ LRESULT CALLBACK WinProc(
|
|||
#endif
|
||||
break;
|
||||
#endif
|
||||
case WM_DEVICECHANGE:
|
||||
S9xDetectJoypads();
|
||||
break;
|
||||
}
|
||||
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue