Move common code to joypad_connection.c - will still need
iOS/OSX build fixes