Using LightGun with RetroArch

I recently bought 2 lightgun that i want to make working with retroarch. I see not option to configure it (trigger button, etc…) although there is some device id named “Generic Lightgun” or “Mouse” (even mouse should be ok as lightguns emulate mouse).

Someone knows how to make it works with mame and other emulators ?

It varies from core to core. I don’t know how to make it work with MAME, but with most cores, you go into settings > input settings and set the P2 device type to zapper or superscope or whatever.

Thanks for tour answer. I tried to configure the way you sais, but there is no device type name zapper or anything else except joypad w/ or w/out analog. I tried with mame, and some nes cores as nestopia. This setting should be core dependant ?

Yeah, it’s core-by-core. For Nestopia, you need to have the NstDatabase.xml in your ‘system’ directory so it knows which games need a zapper. You can get that database here (it’s part of Nestopia’s source code): https://raw.githubusercontent.com/rdanbrook/nestopia/master/NstDatabase.xml

Ok so i’ll try it with nestopia. But is there also the same kind of database file for mame or any other core to put in system folder ? Cause i really wondering why the “mouse” or “lightgun” option doesn"t appear in device type for p1, p2 and so on.

Snes9x and bsnes both support it through the device type, as does Genesis Plus GX. Nestopia will enable it automatically with the help of the database. I’m not sure if FBA and/or MAMEs have it even hooked up. I’ll have to look into that.

EDIT: looks like FBA has gun controls hooked up, but there’s a FIXME that mentions that they don’t work right…

I tried to load the Snes9x Core and bsnes but anyone is able to configure something else than retropad and retropad w/ analog. Do i do something wrong to not make it appears in the input menu ?

You have to load some content first (it doesn’t necessarily need to be a game that requires a light gun).