Based on the Prow Enhanced fork, which in itself is based on the 4IR Beta "Big Code Update" SAMCO project
Looking for configuration? Check out the GUN4ALL-GUI!
- Drag'n'drop installation! One-minute initial setup with provided binaries for a number of RP2040-based boards; just plug the board in, drag the firmware over, and then configure using the GUN4ALL-GUI, compatible with both Windows and flavors of Linux. No license required, and configurations are saved to the board for easier use across multiple systems!
- Solenoid Support! Get the authentic arcade feedback with every shot, in either single shot, three-shot burst, or rapid fire modes. Intelligently works when aiming on-screen!
- Rumble Support! Feel the subtle feedback of a motor, for those moments when you need to shoot outside of the screen!
- Temperature Sensor Support! With an optional TMP36 sensor, you can keep your solenoid working better for longer! Tempers feedback based on temperature readings with every shot.
- Offscreen Button Support! The gun can distinguish between on- and off-screen aiming and report different buttons depending on screen detection! An optional setting is also available for older games that allows the trigger to send left or right-clicks when shooting off-screen.
- Gamepad Output Support! GUN4ALL reports as a plug'n'play five-button mouse, keyboard, and gamepad with ability to output the position as either the left or right joystick (with the other reserved for the gun's physical analog stick, if available). The first open source lightgun system that's fully compatible with PCSX2 nightly on all platforms for multiplayer!
- Toggleable Extras! Aside from the option for using hardware switches baked in, the extras can all be individually toggled mid-game in Pause Mode (either via Hotkeys or a scrollable menu system)!
- Supports any gun shell imaginable! All original console and custom controller designs are compatible with careful consideration for all sorts of form-factors; from the one-button Sega Virtua Gun to the stick-toting behemoths of Cabela's Top Shot Rifles, to even planned support for Blamcons - if you can fit a Pico in it, you can use it with GUN4ALL!
- RGB Support! GUN4ALL supports both four-pin-style RGB LEDs (common anode & cathode supported), as well as internal and external NeoPixels for glowy-blinky feedback, for both navigating the gun's internal systems or reacting to RGB commands!
- Mame Hooker Support! Further your own goals with Mame Hooker, compatible with Windows & Linux (thru Wine); the gun will automagically hand over control of offscreen button mode, peripherals and LEDs for event aware feedbacks for even more immersive gameplay!
- Dual Core Support; take advantage of the second core in the ever-popular Raspberry Pi Pico's RP2040 chip for processing button inputs in parallel, (theoretically) reducing latency.
- Multiple Guns Support; easily set the gun to use binds for P1-4 with a single setting, swap player position on-the-fly, and change the USB identifier for each unique board without modifying deep rooted Arduino files!
- Fixed button responsiveness; no sticky inputs, and solid debouncing with no performance impact!
- All upgrades are optional, and can work as a drop-in upgrade and/or replacement for current GUN4IR and SAMCO builds.
- Expanded save support, allowing changes to every facet of the firmware to be pushed to the board; no more reflashing just to change that one setting!
- Plenty of safety checks, to ensure rock-solid functionality without parts sticking or overheating. Now you too can feel like a helicopter parent!
- Remains forever open source, with compatibility for GUN4IR parts! Can use the same community resources of parts and tutorials for easier assembly of a complete build.
- Clearer labeling in the sketch for custom builders, to streamline deployments as much as possible
- Made out of at least 49% passion and 49% stubbornness (and 2% friendly spite)!
- Increased precision for maths and mouse pointer position
- Glitch-free DFRobot positioning (
DFRobotIRPositionEx
library) - IR camera sensitivity adjustment (
DFRobotIRPositionEx
library) - Faster IIC clock option for IR camera (
DFRobotIRPositionEx
library) - Optional averaging modes can be enabled to slightly reduce mouse position jitter
- Enhanced button debouncing and handling (
LightgunButtons
library) - Modified AbsMouse to be a 5 button device (
AbsMouse5
library, now part ofTinyUSB_Devices
) - Multiple calibration profiles
- Save settings and calibration profiles to flash memory (SAMD) or EEPROM (RP2040)
- Built in Processing mode for use with the SAMCO Processing sketch (now part of GUN4ALL-GUI)
- An Arduino-compatible microcontroller based on an RP2040.
- Recommended boards for new builds would be the Raspberry Pi Pico (cheapest, most pins available), Adafruit Kee Boar KB2040 (cheaper, Pro Micro formfactor, compatible with GUN4IR boards), or ItsyBitsy RP2040 (compatible with SAMCO boards)
- Keep in mind the differences in pinouts, as it will always be different between builds and boards!
- DFRobot IR Positioning Camera SEN0158: Mouser (US Distributor) | DF-Robot (International) | Mirrors list
- 4 IR LED emitters: regular Wii sensor bars might work for small distances, but it's HIGHLY recommended to use SFH 4547 LEDs w/ 5.6Ω (ohm) resistors. Build tutorial here!
- Optional: Any 12/24V solenoid, w/ associated relay board. Build tutorial here! Easy driver board here
- Requires a DC power extension cable &/or DC pigtail, and a separate adjustable 12-24V power supply.
- Optional: Any 5V gamepad rumble motor, w/ associated relay board. Build tutorial here! Easy driver board here
- Optional: Any 2-way SPDT switches, to adjust state of rumble/solenoid/rapid fire in hardware (can be adjusted in software from pause mode if not available!)
- Optional: Any 12/24V solenoid, w/ associated relay board. Build tutorial here! Easy driver board here
Grab the latest .UF2 binary for your board from the releases page, and drag'n'drop the file to your microcontroller while booted into Bootloader mode (RP2040 is automatically mounted like this when no program is loaded, or can be forced into this mode by holding BOOTSEL while plugging it into the computer - it will appear as a removable storage device called RPI-RP2).
Check out the enclosed instruction book! Also see the README files in libraries
for more information on library functionality.
For reference, the default schematic and (general) layout for the build and its optional extras are attached.
- Layouts can be customized after installing the firmware - the only pins that must match are Camera Data & Clock.
- Calibrating while serial activity is ongoing has a chance of causing the gun to lock up (exact cause still being investigated).
- Camera failing initialization will cause the board to lock itself in a "Device not available" loop.
- Add extra feedback in the initial docking message for the GUI to alert the user of the camera not working?
Note
Solenoid may or may not cause EMI disconnects with certain wiring. This is not caused by GUN4ALL, but is indicative of too-thin wiring on the cables going to/from the solenoid driver. Cables for this run specifically should be 22AWG at its thinnest - or else the cables will become antennas under extended use, which will trip USB safety thresholds in your PC to protect the ports.
- (Re-)expose button function remapping.
- Should implement support for rumble as an alternative force-feedback system (
RUMBLE_FF
). - Some code functions should be offloaded to classes (a lot of core functionality/variables are all shoved into
SamcoEnhanced.ino
atm).
-
Samuel Ballantyne, for his SAMCO project which inspired my madness in the first place.
-
Prow7, for improving an already promising project and providing the basis for this madness.
-
Jaybee, for a frame of reference on implementing the feedback additions, and to hopefully act as an OS-agnostic competition for the (I assume) great GUN4IR.
-
The people that have donated and given their thoughts about this silly little obsession I've been working on.
-
The testers that have had to deal with my MAMEHOOKER integration stability bullshit (seriously, it's super appreciated, and I'm so sorry).
-
My YouTube audience, for their endless patience as I couldn't help but work on this instead of videos.
-
Emm, for being there when I needed her.
-
And Autism.
~<3
That One Seong