From b1889b3bf4fe2eb4c0f6521a0a0609bd6a3277fa Mon Sep 17 00:00:00 2001 From: Tovarichtch Date: Sat, 9 Nov 2024 17:07:45 -0500 Subject: [PATCH] add new fusion lightgun firmware --- .../guns/fusion-lightguns/99-fusion-lightguns.rules | 12 ++++++++++++ .../guns/fusion-lightguns/fusion-lightguns-add | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package/batocera/controllers/guns/fusion-lightguns/99-fusion-lightguns.rules b/package/batocera/controllers/guns/fusion-lightguns/99-fusion-lightguns.rules index 6d49cca3783..840962008a4 100755 --- a/package/batocera/controllers/guns/fusion-lightguns/99-fusion-lightguns.rules +++ b/package/batocera/controllers/guns/fusion-lightguns/99-fusion-lightguns.rules @@ -8,5 +8,17 @@ SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Mini P SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Mini P2 Keyboard", ENV{ID_INPUT_JOYSTICK}="0", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_KEYBOARD}="0", ENV{ID_INPUT_KEY}="0", RUN+="/usr/bin/fusion-lightguns-add 2" SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Mini P2 Mouse", ENV{ID_INPUT_JOYSTICK}="0", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_KEYBOARD}="0", ENV{ID_INPUT_KEY}="0", RUN+="/usr/bin/fusion-lightguns-add 2" +# Piggie p1 firmware +SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Piggie 1 Keyboard", ENV{ID_INPUT_JOYSTICK}="0", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_KEYBOARD}="0", ENV{ID_INPUT_KEY}="0", RUN+="/usr/bin/fusion-lightguns-add 1" +SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Piggie 1 Mouse", ENV{ID_INPUT_JOYSTICK}="0", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_KEYBOARD}="0", ENV{ID_INPUT_KEY}="0", RUN+="/usr/bin/fusion-lightguns-add 1" + +# Piggie p2 firmware +SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Piggie 2 Keyboard", ENV{ID_INPUT_JOYSTICK}="0", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_KEYBOARD}="0", ENV{ID_INPUT_KEY}="0", RUN+="/usr/bin/fusion-lightguns-add 2" +SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Piggie 2 Mouse", ENV{ID_INPUT_JOYSTICK}="0", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_KEYBOARD}="0", ENV{ID_INPUT_KEY}="0", RUN+="/usr/bin/fusion-lightguns-add 2" + +# Gamepad event must be disabled on Piggie firmware just like OpenFIRE firmware, this mode is unsupported for now +SUBSYSTEM=="input", ACTION=="add", ATTRS{name}=="Fusion Piggie 1", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_JOYSTICK}="0" +SUBSYSTEM=="input", ACTION=="add", ATTRS{name}=="Fusion Piggie 2", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_JOYSTICK}="0" + # virtual lightgun SUBSYSTEM=="input", KERNEL=="event*", ACTION=="add", ATTRS{name}=="Fusion Lightgun", MODE="0666", ENV{ID_INPUT_JOYSTICK}="0", ENV{ID_INPUT_GUN}="1", ENV{ID_INPUT_KEYBOARD}="0", ENV{ID_INPUT_KEY}="0", ENV{ID_INPUT_MOUSE}="1" diff --git a/package/batocera/controllers/guns/fusion-lightguns/fusion-lightguns-add b/package/batocera/controllers/guns/fusion-lightguns/fusion-lightguns-add index 2208a83892d..163042f5072 100755 --- a/package/batocera/controllers/guns/fusion-lightguns/fusion-lightguns-add +++ b/package/batocera/controllers/guns/fusion-lightguns/fusion-lightguns-add @@ -37,7 +37,7 @@ trylock() { trylock checkRunningPIDAndExit1 -CHILDREN=$(evsieve-helper children "${PARENTHASH}" input usb) +CHILDREN=$(evsieve-helper children "${PARENTHASH}" input usb) | grep -vE "Fusion Piggie( 1| 2)") # remove the joystick from the event cause it duplicates events NDEVS=$(echo "${CHILDREN}" | wc -l) ############