Open ghost opened 7 years ago
After fiddling a lot more, I've got lr-genesis-plus-gx and lr-snes9x2010 working with the Raspberry Pi 3 using a mouse as a lightgun by editing and recompiling the source for both cores to use relative coordinates for mice. I'm working on getting lr-nestopia working now*.
*(It seems to be a lot more involved since even setting zapper.fire = 1 doesn't get the zapper to actually fire, and some logs I put in are showing that I'm getting a TRIGGER pull, but I DID get cursor movement working at least by uncommenting some code to connect the Zapper to port 2, it looks like it never gets set it as a potential peripheral device in libretro though and only handled on the core side so until that situation is settled it will continue to have to be accessed via code changes because on the core side it's emulated as device ID 5 after PAD1-4, which obviously wouldn't work enumerated on a per-player basis, so it'll require some bigger changes on that core).
SDL input does not allow me to use the mouse at all on any core, I'm guessing because it needs to rely on an SDL Window context, and on the RPI3 I have to use GL/DispmanX for a video driver, so all it will get to work is keyboard/joystick support for now.
Please let me know if this is valid or not, on the SDL driver you have RETRO_DEVICE_POINTER enabled as a capability, but not in the UDEV driver. Is there a valid reason for that, and does it impact whether or not UDEV will see a pointer device at all as I would expect it would (I haven't done any testing yet with modifying the RetroArch code on my end)?
https://github.com/libretro/RetroArch/blob/master/input/drivers/udev_input.c#L686 https://github.com/libretro/RetroArch/blob/master/input/drivers/sdl_input.c#L397
Putting udev rules on my mice to give them ID_INPUT_TOUCHSCREEN=1 seemed to make them stop working in X11 (Pixel desktop). Removing the rules gets them working again in X.
One last thing, you may possibly want to check into the condition that as I've just seen a mouse can actually technically report EV_ABS not just EV_REL when it's reporting as a mouse and not just as a touchscreen. In which case I'd say it would probably need to go to RETRO_DEVICE_POINTER instead of RETRO_DEVICE_MOUSE, but that's a sticky situation since the code only sets the mouse coordinates in udev_handle_mouse. I suppose you could just treat it the same as you do for touchpad code.
Hi guys, much love to the RetroArch community this software is really awesome and you guys do great work, about 99% of my games I'm playing work perfectly, I'm just having trouble on the lightgun ones. I'm running RetroArch on RetroPie on a Raspberry Pi 3 (v4.1.8).
Here's the issue after I've done some digging, it seems that my touchscreen devices (2) aren't being recognized as touchscreens and I want to use them for lightgun cursor input, just as mice, even though they have Absolute coordinates, so I'm guessing I need something else in place like a udev rule, but I'm pretty new at udev and need some help getting in the right place.
When I start up X server they detect fine and work, but in lightgun games (I'm testing with Safari Hunt / Missile Defense 3-D on Master System, Bayou Billy on NES, and Super Scope 6 on SNES) I'm not getting any cursor movement, just firing. I don't see my touchscreen devices moving around in any of the RetroArch menus, I'm not sure if I'm supposed to.
Mario Paint DOES work with the SNES Mouse selected, just not the gun games, so it just seems to be isolated to the pointer issue.
One of my devices is an AR1100 Touchscreen controller. It reports in Linux as a mouse, but has absolute coordinates. So under /proc/bus/input/devices it lists the handler as a mouse.
The second device is a custom uinput device through a Python script (using python-uinput) and has the ABS_X/ABS_Y and BTN_LEFT properties. The firing does work, just not the movement in any core/menu. It's almost exactly like the mouse device mentioned on the python-uinput site but with ABS_X/Y instead of REL_X/Y for coordinates. I keep track of those positions in variables and it seems to work just fine under X. http://tjjr.fi/sw/python-uinput/
(I'll post the code on request if needed but it's on my Pi and I'm posting from my Windows desktop)
As far as udev rules I tried putting SYMLINK+="input/touchscreen" on any of the devices and it make the appropriate files under /dev/input, I also added ENV{ID_INPUT_TOUCHPAD}="1" and that didn't work.
For reference here's my /etc/udev/rules.d/99-input.rules:
SUBSYSTEM="input", GROUP="input", MODE="0660"
ACTION="add/change", KERNEL="event[0-9]*", ENV{ID_INPUT_TOUCHPAD}="1", SYMLINK+="input/touchscreen"