HID compliant USB driver

[QUOTE=barnard;36830]I think I’m in the same boat as consolero. I get the general idea but seem to be able to follow the .c and .h files and work out what I’m supposed to change.

I found out the PID and VISD, converted them to decimal but then got lost trying to link them up with a ’ connect_ps3.c ’ type file.

A properly labeled code page with labels would be a god send.

‘’{ “Nintendo RVL-CNT-01”, 1406, 816, &pad_connection_wii }, { “Nintendo RVL-CNT-01-UC”, 1406, 816, &pad_connection_wiiupro }, { “Wireless Controller”, 1356, 1476, &pad_connection_ps4 }, { “Cthulhu PC/PS3 Controller”, 5336, 55560, &pad_connection_ps3 }, { “PLAYSTATION®3 Controller”, 787, 8406, &pad_connection_ps3 }, { “Generic SNES USB Controller”, 2079, 58369, &pad_connection_snesusb },’’’’

Was about as far as i could get, from what i could read the ‘&pad_connection_ps3’ was supposed to link to a one of the ’ connect_ps3.c ’ profiles via the the HID pads name, PID and VID.

I’ve attached a screen shot from the Wii HID diagnostic program. VID:14D8 PID:D908

Did I at least get the hex to decimal conversion right? :stuck_out_tongue_winking_eye:

Thanks again guys!

my pad is the cthululu[/QUOTE]

