Please do not post a support request without first reading and following the advice in

Lightgun support added to PCSX-Rearmed

  • @BJRetro said in Lightgun support added to PCSX-Rearmed:

    EDIT- come to think of it, I think I could have had the same issue in emulation station because as I think harder, I have the plus key configured as start, minus key as select, button 1 as “a” and button 2 as “b” so it is possible I couldn’t configure the “a” button or “trigger” in emulation station either and yet I am able to use the gun to shoot. So maybe try that.

    In a game, are you saying you mapped the buttons A and B in Retroarch (hotkey+x)?

  • @allahandro hi I will look. Unsure if I had to do that.

  • @MrLightgun I’ve given your release a go with a set of Aimtrak’s. I can get as far as the Emulator registering trigger fire, as the screen flashes and responds with the in-game gun fire. In terms of any response on screen, nothing is detected, the Guncon setup screen doesn’t register any events within the designated ‘center’ crosshair. I’ve tested across Time Crisis and Point Blank.

    Player 1 and 2 input types have been set to ‘guncon’, and I’ve left mouse index to 0 on both players. If I change the index to any other number other than 0, both players fail to register gun fire.

    I’ve given lr-fceumm another go, and it is still hyper sensitive with my Aimtrak movement. With the version I have, it only provides me the option for input type as ‘mouse’ or ‘lightgun’. Mouse is the only one that registers movement and trigger fire from my Aimtrak’s, ‘lightgun’ provides no response at all, and the onscreen crosshair disappears.

    Before I installed your release, I upgraded all packages including core and EmulationStation.

    Versions are:
    FCEUMM 1.7.6 (SVN) 5e1d648
    PCSX-ReArmed 1.7.6 r22 03fc8e9
    EmulationStation v2.8.4RP
    Core 4.14.98-v7+

    Both Aimtrak’s work fine for MAME shooters.

    Let me know if there are any logs that I can supply that may assist.

  • Apologies for the dumb question: Can I use one of those regular Wii IR bars that connect to the TV through USB? Or the Bluetooth on the Dolphinbar is actually required?

  • @RetroNerdman I am not sure but from posts I have read I think the difficulty there is whether you can get your wiimotes to connect and configure properly connected to bluetooth.

  • @MrLightgun Hi there - no rush but just wanted to see if you made the changes and if so I will test.

  • Fantastic that lightgun support has been added! I use the Dolphin bar and Wiimote myself. In order to get Time Crisis almost playable I had to use these settings:

    Guncon Adjust - 15
    Guncon Adjust Y - 15
    Guncon Adjust Ratio X - 1.25
    Guncon Adjust Ratio Y - 1.25

    It's like around 80% there for me. The issue I have is the Ratio X; it's not enough to be able to reach the far left or right of the screen. If it was possible to raise it to say 1.5 or 1.75 I think it would be pretty much perfect as at the maximum 1.25 setting the gun cursor won't reach the far left or right of the screen by about an inch or two. Also the initial calibration at the start of the game can take a fair few shots just to kinda get it centered so the game is playable.

    But still, it's fab that the feature is in there now!

  • Hi Everyone

    Sorry for the slow updates and appreciate the testing. It was actually difficult to get my head round the lightgun support as so much has changed in RetroArch due to the touchscreen lightgun support.

    I found what appears to be a recent bug that would break lightgun and touchscreen support which I've managed to merge:

    Then it looks like the lightgun api only works in X11, so I've added some non-X11 code for devices like the Raspberry Pi:
    That has not been accepted yet.

    These changes when tested on my branch then fixed the lightgun api which hadn't previously been working on the Raspberry Pi from my analysis. For lightguns we were using "pointer" or "mouse" libretro interfaces. However pointer is now being used for touchscreen in the more recent versions so our lightgun support for Aimtrak and Sinden Lightgun would be broken.

    The great news is that by fixing the lightgun API assuming the merge gets accepted it has also fixed several other emulators that had lightgun support but were not working on the Raspberry Pi.

    So I've managed to get working SNES, Master System, Genesis/Megadrive, MegaCD/SegaCD AND Dreamcast. A big win!

    Dreamcast especially is going to be awesome on the Pi 4 when RetroPie is ready so this is great timing if I can get it all sorted.

    Now with lr-pcsx-rearmed I uploaded the work I had done and it is still waiting for a merge. I felt as I had done the hard bit of adding the lightgun support to the emulator, tidying up where it got the data from was not as important. I was using the pointer/touchscreen api which works with absolute coordinate devices and doing the trigger, aux A & aux B with the 3 mouse buttons using the mouse interface. So it was a bit of a hybrid. When I get the chance I can now tidy it to support the 3 standard lightgun interfaces mouse, touchscreen and pointer. This should enable the touchscreen support and the lightgun support in the right way. Mouse still won't be great because I don't have a mouse cursor option but someone with that skillset can add it in the future.

    At that point I can then work out what is going on with the Dolphin bar. Ideally I don't want to add in additional Guncon adjustments because that is not supposed to be required. So I'm going to try and fix it properly and if that fails then I can always increase the available numbers.

    Just to confirm is anyone successfully using Dolphin bar in a calibrated line of sight mode on their Pi? If so what setting do you have the bar on and what lightgun setting do you have in lr-fceumm options assuming it works on that emulator.? It might be broken due to the bugs I described at the start.


    Mr Lightgun

  • @MrLightgun wow Andy awesome that you got all of those systems working! Hope your changes get accepted; that would be a big feat to suddenly get to play lightgun games on all of those systems.

  • @MrLightgun thank you so much for this ! Finally I can play my lovely lightgun games on PC and LCD TV with Wiimote (other method was worse, I mean nuvee plugin example) , your method is the easy and best for users. I try play on Retroarch(Pcsx Rearmed) for Windows ,and it work great (also I use GlowPie for vibration + Touchmote for touchpoint in fullscreen mode). You're the best :)

    I would like a simple implementation of the lightgun to the other core Retroarch (nes, snes, megadrive, mame, dreamcast) and PCSX2 (if possible) from You.

    This my video how it work:

    Cheers from Belarus.Sorry for my bad English)

  • @MrLightgun my Dolphinbar+wiimote combo never worked with line of sight aiming last I tested on lr-fceumm. Playing duckhunt required turning on the visual crosshairs otherwise you could never hit anything.

  • @MrLightgun so I have a stupid question. Since it looks like Retroarch merged at least your change as to the other emulators(non-lr-pscx) how do we actually take advantage of that? I really have no idea what I am doing but it seems like the code change was at a high level in retroarch not specific to a certain emulator (maybe to the udev driver?) So does that mean just updating the retroarch emulators individually will not pull down the change and we have to update our retroarch to take advantage of it? Would like to try out some of the Genesis and SNES games with the wiimote to see if they work now. Thanks a bunch!!

  • Hi @Sbun fantastic, thank you for taking to the time to post a video of it working. Could you confirm which version of RetroArch you have and also what setting you have your Dolphin Bar on please? The physical switch on the bar I mean.

    In reply to the other comments, my second RetroArch fix got rejected (correctly) because I hadn't properly followed some coding standards so I have to update that before I can move forwards. That should generally fix the Lightgun implementation on the Pi which means if you get it working on one emulator it should work on them all. It will be easier to document at this stage too.

    I still have some improvements to make on lr-pcsx-rearmed too. These should add the touchscreen functionality as well as perfecting the lightgun functionality. At that point it should be easier to persuade someone to add a visual crosshair for devices that perform better with it.

    It's all a bit of a chicken and egg situation, I need everything to be sorted and it should be good going forward. I'm really hoping to get everything in place so it can make the next cut of RetroPie especially if that is a Pi 4 version. Sorry if the progress seems slow but I have to concentrate on my Kickstarter project as a priority.


    Mr Lightgun

  • @MrLightgun Thank you for all your work on this. Any development, is good development IMO.

  • @MrLightgun thank you for reply! I have no Dolphin bar, I use just USB sensor bar from AliExpress without buttons and modes, and it works great :) Retroarch version is 1.7.9 for Windows. Also for games wich use Konami Justifier gun (for those games has a patches, for using Guncon ) , I use this custom settings X;Y position (Project Horned Owl, Die Hard Trilogy ,Crypt Killer they working great):


    Other lightgun games for Guncon working fine with deafault settings.

  • Have just set this up and it appears to be working with a Wiimote and Dolphinbar. But if I put the WiiMote into my gun unit I have, the trigger button and second fire button get reversed. Is there anyway I can swap these buttons?

  • @Croccy22 said in Lightgun support added to PCSX-Rearmed:

    Have just set this up and it appears to be working with a Wiimote and Dolphinbar. But if I put the WiiMote into my gun unit I have, the trigger button and second fire button get reversed. Is there anyway I can swap these buttons?

    Not yet, it's hard-coded to the mouse buttons at the moment, when I finally get around to wiring it up to the "lightgun" api then you can assign it which ever way you like. If you are technical you can fork my repo that was linked above, look through my commits and you should see where I've assigned the action against the mouse. You can swap that around as a short term fix.

  • I realize this is largely off topic, but I was curious, @MrLightgun, if you're aware of any progress/developments on lightgun support for the Sega Master System? I grew up with this system and I've been dying to play Rescue Mission for years! I'm using a Wiimote/Dolphinbar setup and I've never gotten it to work. Do you know of any plans for lightgun support for SMS?

  • Hi

    Yes SMS/Genesis/SegaCD is sorted, just slowly getting various fixes merged in the right sequence.

    Best regards


  • @MrLightgun Fantastic news! Much thanks!

Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.