Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Lightgun support added to PCSX-Rearmed



  • Hi Everyone

    Meant to complete this ages ago but I have finally added Guncon lightgun support to PCSX-Rearmed so you can now play all your favourite Lightgun games on the Raspberry Pi.

    If a couple of people could test it that would be awesome and then I can have a go at merging it up into main branch, I haven't done that before so quite appreciative of any advice or guidance.

    My repo is here:
    https://github.com/SindenLightgun/pcsx_rearmed.git

    To use this you need to edit:
    /home/pi/RetroPie-Setup/scriptmodules/libretrocores/lr-pcsx-rearmed.sh

    Change the section to be like this:
    function sources_lr-pcsx-rearmed() {
    gitPullOrClone "$md_build" https://github.com/SindenLightgun/pcsx_rearmed.git
    }

    Now go into RetroPie setup, manage packages, manage core packages, lr-pcsx-rearmed, do a remove first, then update from source.

    When that has finished then you load lr-pcsx-rearmed as usual. Then on the menu under options you can change Pad 1 Type to "guncon". You need a mouse based lightgun like the Aimtrak or a Dolphin bar or my upcoming Sinden Lightgun.

    There is some guncon adjust settings in the options too. You can use these if the emulator is not putting the shots in the right place. A good example of this is when you play Die Hard Trilogy.

    I'll also publish my DosBox and Flycast Sega Naomi Lightgun support when I get the chance to complete them properly .

    For those of you interested in my project, the Sinden Lightgun Kickstarter is progressing well, I'm really happy with the quality so far but everything is annoyingly taking more time than I was wanting. I'm working hard to deliver the Kickstarter this year and I'll be able to take new orders then too. You can read my latest update here:
    Latest public update on Kickstarter

    render.jpg

    I've managed to make some further small performance improvements on the Pi since my last video but haven't had the time to do any videos since this last one which shows all the range of Lightgun support that the Pi has or will have soon:


    It's a shame I'm so busy because I'd love to be messing about with the Pi 4 at the moment as that will be an excellent boost for the project but I'm sure I will get the chance soon when all the devs complete their hard work.

    All the best

    Mr Lightgun



  • Thank you for this! I'm having a few issues though..

    The file is actually in

    /home/pi/RetroPie-Setup/scriptmodules/libretrocores/lr-pcsx-rearmed.sh

    I've got button presses being registered, but no cursor movement so i can't configure the gun.. The bar is working as the gun still works fine in mame games..

    Anything i'm missing?



  • I would like to help you out with some testing, but how would I go about connecting a Guncon lightgun to a Raspberry Pi?



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

    Thank you for this! I'm having a few issues though..

    The file is actually in

    /home/pi/RetroPie-Setup/scriptmodules/libretrocores/lr-pcsx-rearmed.sh

    I've got button presses being registered, but no cursor movement so i can't configure the gun.. The bar is working as the gun still works fine in mame games..

    Anything i'm missing?

    Whoops, I fixed the folder name, thanks.

    Inside the game can you go the full settings menu, select input, then under controller/gamepad there is a setting for mouse index, can you try some different numbers, assuming you are currently zero, try 1,2,3,4.

    What Playstation game did you test it with? Time Crisis or Point Blank are good as they have a calibration screen to test with when it first loads.

    Do you have any other devices connected such as a mouse? Can you confirm that your setup works in lr-FCEUX with Duck Hunt? Make sure you select pointer/lightgun in the options for zapper type and show the crosshair to help diagnose. My implementation is very similar to that. Mame is quite different. Appreciate your testing.

    Thanks

    Mr Lightgun



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

    I would like to help you out with some testing, but how would I go about connecting a Guncon lightgun to a Raspberry Pi?

    Sorry, this relies on a mouse based lightgun such as Aimtrak, Mayflash Dolphin Bar or in the future Sinden Lightgun acting as the Guncon.



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

    Thank you for this! I'm having a few issues though..

    The file is actually in

    /home/pi/RetroPie-Setup/scriptmodules/libretrocores/lr-pcsx-rearmed.sh

    I've got button presses being registered, but no cursor movement so i can't configure the gun.. The bar is working as the gun still works fine in mame games..

    Anything i'm missing?

    Oh just in case, to be clear there is no crosshair/cursor added to the screen. Now that I've added the Lightgun support if someone can add the crosshair as an optional graphic that would be great and I could extend the functionality to mice and the analog gamepad stick too.



  • @MrLightgun

    I've gone through the first 5 or 6 indexes (seems like there are endless possibilities) but none of them are making a difference. I found them under Settings, Input, User 1 Binds

    I don't have a mouse plugged in, just 2 joysticks.

    I've tried Time Crisis and Point Blank.

    I can't find LR-FCEUXX to install unfortunately.

    Is there any way to determine which mouse index it's on?



  • @MrLightgun No worries, I got a Mayflash Dolphin Bar and a Wii controller I can test with.



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

    @MrLightgun

    I've gone through the first 5 or 6 indexes (seems like there are endless possibilities) but none of them are making a difference. I found them under Settings, Input, User 1 Binds

    I don't have a mouse plugged in, just 2 joysticks.

    I've tried Time Crisis and Point Blank.

    I can't find LR-FCEUXX to install unfortunately.

    Is there any way to determine which mouse index it's on?

    This page gives a lot of diagnostic methods:
    https://retropie.org.uk/docs/Spinners,-Trackballs,-Lightguns,-and-other-Mouse-Devices/

    Can you do ls /dev/m* to see what mice it thinks you have connected. Someone is testing with an Aimtrak too and reporting similar issues.

    The NES emulator is actually called lr-fceumm sorry and is one of the standard emulators.

    Thanks

    Andy



  • @MrLightgun

    I'll try and get some time with it this evening and give it another go.. I've just had to recover my setup because i borked the es_systems.cfg some how lol (nothing to do with your stuff)

    I find the retroarch menu's very difficult to navigate thus me having problems finding things :)



  • @MrLightgun i will see if I can try this with a dolphin bar tonight or tomorrow with time crisis. Looking forward to your lightgun! I ordered the Kickstarter and have been following the updates!



  • I haven't used my dolphinbar in a while so maybe I'm doing something wrong. I'm trying elemental gearbolt on my pi4. I can't aim at all. Most wiimote buttons work in normal pad mode but all buttons stop responding when changing pad to guncon. Wiimote aiming works with fceumm and duck hunt. I tried mode1,2, and 3 on the dolphinbar, though not sure which is preferred.

    Update: Well, buttons work on my pi3 with stretch. Though, it looks like this "guncon" mode removes the crosshair in the game. I guess the emulator needs a real mouse mode so the wiimote can be used properly.



  • @MrLightgun ok so I feel like I am almost there. When I have a game pad plugged in with the dolphin bar /wiimote also, the configuration screen on time crisis does not appear but gun shots register and I can see the bullet mark appear on the select game screen with various positions as I move the gun and shoot it which is great. Problem is the shot marks only appear in the top left quadrant of the screen so I cannot “reach” the place I would need to shoot to select “arcade.” Saving the configuration settings, exiting, removing the game pad and keeping the dolphin bar /wiimote only brings up the guncon config screen when I restart but because there is no cursor and the dolphin bar is not “line of sight” accurate I can hear shots when I pull the trigger but can’t get past the configuration screen where I am supposed to shoot the target in the middle of the screen.

    Seems best bet is to go with option 1 because that same “left quadrant only” with the dolphin bar appears in another emulator previously (maybe it was nes?) and I think some setting in retroarch made that work; I forget which though. Do you think something in the guncon configuration settings would expand the available window to shoot in beyond the left quadrant? I am not sure what the new guncon config settings mean though I found where they are.



  • @BJRetro upon further testing using “option 1” and timecrisis rom, Gamepad plus dolphin bar/wiimote, adjusting the guncon settings to 25, 25, 1.25 and 1.25 I have a bigger window to shoot in so can start the game and can confirm I can shoot some bad guys! Yay. Progress. Still can’t shoot in the right third of the screen though. Is there any way to give me a higher value than 25 in the first two settings? Seems if that went up to 50 or even 75 and the second two setting went up to 2 I might be in. (For what it’s worth I also tried messing with various combos of “touchscreen support” and “mouse support” in the user interface retroarch menu and various input driver settings in the retroarch menu and none expanded the shooting zone as far as I can tell).

    (Also, gun is working fine in advmame 1.4 and fc-ucem nes emulator).

    Thanks for all the hard work!



  • Hi

    Thanks so much for testing, you've given me some ideas to check. I've just realised that retroarch has been updated with the touchscreen lightgun and so has lr-fceumm which might make a difference.

    Can you confirm 3 things for me please, what version of RetroArch / RetroPie you have, what version of lr-fceumm you have and finally what setting do you have for the lightgun in lr-fceumm in options, its usually mouse, pointer or lightgun.

    We will get there because I've done the hardest part, just need to hook into the correct libretro interface.

    I can increase that guncon adjustment range but it's not meant to fix a controller input, it's meant for when the emulator is misaligning where the shots are. So would just be masking the true solution.

    Thanks

    Andy



  • @MrLightgun ok so retroarch is 1.7.6, my Lr-FCEUM says at the bottom of the retroarch screen the following:

    1.7.6 - FCEUmm (SVN) 02840d9

    As for relevant retroarch settings in LR-FCEUM

    1. Quick menu - controls - User 1 device type auto, user 2 device type auto

    2. Quick menu - options - zapper mode: mouse; show crosshairs: enabled

    3. main menu - settings - input - User 1 binds - user 1 shows:
      -device type of “auto”
      -analog to digital of “left analog”
      -device index of “Xiaoji gamesir-G3w” (which is the additional controller I have plugged in)
      -mouse index “0”

    4. main menu - settings - input - user 2 binds - user2 shows:
      -device type of “auto”
      -analog to digital of “left analog”
      -user 2 device index of “disabled”
      -user 2 mouse index of “0”

    5. main menu, drivers, shows input as “udev” and joypad as “udev”

    6. main menu, user interface, shows “mouse support: ON” and shows “touch support: ON”

    7. Also For what it’s worth, my dolphin bar is set up so the wiimote has lights 1 and 4 lit up. It is connected to the pi by the dolphin bar (not independently using the wiimote Bluetooth). I configured the wiimote as a controller in the EmulationStation controller config using the GUI menu in EmulationStation.

    Hope this helps somewhat! My system is kind of like a Frankenstein at this point because it was a fresh install like almost 2 years ago now and I have done everything myself in terms of tweaking and updating and I don’t know very much.



  • I'm trying this tonight on my test pi. I'm currently testing some Fruitbox skins on this and it has been updated a week ago. I have the dolphin bar and will report back tonight! I'm very excited about this!



  • I tried Duck hunt, 2 and 1 duck hunt with Mario and Time Crisis with the PSX. All with the dolphin bar and original wii motes with no luck.

    In Time Crisis, I changed to guncon and I tried changing the mouse indexes number, but with no luck. I also tried adjusting the ranges, with varying extremes for each one, but same result.

    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.

    Am I missing something?
    It's getting late and I can try this with advancemame tomorrow just to see if that works, but the wiimote was working on my computer last night.

    Retroarch 1.7.6
    Retropie 4.5.1


  • Global Moderator

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



  • Speaking of light guns, do you guys recommend any light gun shells for the Wiimote, or should I just wait for the sinden light gun?



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.