From 50d72f5e712f3c1754238746ba95ef3e4593ac4f Mon Sep 17 00:00:00 2001 From: Firehawke Date: Tue, 28 May 2019 22:24:26 -0700 Subject: Overhaul to advanced gun instructions (nw) This cleans up spelling and other issues in the original text. This work is still prototype and will probably require fine-tuning between Vas and myself. --- docs/source/advanced/linux-lightguns.rst | 42 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/docs/source/advanced/linux-lightguns.rst b/docs/source/advanced/linux-lightguns.rst index e25be51b89d..630605c4ae9 100644 --- a/docs/source/advanced/linux-lightguns.rst +++ b/docs/source/advanced/linux-lightguns.rst @@ -1,18 +1,14 @@ Linux Lightguns =============== -Getting Lightguns on Linux working correctly can be a complicated process. There are several methods to achieve this, however the most commonly described method - allowing MAME to see the lightgun as a mouse device - results in a poor user experience, as the tracking between the hidden+accurate mouse pointer and "crosshair" is way off, with per-game configuration required to attempt to align these. - -Another method is available which dramatically increases accuracy. - -This document will describe how to configure the X11 Lightgun provider in MAME, and provide sample udev and Xorg.conf configurations. We will assume Ubuntu, and an Ultimarc Aimtrak lightgun. Changes will be necessary for other distros/lightgun brands, however the general patterns should be identical. +Many lightguns (especially the Ultimarc AimTrak) may work better in MAME under Linux when using a slightly more complicated configuration. The instructions here are for getting an AimTrak working on Ubuntu using udev and Xorg, but other Linux distributions and lightguns may work with some changes to the steps. Configure udev rules -------------------- -For the AimTrack, each Lightgun exposes many USB devices once connected - 2 mouse like devices, and 1 joystick device. We would like to instruct libinput, via udev, to ignore all but the correct mouse device. This prevents each lighgun from producing multiple mouse devices, which would result in non-determinsitic seclection between the "good" and "bad" mouse device by Xorg. +For the AimTrak, each lightgun exposes several USB devices once connected: 2 mouse emulation devices, and 1 joystick emulation device. We need to instruct libinput via udev to ignore all but the correct emulated mouse device. This prevents each lightgun from producing multiple mouse devices, which would result in non-deterministic selection between the "good" and "bad" emulated mouse devices by Xorg. -Create a new file named `/etc/udev/rules.d/65-aimtrak.rules` and place the following contents into it: +Create a new file named ``/etc/udev/rules.d/65-aimtrak.rules`` and place the following contents into it: | # Set mode (0666) & disable libinput handling to avoid X11 picking up the wrong | # interfaces/devices. @@ -23,15 +19,16 @@ Create a new file named `/etc/udev/rules.d/65-aimtrak.rules` and place the follo | SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="160*", | ENV{ID_USB_INTERFACE_NUM}=="02", ENV{ID_INPUT}="1", | ENV{LIBINPUT_IGNORE_DEVICE}="0" +| This configuration will be correct for the AimTrak lightguns, however each brand of lightgun will require their own settings. Configure Xorg inputs --------------------- -Next, we'll configure Xorg to treat the Lightguns as a "Floating" device. This is important for multiple lightguns to work correctly, and ensures each gun's "mouse pointer" is NOT merged with the main system mouse pointer. +Next, we'll configure Xorg to treat the lightguns as a "Floating" device. This is important for multiple lightguns to work correctly and ensures each gun's emulated mouse pointer is NOT merged with the main system mouse pointer. -/etc/X11/xorg.conf.d/60-aimtrak.conf: +In ``/etc/X11/xorg.conf.d/60-aimtrak.conf`` we will need: | Section "InputClass" | Identifier "AimTrak Guns" @@ -41,17 +38,26 @@ Next, we'll configure Xorg to treat the Lightguns as a "Floating" device. This i | Option "Floating" "yes" | Option "AutoServerLayout" "no" | EndSection +| Configure MAME -------------- -Next, we'll configure MAME to use the X11 `lightgun_provider`, as well as all the other related settings: +Next, we'll need to configure MAME via ``mame.ini`` to use the new lightgun device(s). + +* lightgun 1 +* lightgun_device lightgun +* lightgunprovider x11 + +These first three lines tell MAME to enable lightgun support, to tell MAME that we're using a lightgun instead of a mouse, and to use the x11 provider. + +* lightgun_index1 "Ultimarc ATRAK Device #1" +* lightgun_index2 "Ultimarc ATRAK Device #2" +* lightgun_index3 "Ultimarc ATRAK Device #3" +* lightgun_index4 "Ultimarc ATRAK Device #4" + +These next lines then tell MAME to keep lightguns consistent across sessions. + +* offscreen_reload 1 -| lightgun 1 # Enable Lightgun support -| lightgun_device lightgun # Use the lighgun subsystem for lightguns (instead of Keyboard/Mouse) -| lightgunprovider x11 # Use the x11 lightgun driver -| lightgun_index1 "Ultimarc ATRAK Device #1" # Name our devices for consistent detection -| lightgun_index2 "Ultimarc ATRAK Device #2" -| lightgun_index3 "Ultimarc ATRAK Device #3" -| lightgun_index4 "Ultimarc ATRAK Device #4" -| offscreen_reload 1 # Enable offscreen reload, required for most games. +Lastly, as most lightgun games require offscreen reloading and we're using a device that actually can point away from the screen, we enable that functionality. -- cgit v1.2.3