Skip to content

IR-GUN4ALL v3.0 - Rinko-hotfix

Compare
Choose a tag to compare
@SeongGino SeongGino released this 09 Feb 18:27
· 76 commits to plus since this release
ad1e1e9
(What was meant to be a smooth yet foreboding release blew up into something much more.)

Hotfix update!

Some safeguards regarding custom TinyUSB names were added, to prevent the likelihood of loading a null identifier--as well as some other behind-the-scenes changes to facilitate GUI development, which is currently ongoing.

The original release notes for the major version are below:


The Feature-Completeness Update

  • Full save support - virtually* every aspect of the gun can now be configured at runtime.
    • This is currently done with serial commands - see the output of Xm and Xp for more info. This has been intended to be the backbone for the eventual GUI companion app that will be coming in due time for Linux & Windows, which will (hopefully) streamline the process significantly.
  • Added External RGB LED support, for both four-pin units & external NeoPixels!
    • For four-pin units, enable using FOURPIN_LED and configure what legs are what color for what pins (PWM pins only).
      • Both Common Anode(+/5V) and Common Cathode(-/GND) units are supported, with bits flipped for the former when commonAnode is used.
    • Fourpin LEDs reacts to both individual R/G/B color channels (what's used in Serial Handoff when MAMEHOOKER is sending lamp commands) and packed colors used in profiles (since the individual colors are in the three-least significant bytes, we just read bytes directly to their bare color channels--exact color accuracy might be slightly off!).
  • For external NeoPixels, enable using CUSTOM_NEOPIXEL and configure which pin the external unit is on (any digital pin), and how many are daisy-chained (for strips; leave at 1 for a solo unit).
    • Note that this is for external units, as in ones you added yourself! GUN4ALL has always had support for integrated DotStars and NeoPixels since the beginning, and will continue to be used if the board has one alongside any external Pixels.
  • Pico compatibility has been fixed and vetted, now using pins 20 & 21 for the camera clock/data lines.
  • The input system has been updated, adding support for offscreen button settings! Distinct from the already-existing offscreen trigger button mode, this allows all the buttons (except for the trigger, start and select) to have different functionality depending on whether the gun is pointing on- or off of the screen.
    • To go along with this, low buttons mode has been implemented as a macro that remaps Buttons A & B as Start & Select when pressed while aiming off-screen.
  • Gamepad output has been implemented! The gun can now not only output its array of buttons as gamepad button presses, but with an internal toggleable switch (see the below feature!), the gun's position can now be reported as a gamepad stick! (Currently when in Analog Output mode, the gun reports as the left stick by default - currently investigating if this is correct for games that are hardcoded to use this for multiplayer, like Railbreak for instance.)
    • This makes GUN4ALL one of, if not the first open source lightgun system with compatibility for PCSX2 nightly two-player support!
  • Alongside support for Analog Output, this version also introduces Analog INput allowing an analog stick, such as what's seen on devices like the Cabela's Top Shot Elite Rifle, to be compatible with GUN4ALL - connect the stick to analog pins A0/A1 by default.
  • As part of the input system update, GUN4ALL can now dynamically reallocate its player start/select mappings! Meaning with a single serial command, it can switch start & select from 1/5 to 2/6, or 3/7, or 4/8.
  • Configuration over Serial has been implemented, now allowing users to change aspects of the gun and quick-jump to nearly any adjustable setting or mode with a two-to-three character keycode when connected over a serial monitor/terminal such as screen/echo commands on Linux or puTTY on Windows!
    • Gun Configuration commands and their functions can be found on the repo wiki
    • If a syntax error is detected, the gun will print out some helpful information depending on the command type.
    • Also general cleanup in the serial processing method to make it cleaner to add commands to it and be easier to read for development.
  • A new version of Pause Mode has also been introduced for guns with one-to-two aux buttons, with the aptly-named Simple Menu (simpleMenu). If enabled, the gun will use a new interface, where the options are scrolled through by using Buttons A & B, and selected with the Trigger.
    • Simple Menu will cycle through options in the following order, always starting from the first:
      • Calibrate current profile: What it says on the tin.
      • Switch profile: Selecting will drop into a submenu where the user can select what calibration profile to switch to; always starting from their currently selected profile.
      • Save settings: Duh.
      • Toggle Solenoid: Solenoid will click a few times when enabled, won't when it's disabled. This option is skipped if a respective hardware switch is detected on a valid pin number.
      • Toggle Rumble: Rumble motor will spin when enabled, won't when it's disabled. This option is skipped if a respective hardware switch is detected on a valid pin number.
      • Send Escape Key: Fires a press of the escape key on the keyboard when activated.
    • The Simple Menu can be exited by pressing and holding either the A or B buttons for half the length of pauseHoldLength at any time.
  • Both Simple Pause Menu and the original Hotkey Pause Mode can be set to be toggled (holdToPause) by pressing and holding the A Button & Trigger while aiming completely off-screen for the time allotted in pauseHoldLength
    • This isn't connected to the normal offScreen boolean for off-screen shots, but the lastSeen integer that counts the amount of seen IR sources--this means you have to intentionally point away from any and all light sources for this to come into effect!
  • Another concession for one-button gun users, the vertical/horizontal scale setting in the calibration sequence can be adjusted both ways with a single A button!
    • Pressing (A) while the cursor is on-screen will increase the scale, and pressing (A) while it's at the edge of the display will decrease the scale.
    • This along with the aforementioned Pause Mode features makes GUN4ALL totally Sega Virtua Gun compliant, for the one person out there that uses it.
  • Hardware switches will now be checked if they're valid before setting any new state, if changed; so too will solenoid and rumble be disabled if their respective signal wires are set to invalid pin numbers.
  • Some plumbing done to the TinyUSB Devices and LightgunButtons libraries to facilitate these changes.

As part of our transition to simplified distribution of GUN4ALL, we now distribute binaries! Simply download the UF2 file that correlates to the board you use, and set your microcontroller into its bootloader mode (either holding BOOTSEL on plug, or set the COM port to 1200 baud, e.g. stty -F /dev/ttyACM# 1200 on Linux).

  • Currently, these will use pre-defined pin locations by default, which are reflected in the documentation; custom mappings can be set by a serial monitor/terminal with Xm--see its help printout for further information. Hint: you can do this even on initial boot when prompted for initial calibration!
  • When the currently selected profile on boot is detected as having zero'd center coords out, this will prompt an EEPROM clear and a first calibration on-boot - pull the trigger to center the cursor, then pull again to set and begin the process proper!
  • There are multiple sets of firmware files provided:
    • SamcoEnhanced.pico.uf2 is for the Raspberry Pi Pico, and SamcoEnhanced.adafruitItsy.uf2 is for the Adafruit ItsyBitsy RP2040 board - the only difference is default pins mapping and accommodation for the latter's builtin NeoPixel. These should be the ones used for most users.
    • Firmwares with -tmp36 at the end the same as the default, but with support for the TMP36 Temperature Sensor enabled - this is currently provided as a separate image because the temperature sensor implementation of recoil is slightly different from the normal one, and leaving analog pins unattached can cause noise that might negatively affect recoil performance if a TMP36 sensor isn't being used. This will hopefully be resolved in a future release.

To reflect these changes, the enclosed instruction book has removed references to the development environment and so is now focused exclusively on end-user interaction and notes for users - developers or those deploying wholly custom builds with features disabled must now refer to BUILDING.md in the root dir of this source repository, and it's assumed that you have a familiarity with the Arduino IDE.

On a sidenote, this update affects both LightgunButtons and TinyUSB Devices, so if you're building from the IDE like previous releases then make sure to replace these libraries as well.