RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Lightgun support added to PCSX-Rearmed

    Scheduled Pinned Locked Moved General Discussion and Gaming
    lightgunpcsx rearmedplaystationtime crisisaimtrak
    78 Posts 27 Posters 23.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MrLightgun @allahandro
      last edited by

      @allahandro said in Lightgun support added to PCSX-Rearmed:

      @mitu said in Lightgun support added to PCSX-Rearmed:

      @allahandro said in Lightgun support added to PCSX-Rearmed:

      Duck hunt and 2 and 1, I changed the controller to lightgun and mouse, but no movement on the screen. If I hit any buttons on the wiimote, the system would freeze. Since I can only have the directional pad, 1, 2 and the home key work, I'm guessing this is what's freezing my retropie.

      There's a known bug in RetroArch when using the mouse with bezels enabled - it freezes the emulator. It's fixed in 1.7.7, but not in 1.7.6.

      Alright. I got this far where the wiimote is moving the cursor in the screen for duck hunt, but nothing in time crisis. In duck hunt though, when I press a button, it stalls the cursor but no action. No shot.

      I had to use mouse index 2 and changed the controller to zapper and light gun with no change.

      I feel like I've done this before and don't remember any of this.

      Hi @allahandro is this with a dolphin bar? what option did you have on the physical dolphin bar please?

      A 1 Reply Last reply Reply Quote 0
      • B
        BJRetro @allahandro
        last edited by

        @allahandro hi also did you configure the wiimote as a controller in emulation station? I can’t remmeber exactly but I think I configured the wiimote trigger as button a and the wiimote a button as button b or vice versa. If you didn’t that could be why the cursor is moving but not registering a button press.

        The other thing I have found in general (not necessarily specific to this issue) with the pi and my dolphin bar/wiimote is that it seems to screw up way more when I have an additional controller in instead of just the “lightgun” setup. I think it has to do with how the pi seems to randomly assign controller ids at startup. So if you have any sort of static settings assigned to what mouse index the lightgun is at they can get all screwy when you have other controllers (or even a keyboard with a built in mouse/trackball) attached at the same time as the “lightgun” setup.

        @MrLightgun yeah sorry about the confusion I don’t think you can configure the wiimote/dolphinbar to be line of sight. Aimtrak you can in theory but from vociferously reading this forum over time I see a lot of people saying it is hard or it loses calibration easily. That being said at least in time crisis you see your bullet hole so you can kind of calibrate yourself from that. Anyhow I am helping with testing not really so the wiimote works as much but so this can be all set when I get my sinden :)

        A 1 Reply Last reply Reply Quote 0
        • A
          allahandro @MrLightgun
          last edited by

          @MrLightgun Option 1.

          1 Reply Last reply Reply Quote 0
          • A
            allahandro @BJRetro
            last edited by

            @BJRetro I tried assigning buttons in emulation station but the a and b buttons wouldn't register. The wilmote also showed up as a keyboard.

            B 1 Reply Last reply Reply Quote 0
            • B
              BJRetro @allahandro
              last edited by

              @allahandro do you also have lights 1 and 4 lit up on the wiimote? If not try that mode and see if it works.

              A 1 Reply Last reply Reply Quote 0
              • A
                allahandro
                last edited by allahandro

                No just 1 and 2. I'll try this tonight. Thanks guys.

                1 Reply Last reply Reply Quote 0
                • A
                  allahandro @BJRetro
                  last edited by

                  @BJRetro I have mode 1 on the light bar and can only get 1 and 2 lights on the wiimote and 1 and 3. Can't get 1 and 4. Tried to set it up with both combination of lights and wouldn't register the A And B buttons on the wiimote. I tried changing the mode on the dolphin bar but only had emulation station crash when configuring the controller.

                  B 1 Reply Last reply Reply Quote 0
                  • B
                    BJRetro @allahandro
                    last edited by

                    @allahandro try pressing the home button on the wiimote and the left directional and see if that lights up led 1 and 4 on the wiimote. https://drive.google.com/file/d/1whlKx0I716VFFrYCUJZX_7EHYg7cbJ54/view

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      allahandro @BJRetro
                      last edited by

                      @BJRetro thank you. I have led lights 1 and 4 on the wiimote. I tried configuring the wiimote in the GUI but A and B are still not recognized.

                      B 1 Reply Last reply Reply Quote 0
                      • B
                        BJRetro @allahandro
                        last edited by BJRetro

                        @allahandro ok did you try duck hunt again anyhow and see if that works? I have a controller in one usb and the wiimote /dolphin bar in another usb

                        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.

                        A 1 Reply Last reply Reply Quote 0
                        • M
                          MrLightgun
                          last edited by

                          Hi Chaps

                          Quick update, I have good news and bad news. The recent retroarch/libretro touchscreen improvements have added snes, master system and genesis/megadrive lightgun functionality which is super awesome, however they have also introduced a few issues to the lightgun api. I need to separate what is a bug and what is a feature I don't understand. It seems like the emulators work but you can't use the functionality because the lightgun api is broken. This may of course be my setup.

                          I can't just fix it for the Sinden Lighgun but break it for every other lightgun device. I can complete my work for lr-PCSX-Rearmed first and make it support all 3 lightgun options of mouse, pointer and lightgun. So if it works in lr-fceumm it should work in pcsx-rearmed. Hopefully I can get that merged into main. I've also spotted one code issue I'm 99% certain is a bug in the retroarch lightgun api which I can raise which will hopefully get fixed quickly to improve things a little bit.

                          I then have a bigger change to the lightgun api if my analysis is correct but that's the one that will take a bit more testing to make sure I'm not breaking anything else. I'll have the version of lr-pcsx-rearmed on my git updated hopefully within the next week. I don't want to leave it too long in case the branch gets out of date. So I'll post here when I've done that.

                          Thanks for all your testing and support

                          Mr Lightgun

                          B 1 Reply Last reply Reply Quote 2
                          • B
                            BJRetro @MrLightgun
                            last edited by

                            @MrLightgun awesome let us know when you update and I will update on my end and test PSX again. Hopefully at that point we can get more testers too to make sure it’s not just something unique to my setup that makes it work. The awesome and bad thing about retropie is how much customization there is - awesome because it seems with a little work you can do almost anything (can’t imagine having anything close to my near-professional looking barcade setup without it) but bad because extremely hard to know if any fix will be “universal” or “near universal” given how many different setups and updates/lack of updates, custom configuration settings people have on their machines.

                            1 Reply Last reply Reply Quote 0
                            • A
                              allahandro @BJRetro
                              last edited by

                              @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)?

                              B 1 Reply Last reply Reply Quote 0
                              • B
                                BJRetro @allahandro
                                last edited by

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

                                1 Reply Last reply Reply Quote 0
                                • T
                                  theguru
                                  last edited by theguru

                                  @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.

                                  1 Reply Last reply Reply Quote 0
                                  • R
                                    RetroNerdman
                                    last edited by

                                    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?

                                    B 1 Reply Last reply Reply Quote 0
                                    • B
                                      BJRetro @RetroNerdman
                                      last edited by

                                      @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.

                                      B 1 Reply Last reply Reply Quote 0
                                      • B
                                        BJRetro @BJRetro
                                        last edited by

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

                                        1 Reply Last reply Reply Quote 1
                                        • thestargliderT
                                          thestarglider
                                          last edited by thestarglider

                                          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!

                                          Starglider!!! From Rainbird!!!

                                          1 Reply Last reply Reply Quote 0
                                          • M
                                            MrLightgun
                                            last edited by

                                            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:
                                            https://github.com/libretro/RetroArch/pull/9540

                                            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:
                                            https://github.com/libretro/RetroArch/pull/9599
                                            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.

                                            Thanks

                                            Mr Lightgun

                                            B quicksilverQ 2 Replies Last reply Reply Quote 2
                                            • First post
                                              Last post

                                            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.