Beispiel #1
0
static void xdk_joypad_autodetect_add(unsigned autoconf_pad)
{
   autoconfig_params_t params = {{0}};
   settings_t *settings       = config_get_ptr();

   strlcpy(settings->input.device_names[autoconf_pad],
         "XInput Controller",
         sizeof(settings->input.device_names[autoconf_pad]));

   /* TODO - implement VID/PID? */
   params.idx = autoconf_pad;
   strlcpy(params.name, xdk_joypad_name(autoconf_pad), sizeof(params.name));
   strlcpy(params.driver, xdk_joypad.ident, sizeof(params.driver));
   input_autoconfigure_connect(&params);
}
Beispiel #2
0
static void xdk_joypad_autodetect_add(unsigned autoconf_pad)
{
   autoconfig_params_t params;
   settings_t *settings       = config_get_ptr();

   /* TODO - implement VID/PID? */
   params.idx             = autoconf_pad;
   params.vid             = 0;
   params.pid             = 0;
   params.display_name[0] = '\0';

   strlcpy(params.name, xdk_joypad_name(autoconf_pad), sizeof(params.name));
   strlcpy(params.driver, xdk_joypad.ident, sizeof(params.driver));
   input_autoconfigure_connect(&params);
}
static bool xdk_joypad_init(void)
{
   unsigned autoconf_pad;

#ifdef _XBOX1
   XInitDevices(0, NULL);

   dwDeviceMask = XGetDevices(XDEVICE_TYPE_GAMEPAD);

   /* Check the device status. */
   switch(XGetDeviceEnumerationStatus())
   {
      case XDEVICE_ENUMERATION_IDLE:
         RARCH_LOG("Input state status: XDEVICE_ENUMERATION_IDLE\n");
         break;
      case XDEVICE_ENUMERATION_BUSY:
         RARCH_LOG("Input state status: XDEVICE_ENUMERATION_BUSY\n");
         break;
   }

   while(XGetDeviceEnumerationStatus() == XDEVICE_ENUMERATION_BUSY) {}
#endif

   for (autoconf_pad = 0; autoconf_pad < MAX_USERS; autoconf_pad++)
   {
      strlcpy(g_settings.input.device_names[autoconf_pad],
            "XInput Controller",
            sizeof(g_settings.input.device_names[autoconf_pad]));
      
      /* TODO - implement VID/PID? */
      input_config_autoconfigure_joypad(autoconf_pad,
            xdk_joypad_name(autoconf_pad), 
            0, 0,
            xdk_joypad.ident);
   }

   return true;
}