MiSTer-devel / Linux-Kernel_MiSTer

Other
12 stars 17 forks source link

Add driver for Namco Guncon 3 #20

Closed NolanNicholson closed 2 years ago

NolanNicholson commented 2 years ago

This PR adds a driver for the GunCon 3, a light gun made by Namco for the PlayStation 3. Unlike the previous models of the GunCon, which used CRT beam tracking, the GunCon 3 tracks against IR beacons mounted to the TV, so it is compatible with all types of displays. This makes it similar in operation to the Wii Remote, but since the IR beacons can be placed far apart, some users report superior tracking from the GunCon 3.

Note: The GunCon 3 can report negative values on both position axes, which MiSTer's gun calibration syntax currently cannot handle. I am planning to submit a separate PR for Main_MiSTer to allow negative calibration values.

This driver was originally authored by beardypig. pcnimdock modified it to fix a decoding bug that caused the driver to register errant button presses. My only modification, besides whitespace formatting, was to invert the Y-axis value, since the MiSTer framework cannot map an input whose maximum value is less than its minimum value, and the GunCon 3's raw Y-axis value is positive when pointing up and negative when pointing down (unlike the Wii Remote and most other light guns.)