Indeed it looks very similar to a PS3 controller but you may need to test the Ps3 in the same tool and see if the values pressed matches. If so, then the connect_ps3.c may work, however you will need to change the name in the list above to match the “PLAYSTATION®3 Controller” because otherwise you wil need to modify the connect_ps3.c driver so it can handle both, or maybe create and additional one (but with the hardocoded name inside changed to math yours.

But for the sake of testing and see if this works you may want to leave it as “PLAYSTATION®3 Controller” as I mentioned. Additionally you need to create the autoconfig file matching the new VID/PID, a modified version of the one for the P3 may work fine (just changing its VID/PID) values.

I will write add a PS2 adapter driver thisd weekend, so if you want to add it from scratch you will be able to see all changes needed at once.

netux79 eu sonho ainda com o retroarch suportando diversos controles e mais de um player via usb, pela própria interface dele, pois é uma forma de usar controle usb em praticamente todos os emuladores do wii, e quem sabe suportando controle usb de snes nes torne a experiencia de usar estes emuladores melhor pois se encontra genérico destes controles bem barato, seria possível em um futuro o retroarch rodar jogos de wii pois jogar com remote é horrível, amo jogar com controle ps3.

I still dream with retroarch supporting various controls and more than one player via USB pel own it interface, it is a way to use USB control in virtually all emulators Wii, and perhaps supporting USB control snes nes become by experience of use these best emulators for is generic and cheap these controls, it would be possible in the future the retroarch run wii games as playing with remote is horrible, I love to play with control ps3…

[QUOTE=netux79;36843] I will write add a PS2 adapter driver thisd weekend, so if you want to add it from scratch you will be able to see all changes needed at once.[/QUOTE] Thanks, don’t want to push anybody, but any updates on that?

Yes, here it is what I did to add a PS2 adapter to RA Wii, just follow the changes and you will be able to create one for your own controllers:

Also I created its corresponding autonconfig file:

@Spielvan: I added the controller as you asked for it… I also tested with 2 controllers of the same and it was working fine for me, I cannot replicate the issue with two Ps3 controllers at the same time as I only own 1 so I’m not sure about the issue you mentioned for player 2… try it again being sure you set autoconfig automatically on each controller within the settings.

[QUOTE=netux79;37389]Yes, here it is what I did to add a PS2 adapter to RA Wii, just follow the changes and you will be able to create one for your own controllers:

Also I created its corresponding autonconfig file:

[/QUOTE] Thanks for sharing, there are a few lines in the input/connect/connect_ps2adapter.c code which aren’t clear to me though:

  1. Lines 70-94 are for the analogue stick right? Can I skip this part if the pad doesn’t support a stick (also lines 139-143 I assume)?
  2. Line 134:
 for (i = 0; i < 16; i ++)

is different to

for (i = 0; i < 17; i ++)

in the input/connect/[B]connect_snesusb.c. What does it mean and does it have to be changed?

[/B]Thanks!

Yes you can skip it, just make the function to return 0 (zero).

That lines are different because each controller support different number of buttons. This number needs to match the button definition (button_mapping array) and it iterates thru the list to to setup the status of each button in the main buttons bit variable (device->buttons)

hope that’s helps.

NOTE: the line 125-126, are specific of that controller because the data contains the info of both controllers (player 1 and 2) and we just need the player 1 information. That’s may not be the case with the controller you are looking to add.

[QUOTE=netux79;37389]Yes, here it is what I did to add a PS2 adapter to RA Wii, just follow the changes and you will be able to create one for your own controllers:

Also I created its corresponding autonconfig file:

@Spielvan: I added the controller as you asked for it… I also tested with 2 controllers of the same and it was working fine for me, I cannot replicate the issue with two Ps3 controllers at the same time as I only own 1 so I’m not sure about the issue you mentioned for player 2… try it again being sure you set autoconfig automatically on each controller within the settings.[/QUOTE]

Obrigado meu querido, eu testei com um controle ps2 usb que tenho aqui e não funcionou, não estou com o meu adaptador de 2 controles ps2 na minha casa, mas já passei para o pessoal do blog testar e postar os resultados, quem sabe em um futuro o retroarch não venha com estes recursos embutidos nele, eu adorei a ideia do remote desligar quando liga o HID isto economiza a pilha do remote.

Thank you my dear, I tested with a ps2 control usb I have here and it did not work, I’m with my 2 controls ps2 adapter in my house, but I went to the blog personal test and post the results, perhaps in a the future retroarch not come with these features embedded in it, I loved the idea of remote off when you connect the HID this saves the remote stack.

[QUOTE=Spielvan;37729]Obrigado meu querido, eu testei com um controle ps2 usb que tenho aqui e não funcionou, não estou com o meu adaptador de 2 controles ps2 na minha casa, mas já passei para o pessoal do blog testar e postar os resultados, quem sabe em um futuro o retroarch não venha com estes recursos embutidos nele, eu adorei a ideia do remote desligar quando liga o HID isto economiza a pilha do remote.

Thank you my dear, I tested with a ps2 control usb I have here and it did not work, I’m with my 2 controls ps2 adapter in my house, but I went to the blog personal test and post the results, perhaps in a the future retroarch not come with these features embedded in it, I loved the idea of remote off when you connect the HID this saves the remote stack.[/QUOTE]

Maybe your PS2 controller adapter is different brand… could you please provide the name and VID/PID of the controller… so I can tell you why it may nto be working… also please ensure to put the autoconfig file for it which I also posted in the 2nd link above…

Eu estou usando o mesmo controle ps2 genérico usb com o nintendont e funciona normalmente é uma destas duas configurações.

I’m using the same generic usb ps2 control with nintendont works and is usually one of two settings.

[TABLE=“class: highlight tab-size js-file-line-container”]

[Generic USB Gamepad]

#ANALOG MODE must be enabled for on the controller for it to work.

This controller.ini was made for a cheap GTC Ribbon controller but it was confirmed that it also works

with a SF-1801V PC controller and a Acteck 3600; so it should be safe to assume that there are more controllers that might

work with this .ini, try it if you have a cheap USB gamepad that looks like these.

#######

GTC Ribbon (http://arg.gtcribbon.com/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/g/a/gamepad-pc-dual-shock_JPG-165U_large.png)

SF - 1801V(http://www.callegranvia.com/images/product/53/be94de6c45b1fe8d216d00ae530499d7.jpg)

#######

VID=0079

PID=0006

Polltype=1

DPAD=1

DigitalLR=1

A=5,40

B=5,80

X=5,20

Y=5,10

Z=6,08

L=6,01

R=6,02

S=6,20

Power=6,10

Left=5,06

Down=5,04

Right=5,02

Up=5,00

RightUp=5,01

DownRight=5,03

DownLeft=5,05

UpLeft=5,07

StickX=0

StickY=1

CStickX=3

CStickY=4

RAnalog=0

LAnalog=0

Rumble=1

RumbleType=1

RumbleDataLen=0E

RumbleDataOn=51,00,00,00,FF,00,00,FA,FE,00,00,00,00,00

RumbleDataOff=51,00,00,00,00,00,00,FA,FE,00,00,00,00,00

RumbleTransferLen=07

RumbleTransfers=2

[/TABLE]

[TABLE=“class: highlight tab-size js-file-line-container”]

[PS2 Controller]

VID=0810

PID=0001

Polltype=1

DPAD=1

DigitalLR=1

MultiIn=1

MultiInValue=01

Power=6,10

A=5,20

B=5,40

X=5,10

Y=5,80

Z=6,08

L=6,01

R=6,02

S=6,20

Left=5,06

Down=5,04

Right=5,02

Up=5,00

RightUp=5,01

DownRight=5,03

DownLeft=5,05

UpLeft=5,07

StickX=3,1A,100

StickY=4,1A,100

CStickX=2,1A,100

CStickY=1,1A,100

LAnalog=0

RAnalog=0

Rumble=1

RumbleType=0

RumbleDataLen=05

RumbleDataOn=01,00,00,7F,7F

RumbleDataOff=01,00,00,00,00

RumbleTransferLen=05

RumbleTransfers=1

[/TABLE]

[QUOTE=Spielvan;37782]Eu estou usando o mesmo controle ps2 genérico usb com o nintendont e funciona normalmente é uma destas duas configurações.

I’m using the same generic usb ps2 control with nintendont works and is usually one of two settings.

[TABLE=“class: highlight tab-size js-file-line-container”]

[Generic USB Gamepad]

#ANALOG MODE must be enabled for on the controller for it to work.

This controller.ini was made for a cheap GTC Ribbon controller but it was confirmed that it also works

with a SF-1801V PC controller and a Acteck 3600; so it should be safe to assume that there are more controllers that might

work with this .ini, try it if you have a cheap USB gamepad that looks like these.

#######

GTC Ribbon (http://arg.gtcribbon.com/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/g/a/gamepad-pc-dual-shock_JPG-165U_large.png)

SF - 1801V(http://www.callegranvia.com/images/product/53/be94de6c45b1fe8d216d00ae530499d7.jpg)

#######

VID=0079

PID=0006

Polltype=1

DPAD=1

DigitalLR=1

A=5,40

B=5,80

X=5,20

Y=5,10

Z=6,08

L=6,01

R=6,02

S=6,20

Power=6,10

Left=5,06

Down=5,04

Right=5,02

Up=5,00

RightUp=5,01

DownRight=5,03

DownLeft=5,05

UpLeft=5,07

StickX=0

StickY=1

CStickX=3

CStickY=4

RAnalog=0

LAnalog=0

Rumble=1

RumbleType=1

RumbleDataLen=0E

RumbleDataOn=51,00,00,00,FF,00,00,FA,FE,00,00,00,00,00

RumbleDataOff=51,00,00,00,00,00,00,FA,FE,00,00,00,00,00

RumbleTransferLen=07

RumbleTransfers=2

[/TABLE]

[TABLE=“class: highlight tab-size js-file-line-container”]

[PS2 Controller]

VID=0810

PID=0001

Polltype=1

DPAD=1

DigitalLR=1

MultiIn=1

MultiInValue=01

Power=6,10

A=5,20

B=5,40

X=5,10

Y=5,80

Z=6,08

L=6,01

R=6,02

S=6,20

Left=5,06

Down=5,04

Right=5,02

Up=5,00

RightUp=5,01

DownRight=5,03

DownLeft=5,05

UpLeft=5,07

StickX=3,1A,100

StickY=4,1A,100

CStickX=2,1A,100

CStickY=1,1A,100

LAnalog=0

RAnalog=0

Rumble=1

RumbleType=0

RumbleDataLen=05

RumbleDataOn=01,00,00,7F,7F

RumbleDataOff=01,00,00,00,00

RumbleTransferLen=05

RumbleTransfers=1

[/TABLE][/QUOTE]

Yeah, the second configuration you are showing as ps2 controller is the one that should work… it has the same PID/VID configuration that the one I created for RA so it should work… Is your adapter having 2 slots for 2 Ps2 controllers in one USB port? If so then try switching the controller from one slot to the other… just ONE will work not both.

[QUOTE=netux79;36316]@barnand: I already explained it before but I’m pasting the steps here too. The Ps3 controller is already supported so you just need to configure it:

  1. download the autonconfig files for HID controllers from the assets download section.
  2. Put them in a autoconfig/hid within the retroarch app folder (the one that contains all the cores)
  3. start retroarch normally and get into the drivers menu and change joystick driver to “hid”
  4. restart retroarch and connect the controller in any usb port.
  5. it should detect it, configure it and allow to use it.[/QUOTE]

I’m using a real Wii not a Wii U. I downloaded the latest build for Wii. I downloaded the autoconfig.zip from here, http://buildbot.libretro.com/assets/frontend/. I added the files to my SD card. I put them in \apps\Retroarch\autoconfig\hid as stated in this thread. I changed the joypad driver to hid, I restart retroarch, connect the PS3 controller, the light on the controller comes on, but the buttons don’t do anything, I am unable to navigate the menu. I have verified that the VID\PID are correct. Am I doing something wrong? I tried a PS2 adapter with matching VID\PID and that doesn’t do anything either.

Olá precisa deixar desta forma \apps\Retroarch\hid , para funcionar.

Hello need to leave this way \ apps \ Retroarch \ hid to work.

[QUOTE=Spielvan;38307]Olá precisa deixar desta forma \apps\Retroarch\hid , para funcionar.

Hello need to leave this way \ apps \ Retroarch \ hid to work.[/QUOTE]

My goodness! Thank YOU! I have been banging my head on the wall for the last two nights.

Or change the directory within Retroarch’s options to apps\Retroarch\autoconfig (or whatever directory you put the config files) to work… I think I miss to mention that in the steps :slight_smile:

Hey guys, first time posting here:

my ultimate goal is to get the iBuffalo SNES pads working in Retroarch. I was planning on modifying the Generic SNES Pad driver with the suitable PID and mapping. I have so far successfully setup a toolchain in Windows, built the SNES9x-Next core and Retroarch 1.3.4 afterwards. The emulator works with the wiimote and somethat with my third party classic controller (I know there’s issues with these).

Now I wanted to try my Original Dualshocks. I switched the Joystick driver to “HID”, restarted Retroarch and plugged in the controller. The LED turns from blinking to “1”, but I cannot move in the menus :frowning: I have set Use Autoconfig to ON and, to my knowledge, I have included the autoconfig files when building the Emulator ( is this the right path? \retroarch\media\autoconfig\hid ).

I am stuck here. Please please advise, I feel like I have almost reached my goal.

EDIT: Just saw the discussio a few posts up! So I have to put the Autoconfig files onto my SD card?! I’ll try that now!

YES, it works! ll, I made it all the way here without making an account and on the final steps I got too impatient. oh well, I’m sure that more questions arise, once I tackle the iBuffalo controller.

THANKS for all the great information guys!!!

Que bom que funcionou, qualquer duvida só perguntar que faremos o possível para ajudar.

Glad it worked out, any doubt just ask that we do our best to help.

[QUOTE=SuperSpongo;38316]Hey guys, first time posting here:

my ultimate goal is to get the iBuffalo SNES pads working in Retroarch. I was planning on modifying the Generic SNES Pad driver with the suitable PID and mapping. I have so far successfully setup a toolchain in Windows, built the SNES9x-Next core and Retroarch 1.3.4 afterwards. The emulator works with the wiimote and somethat with my third party classic controller (I know there’s issues with these).

Now I wanted to try my Original Dualshocks. I switched the Joystick driver to “HID”, restarted Retroarch and plugged in the controller. The LED turns from blinking to “1”, but I cannot move in the menus :frowning: I have set Use Autoconfig to ON and, to my knowledge, I have included the autoconfig files when building the Emulator ( is this the right path? \retroarch\media\autoconfig\hid ).

I am stuck here. Please please advise, I feel like I have almost reached my goal.

EDIT: Just saw the discussio a few posts up! So I have to put the Autoconfig files onto my SD card?! I’ll try that now!

YES, it works! ll, I made it all the way here without making an account and on the final steps I got too impatient. oh well, I’m sure that more questions arise, once I tackle the iBuffalo controller.

THANKS for all the great information guys!!![/QUOTE]

Qual a versão de retroarch que esta usando pc (windows), nintendo wii etc… pois varia muito de cada versão, eu utilizo no nintendo wii e as dicas deste poste aqui foram baseadas para versão do nintendo wii, e eu percebi que comentastes que esta usando no windows então vai ter diferença do que foi postado aqui.

What retroarch version you are using PC (windows), nintendo wii etc … it varies greatly in each version, I use the Nintendo Wii and the tips in this post were based here for the Nintendo Wii version, and I realized that comentastes that is using the windows will then be different from what was posted here.

[QUOTE=Spielvan;38331]Qual a versão de retroarch que esta usando pc (windows), nintendo wii etc… pois varia muito de cada versão, eu utilizo no nintendo wii e as dicas deste poste aqui foram baseadas para versão do nintendo wii, e eu percebi que comentastes que esta usando no windows então vai ter diferença do que foi postado aqui.

What retroarch version you are using PC (windows), nintendo wii etc … it varies greatly in each version, I use the Nintendo Wii and the tips in this post were based here for the Nintendo Wii version, and I realized that comentastes that is using the windows will then be different from what was posted here.[/QUOTE]

Yes, I am also using the Wii version, no misunderstanding there. I got a bit further with my analysis. Thanks to the HIDTestv4 tool, I was able to identify where in the data array my axes and buttons are located. I was not sure how the array positions were determined so I compared the Dualshock 3 data array and the HIDTestv4 diagnosis data of that controller. I modified the connect_snesusb.c aswell as the generic_snes_usb_controller.cfg to fit my data array. Next up, I have to recompile and test. If it works, I might try to push the iBuffalo driver.

EDIT: I was not successful :frowning: At first, I forgot to also edit the file “joypad_connection.c” but after doing so, it still did not work. Can I post what I have modified so far? Maybe Nexus79 can help with this…

My gamepad sends 8 Bytes of data

80 80 00 00 00 00 00 00

The first Byte is the X-Axis, the second one the Y-Axis. The third byte are all buttons. Bit one to eight are (A, B, X, Y, L, R, Select, Start). It also has two buttons on the third byte, 0x10 and 0x20 (CLEAR Button, I want to use this one as MENU).

PID is: 8288 dec VID is: 1411 dec

I modified the “connect_snesusb.c” so that I don’t have to the griffin.c yet. My connect_snesusb.c looks like this:

 /*  RetroArch - A frontend for libretro. *  Copyright (C) 2013-2014 - Jason Fetters
 *  Copyright (C) 2011-2016 - Daniel De Matteis
 *
 *  RetroArch is free software: you can redistribute it and/or modify it under the terms
 *  of the GNU General Public License as published by the Free Software Found-
 *  ation, either version 3 of the License, or (at your option) any later version.
 *
 *  RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 *  PURPOSE.  See the GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with RetroArch.
 *  If not, see <http://www.gnu.org/licenses/>.
 */


#include <stdint.h>
#include <string.h>
#include <stdlib.h>


#include <boolean.h>
#include "joypad_connection.h"


#include "../input_defines.h"


struct hidpad_snesusb_data
{
   struct pad_connection* connection;
   uint8_t data[64];
   uint32_t slot;
   uint64_t buttons;
};


static void* hidpad_snesusb_init(void *data, uint32_t slot, send_control_t ptr)
{
   struct pad_connection* connection = (struct pad_connection*)data;
   struct hidpad_snesusb_data* device    = (struct hidpad_snesusb_data*)
      calloc(1, sizeof(struct hidpad_snesusb_data));


   if (!device)
      return NULL;


   if (!connection)
   {
      free(device);
      return NULL;
   }


   device->connection   = connection;
   device->slot         = slot;


   return device;
}


static void hidpad_snesusb_deinit(void *data)
{
   struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;


   if (device)
      free(device);
}


static uint64_t hidpad_snesusb_get_buttons(void *data)
{
   struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;
   if (!device)
      return 0;
   return device->buttons;
}


static int16_t hidpad_snesusb_get_axis(void *data, unsigned axis)
{
   int val;
   struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;


   if (!device || axis >= 2)
      return 0;


   [B]val = device->data[0 + axis];[/B]       // Unter Umständen sind hier hier Achsen vertauscht!!
   val = (val << 8) - 0x8000;


   return (abs(val) > 0x1000) ? val : 0; // Unter Umständen ist hier die Richtung vertauscht!!
}


static void hidpad_snesusb_packet_handler(void *data, uint8_t *packet, uint16_t size)
{
   uint32_t i, pressed_keys;
   static const uint32_t button_mapping[17] =
   {
      // RETRO_DEVICE_ID_JOYPAD_L,
      // RETRO_DEVICE_ID_JOYPAD_R,
      // NO_BTN,
      // NO_BTN,
      // RETRO_DEVICE_ID_JOYPAD_SELECT,
      // RETRO_DEVICE_ID_JOYPAD_START,
      // NO_BTN,
      // NO_BTN,
      // NO_BTN,
      // NO_BTN,
      // NO_BTN,
      // NO_BTN,
      // RETRO_DEVICE_ID_JOYPAD_X,
      // RETRO_DEVICE_ID_JOYPAD_A,
      // RETRO_DEVICE_ID_JOYPAD_B,
      // RETRO_DEVICE_ID_JOYPAD_Y,
      // 16, /* HOME BUTTON when pressing SELECT+START */
     [B] RETRO_DEVICE_ID_JOYPAD_A,
      RETRO_DEVICE_ID_JOYPAD_B,
      RETRO_DEVICE_ID_JOYPAD_X,
      RETRO_DEVICE_ID_JOYPAD_Y,
      RETRO_DEVICE_ID_JOYPAD_L,
      RETRO_DEVICE_ID_JOYPAD_R,
      RETRO_DEVICE_ID_JOYPAD_SELECT,
      RETRO_DEVICE_ID_JOYPAD_START,
      NO_BTN,
      NO_BTN,
      NO_BTN,
      NO_BTN,
      NO_BTN,
      NO_BTN,
      NO_BTN,
      NO_BTN,
      16 /* HOME BUTTON when pressing CLEAR Button */ [/B]
   };
   struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;


   if (!device)
      return;


   memcpy(device->data, packet, size);


   device->buttons = 0;


  [B] pressed_keys  = device->data[2] |
                (((device->data[3] & 0x20) == 0x20) ? (1 << 16) : 0);  /* CLEAR-BUTTON = MENU TOGGLE */[/B]


   for (i = 0; i < 17; i ++)
      if (button_mapping[i] != NO_BTN)
         device->buttons |= (pressed_keys & (1 << i)) ? (UINT64_C(1) << button_mapping[i]) : 0;
}


static void hidpad_snesusb_set_rumble(void *data,
      enum retro_rumble_effect effect, uint16_t strength)
{
    (void)data;
    (void)effect;
   (void)strength;
}


const char * hidpad_snesusb_get_name(void *data)
{
    (void)data;
    /* For now we return a single static name */
    return[B] "iBuffalo [/B]SNES USB Controller";
}


pad_connection_interface_t pad_connection_snesusb = {
   hidpad_snesusb_init,
   hidpad_snesusb_deinit,
   hidpad_snesusb_packet_handler,
   hidpad_snesusb_set_rumble,
   hidpad_snesusb_get_buttons,
   hidpad_snesusb_get_axis,
   hidpad_snesusb_get_name,
}; 

So as you can see, I edited the following

  • “hidpad_snesusb_get_axis” because my axes data is in Data[0] and data[1]
  • “hidpad_snesusb_packet_handler” because my buttons are in a different order
  • variable “pressed_keys” because, again, the key data is in different placed of the data array
  • “hidpad_snesusb_get_name” to return “iBuffalo” instead of “Generic” in the name

My cfg looks as follows:

 
input_device = "iBuffalo SNES USB Controller"
input_driver = "hid"
input_vendor_id = 1411
input_product_id = 8288
input_b_btn = "1"
input_y_btn = "3"
input_select_btn = "6"
input_start_btn = "7"
input_a_btn = "0"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_menu_toggle_btn = "16"


input_b_btn_label = "B"
input_y_btn_label = "Y"
input_select_btn_label = "Select"
input_start_btn_label = "Start"
input_a_btn_label = "A"
input_x_btn_label = "X"
input_l_btn_label = "L"
input_r_btn_label = "R"
input_l_x_plus_axis_label = "D Pad Right"
input_l_x_minus_axis_label = "D Pad Left"
input_l_y_plus_axis_label = "D Pad Down"
input_l_y_minus_axis_label = "D Pad Up"
input_menu_toggle_btn_label = "CLEAR"


I renamed the Controller and switched the input numbers around. It does not work. The controller does not even get recognized upon plugging in. What am I missing here??

EDIT:

Oh, my joypad_connection.c looks as follows:

 pad_connection_pad_init(joypad_connection_t *joyconn,   const char* name, uint16_t vid, uint16_t pid,
   void *data, send_control_t ptr)
{
   static const struct
   {
      const char* name;
      uint16_t vid;
      uint16_t pid;
      pad_connection_interface_t *iface;
   } pad_map[] =
   {
      { "Nintendo RVL-CNT-01",          1406,  816,    &pad_connection_wii },
      { "Nintendo RVL-CNT-01-UC",       1406,  816,    &pad_connection_wiiupro },
      { "Wireless Controller",          1356,  1476,   &pad_connection_ps4 },
      { "PLAYSTATION(R)3 Controller",   1356,  616,    &pad_connection_ps3 },
      { "PLAYSTATION(R)3 Controller",   787,   8406,   &pad_connection_ps3 },
[B]      { "iBuffalo SNES USB Controller", 1411,  8288,   &pad_connection_snesusb },[/B]
      { "Generic NES USB Controller",   121,   17,     &pad_connection_nesusb },
      { "Wii U GC Controller Adapter",  1406,  823,    &pad_connection_wiiugca },
      { "PS2/PSX Controller Adapter",   2064,  1,      &pad_connection_ps2adapter },
      { 0, 0}
   };
   joypad_connection_t *s = NULL;
   int                pad = pad_connection_find_vacant_pad(joyconn);


   if (pad == -1)
      return -1;


   s = &joyconn[pad];


   if (s)
   {
      unsigned i;


      for (i = 0; name && pad_map[i].name; i++)
      {
         const char *name_match = strstr(pad_map[i].name, name);


         /* Never change, Nintendo. */
         if(pad_map[i].vid == 1406 && pad_map[i].pid == 816)  
         {
            if(!string_is_equal(pad_map[i].name, name))
               continue;
         }


         if (name_match || (pad_map[i].vid == vid && pad_map[i].pid == pid))
         {
            s->iface      = pad_map[i].iface;
            s->data       = s->iface->init(data, pad, ptr);
            s->connected  = true;
            break;
         }
      }
   }


   return pad;
}
 

[QUOTE=SuperSpongo;38333]Yes, I am also using the Wii version, no misunderstanding there. I got a bit further with my analysis. Thanks to the HIDTestv4 tool, I was able to identify where in the data array my axes and buttons are located. I was not sure how the array positions were determined so I compared the Dualshock 3 data array and the HIDTestv4 diagnosis data of that controller. I modified the connect_snesusb.c aswell as the generic_snes_usb_controller.cfg to fit my data array. Next up, I have to recompile and test. If it works, I might try to push the iBuffalo driver.

EDIT: I was not successful :frowning: At first, I forgot to also edit the file “joypad_connection.c” but after doing so, it still did not work. Can I post what I have modified so far? Maybe Nexus79 can help with this… [/QUOTE]

Posta sim todo avanço é importante para quem sabe um dia possamos usar até adaptador para 2 controles usb no retroarch, e quem sabe um controle de snes ou mega drive usb com ele.

Posta yes every advance is important to perhaps one day we can use up to 2 USB adapter controls in retroarch, and maybe a snes control or mega usb drive with him.