All Projects → gunpadawan → gunconf

gunpadawan / gunconf

Licence: MIT License
Configuration utility for Aimtrak light gun

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to gunconf

hypseus-singe
Hypseus is a SDL2 version of Daphne and Singe. Laserdisc game emulation.
Stars: ✭ 86 (+437.5%)
Mutual labels:  retropie, daphne
arcade-manager
Arcade management tool to handle your MAME/FBA romsets
Stars: ✭ 104 (+550%)
Mutual labels:  retropie
Bartop-2-Players-with-Raspberry-Pi
Wooden Bartop Arcade 2 Players with Raspberry Pi: 17" LCD monitor, Marquee with LED lights and stereo speakers.
Stars: ✭ 48 (+200%)
Mutual labels:  retropie
retropie-overlays
Console overlays set for Retropie & Recalbox
Stars: ✭ 54 (+237.5%)
Mutual labels:  retropie
retropiesplashscreen
Splashscreen Randomizer for Retropie!
Stars: ✭ 19 (+18.75%)
Mutual labels:  retropie
rpie-art
Easy way to install art on your RetroPie.
Stars: ✭ 25 (+56.25%)
Mutual labels:  retropie
ControlBlockService2
This is the driver for the ControlBlock re.v 2.X, a power switch and input/output/gameapd gadget for the Raspberry Pi
Stars: ✭ 18 (+12.5%)
Mutual labels:  retropie
L4T-Megascript
All-in-one installer and updater for popular programs on L4T Ubuntu with no prior knowledge of Linux needed
Stars: ✭ 68 (+325%)
Mutual labels:  retropie
es-theme-Super-Retroboy
Super Retroboy Theme for the RetroFlag GPi Case and Small Screens 4:3 Aspect
Stars: ✭ 45 (+181.25%)
Mutual labels:  retropie

Gunconf

Gunconf is an utility to configure Aimtrak guns on linux systems

It is tested on ubuntu desktop and retropie.

Written in python on top of pygame, it does not require an x server.

Configuration Panel Sensor View Panel

Install

Prerequisites

sudo apt install apt-transport-https python-dev python-pygame python-setuptools

Get the source

git clone https://github.com/gunpadawan/gunconf

Install python module

cd gunconf

sudo python setup.py install

Udev rules

Application requires access to the aimtrak usb device. It is usually necessary to configure udev to let your specific user access that device.

To let any user access the device, do:

sudo cp utils/aimtrak.rules /etc/udev/rules.d/99-aimtrak.rules

sudo udevadm control --reload-rules

Launch

To launch application, you can execute utils/gunconf.sh

For retropie users, you can add the app to the retropie menu by simply copying that file:

sudo cp utils/gunconf.sh /home/pi/RetroPie/retropiemenu/

Advancemame

So far advancemame is the only emulator that has been successfully tested.

download advmame >=3.4 (does not work for sure with prior versions)

Configuration

edit ~/.advance/advmame.rc

set the following:

device_mouse none to disable the support for mouse even if the gun is configured to report as a mouse

device joystick event to ask advmame to use linux event interface

Next you need to configure the gun itself, especially the different axes. For player 1 you need to find the right value for input_map[p1_lightgunx] and input_map[p1_lightguny]

Assuming you have configured the gun to use device ID 0x1601, the configuration is:

input_map[p1_lightgunx] joystick[d209_1601_2,0,0]

input_map[p1_lightguny] joystick[d209_1601_2,0,1]

  • d209 is the usb vendorId of the gun (fixed value)
  • 1601 is the usb productId
  • 2 is the usb device interface (fixed value)

Then configure the trigger.

input_map[p1_button1] joystick_button[d209_1601_2,0]

for more details you can read the advmame doc

Test

From there you should be able to start the emulator and test.

Assuming you own a rom called duckhunt

make sure you have ~/.advance/rom/duckhunt.zip

launch advmame duckhunt

the crosshair should now move on the screen.

Start calibration with the button you have configured for that purpose in gunconf

In the menu, you can configure a key or button to toggle crosshair display

Daphne

Since my best shooting games run only on daphne, I have added (initial) aimtrak support to that emulator. It's not that straightforward for now but if you want to give it a try on retropie:

connect to your pi through ssh:

cd ~/RetroPie-Setup/scriptmodules/emulators

mv daphne.sh daphne.sh.bak

wget "https://raw.githubusercontent.com/gunpadawan/RetroPie-Setup/master/scriptmodules/emulators/daphne.sh"

launch Retropie-Setup from the retropie menu and install daphne emulator from source

then you need to add a game in /home/pi/RetroPie/roms/daphne.

To be recognized by emulation station, your game needs to be in a directory ending with ".daphne"

at start, daphne.sh will read the content of a file in that directory named <game>.commands.

As an example, let's assume we have a game called Last_Bounty_Hunter:

1/ Add your game files in the /home/pi/RetroPie/roms/daphne/Last_Bounty_Hunter.daphne directory

2/ Edit the file named /home/pi/RetroPie/roms/daphne/Last_Bounty_Hunter.daphne/Last_Bounty_Hunter.daphne

and add parameters like this: singe vldp -framefile ./frame-lbh-cdrom.txt -script ./cdrom-lbh.singe

refer to daphne doc for further information on parameters

Known limitations

  • does not support firmware update (you need a windows host for that...)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].