guncon2 icon indicating copy to clipboard operation
guncon2 copied to clipboard

[Contribution] Add more guns

Open sanguino opened this issue 2 years ago • 3 comments

Hi, I have a gun that works well in pc, but I want to use your drivers in rpi. I think it works equal as guncon2, but because of vendor and product ids, it is not being detected by your drivers.

I will try to compile changing these values, but, how do you think about using a config file to set these values? Or using an array of vendor-poduct ids tuplas?

I'm not used to C language, but I think adding my devices ids to guncon2_table should work, isn't it?

Something like that:

static const struct usb_device_id guncon2_table[] = {
        {USB_DEVICE(NAMCO_VENDOR_ID, GUNCON2_PRODUCT_ID)},
        {USB_DEVICE(MY_VENDOR_ID, MY_PRODUCT_ID)},
        {}};

Cheers

sanguino avatar Apr 25 '22 07:04 sanguino

If the Prod/Vendor Ids are not the same is because in not a GCon2 compatible gun, so even if you add the proper Ids to the struct, the information expected by the driver (button bytes) won't match.

rtomasa avatar Apr 25 '22 09:04 rtomasa

I can use it in my pc, as a joystick, the buttons works fine, but I don't know how the position is sent/read.

So, if i want to do it, I should debug it and change that bytes? Is there a way to debug the data sent by the gun?

I will try to investigate more about this.

Thanks!

sanguino avatar Apr 25 '22 17:04 sanguino

If it works as a joystick on linux, it should just work as a gun input without any driver. For example, with a suitable adapter the Xbox Light gun will work in retroarch with the standard xbox controller kernel module.

beardypig avatar May 13 '22 14:05 beardypig