summaryrefslogtreecommitdiffstatshomepage
path: root/docs
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2026-01-06 05:01:13 +1100
committer Vas Crabb <vas@vastheman.com>2026-01-06 05:01:13 +1100
commitcf70b0c19d9189e723826826392cb457d7ec25f9 (patch)
tree95f97728820e57d21d8047fdcb84b254061e92cc /docs
parent390266f0030ddbe54c79520f0924722776a78413 (diff)
-plugins/inputmacro: Added support for non-wrapping analog inputs.
-emu/inputdev.cpp, emu/emuopts.cpp: Removed core off-screen reload hack now that the same thing can be achieved more flexibly with plugins. -ui/pluginopt.cpp: Changed the "previos menu" item text to make what it does more obvious.
Diffstat (limited to 'docs')
-rw-r--r--docs/source/advanced/linux-lightguns.rst91
-rw-r--r--docs/source/commandline/commandline-all.rst18
-rw-r--r--docs/source/commandline/commandline-index.rst1
-rw-r--r--docs/source/plugins/inputmacro.rst38
4 files changed, 84 insertions, 64 deletions
diff --git a/docs/source/advanced/linux-lightguns.rst b/docs/source/advanced/linux-lightguns.rst
index 630605c4ae9..9463b00edc8 100644
--- a/docs/source/advanced/linux-lightguns.rst
+++ b/docs/source/advanced/linux-lightguns.rst
@@ -1,63 +1,76 @@
Linux Lightguns
===============
-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.
+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 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.
+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.
-| SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="160*",
-| MODE="0666", ENV{ID_INPUT}="", ENV{LIBINPUT_IGNORE_DEVICE}="1"
-|
-| # For ID_USB_INTERFACE_NUM==2, re-enable libinput handling.
-| SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="160*",
-| ENV{ID_USB_INTERFACE_NUM}=="02", ENV{ID_INPUT}="1",
-| ENV{LIBINPUT_IGNORE_DEVICE}="0"
-|
+ # Set mode (0666) & disable libinput handling to avoid X11 picking up the wrong
+ # interfaces/devices.
+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="d209", ATTRS{idProduct}=="160*",
+ MODE="0666", ENV{ID_INPUT}="", ENV{LIBINPUT_IGNORE_DEVICE}="1"
-This configuration will be correct for the AimTrak lightguns, however each brand of lightgun will require their own settings.
+ # For ID_USB_INTERFACE_NUM==2, re-enable libinput handling.
+ 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 emulated 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.
-In ``/etc/X11/xorg.conf.d/60-aimtrak.conf`` we will need:
+In ``/etc/X11/xorg.conf.d/60-aimtrak.conf`` we will need::
-| Section "InputClass"
-| Identifier "AimTrak Guns"
-| MatchDevicePath "/dev/input/event*"
-| MatchUSBID "d209:160*"
-| Driver "libinput"
-| Option "Floating" "yes"
-| Option "AutoServerLayout" "no"
-| EndSection
-|
+ Section "InputClass"
+ Identifier "AimTrak Guns"
+ MatchDevicePath "/dev/input/event*"
+ MatchUSBID "d209:160*"
+ Driver "libinput"
+ Option "Floating" "yes"
+ Option "AutoServerLayout" "no"
+ EndSection
Configure MAME
--------------
-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.
+Next, we'll need to configure MAME via ``mame.ini`` to use the new lightgun
+device(s)::
-* lightgun_index1 "Ultimarc ATRAK Device #1"
-* lightgun_index2 "Ultimarc ATRAK Device #2"
-* lightgun_index3 "Ultimarc ATRAK Device #3"
-* lightgun_index4 "Ultimarc ATRAK Device #4"
+ lightgun 1
+ lightgun_device lightgun
+ lightgunprovider x11
-These next lines then tell MAME to keep lightguns consistent across sessions.
+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::
-* offscreen_reload 1
+ lightgun_index1 "Ultimarc ATRAK Device #1"
+ lightgun_index2 "Ultimarc ATRAK Device #2"
+ lightgun_index3 "Ultimarc ATRAK Device #3"
+ lightgun_index4 "Ultimarc ATRAK Device #4"
-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.
+Lastly, as many lightgun games require aiming away from the screen and firing to
+reload, you may reloading and we're using a device that represents that as a
+separate button, you will need to configure the :ref:`off-screen reload helper
+plugin <plugins-offscreenreload>` or :ref:`input macro plugin
+<plugins-inputmacro>` to translate this to the axis and button inputs that these
+games expect.
diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst
index 208cc9810d0..d4a40bce549 100644
--- a/docs/source/commandline/commandline-all.rst
+++ b/docs/source/commandline/commandline-all.rst
@@ -3276,24 +3276,6 @@ Core Input Options
mame apple2e -ui_active
-.. _mame-commandline-nooffscreenreload:
-
-**-[no]offscreen_reload** / **-[no]reload**
-
- Controls whether or not MAME treats a second button input from a lightgun as
- a reload signal. In this case, MAME will report the gun's position as
- (0,MAX) with the trigger held, which is equivalent to an offscreen reload.
-
- This is only needed for games that required you to shoot offscreen to
- reload, and then only if your gun does not support off screen reloads.
-
- The default is OFF (**-nooffscreen_reload**).
-
- Example:
- .. code-block:: bash
-
- mame lethalen -offscreen_reload
-
.. _mame-commandline-joystickmap:
**-joystick_map** *<map>* / **-joymap** *<map>*
diff --git a/docs/source/commandline/commandline-index.rst b/docs/source/commandline/commandline-index.rst
index 07808ee4445..76f4e5cb5cc 100644
--- a/docs/source/commandline/commandline-index.rst
+++ b/docs/source/commandline/commandline-index.rst
@@ -264,7 +264,6 @@ Core Input Options
| :ref:`[no]multimouse <mame-commandline-nomultimouse>`
| :ref:`[no]steadykey <mame-commandline-nosteadykey>`
| :ref:`[no]ui_active <mame-commandline-uiactive>`
-| :ref:`[no]offscreen_reload <mame-commandline-nooffscreenreload>`
| :ref:`joystick_map <mame-commandline-joystickmap>`
| :ref:`joystick_deadzone <mame-commandline-joystickdeadzone>`
| :ref:`joystick_saturation <mame-commandline-joysticksaturation>`
diff --git a/docs/source/plugins/inputmacro.rst b/docs/source/plugins/inputmacro.rst
index 9ef67625fb3..0a537cd1134 100644
--- a/docs/source/plugins/inputmacro.rst
+++ b/docs/source/plugins/inputmacro.rst
@@ -90,12 +90,17 @@ Each step has delay, duration and input settings:
completing the macro in the case of the final step). You can reset the
setting to one frame by pressing the UI Clear key.
* Set the **Input** settings to the emulated inputs to activate for the step.
- Only non-toggle digital inputs are supported. Select **Add input** to set
- multiple inputs for a step (this option will only appear after you set the
- first input for the initially created step when creating a new macro). If
- the step has multiple inputs, you can highlight an input on the menu and press
- the UI Clear key to delete it (all steps must have at least one input, so you
- can’t delete the only input for a step).
+ Only non-toggle digital inputs and non-wrapping analog inputs are supported.
+ Select **Add input** to set multiple inputs for a step (this option will only
+ appear after you set the first input for the initially created step when
+ creating a new macro). If the step has multiple inputs, you can highlight an
+ input on the menu and press the UI Clear key to delete it (all steps must have
+ at least one input, so you can’t delete the only input for a step).
+* For analog inputs, you can set the desired **Value** that the input should
+ have at each step. You can adjust the value by pressing the UI Left and UI
+ Right keys, or type a numeric value and press the UI Select key to accept the
+ new value. The value will be limited to the valid range for the input.
+ Pressing the UI Clear key will set the default value for the input.
* If the macro has multiple steps, you can select **Delete step** to delete a
step (this options does not appear if the macro only has a single step).
Remember to check that the **On release** and **When held** settings are
@@ -236,3 +241,24 @@ This macro involves steps that activate multiple inputs. The macro will
complete if the activation sequence is released early, allowing you to tap the
key momentarily to perform the move. Holding the activation sequence holds down
the attack button.
+
+Virtua Cop Aim Off-Screen
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This macro allows you to hold a key to simulate pointing the lightgun away from
+the screen:
+
+* **Name**: 1P Aim Off-Screen
+* **Activation combination**: Kbd Alt
+* **On release**: Stop immediately
+* **When held**: Prolong step 1
+* **Step 1**:
+
+ * **Delay (frames)**: 0
+ * **Duration (frames)**: 1
+ * **Input 1**: Lightgun X
+ * **Value (131-630)**: 131
+ * **Input 2**: Lightgun Y
+ * **Value (36-425)**: 36
+
+This macro involves setting analog input values.