Allows mode selection for X11 targets. This is currently not compatible
with emulators launched via xinit, but better support for this use case
can be extended later.
* detect presence of KMS environment via "modetest" tool, which has
priority over "tvservice" to ensure FKMS targets work as expected.
* rename original functions to "get_all_tvs_modes" and "get_tvs_mode_info"
* implement get_all_kms_modes and get_kms_mode_info functions
* disable framebuffer resolution setting, as the KMS emulated framebuffer has
limited depth/resolution change capabilities.
* %XRES% passes the current frame width
* %YRES% passes the frame height
The variable replace is done after a mode switch (even though mode-switching
isn't possible on a bare KMS framebuffer).
* Add 0.3 second delay to joy2key_start; this will ensure that button
mapping is functional by the time the function returns.
* Re-arrange the joy2key start/stop calls so that button mapping is ready
*before* the on-screen menu is presented, to avoid the common issue of
missed button presses when the on-screen prompt appears.
joy2key:
* Protect signal_handler from concurrent calls via multiple kill requests
* Daemonize to background as soon as signal handlers are registered;
guarantees that joy2keyStart/start_joy2key returns only when the script
is in a functional state (and thus the stop calls can't run too early).
* Ensure tty_fd is also closed on exit.
* Remove parent PID check (not useful when script daemonizes itself).
helper/runcommand:
* Don't run script in background.
* Remove parent PID variable (no longer needed).
* Clear joy2key PID upon kill to avoid unbalanced stop calls (although
the script now protects from this via signal_handler).
* Add 1 second sleep to stop functions to avoid problems on instant
stop/start (e.g. wikiview).
The sys.exit() function actually calls an exception (SystemExit), but our
script handles naked exceptions which can result in the script not terminating
properly. Fix by ensuring that all exceptions specify the relevant exception type only.
Additionally:
* Send default TERM signal, as issuing INT during early initialization can raise a KeyboardInterrupt exception.
* Open tty with 'append' flag to avoid ghost input
* Add check for 'js_fds' to avoid rare exception on quit during early init
* Modify script to quit automatically when parent process exits.
* Add joy2keyStop/stop_joy2key for certain rare edge cases.
The VIDEO_CONF variable is initialised at the beginning of the
script with the appropiate file path. However, the default_mode()
function does not use it and instead hard-codes the file path.
The location of the name, id/vendor & id/product descriptors are not
consistent with udev's DEVPATH for every kernel driver.
Fix this by properly normalizing the path correctly, then shift to the parent
directory if the "name" file does not exist.
Fixes the hid_sony driver.
This reverts commit d4c653a3d2.
on the RPI1 the wait in runcommand can sit there forever. Adding a sleep helps, but
this isn't ideal. Problem is likely due to the signal hander not yet being set up on the rpi1
when launching joy2key when the kill is executed.
The INT signal won't kill the python process if called before the
script has had time to register the signal handler. Avoid this case
by using the USR1 signal, which will terminate the process under the
same conditions.
Unfortunately, terminating the process will lead to unwanted terminal
output - "User defined signal 1" - due to bash job control monitoring.
Solve this by adding a wait command that redirects the process output
to /dev/null.
Additionally, register joy2key's signal handler for INT and TERM cases
so that it will gracefully exit in all possible cases.
* flag is set in module, and file RP-NEWBRCMLIBS is created in "$md_inst" on install (not on binary install,
but updated binaries will include the file when created)
* runcommand checks for the file, and if it doesn't exist, switches SDL to use the old library names.
this will allow us to add the flag for new modules so we have compatibility during the switcher. the
flag / logic from runcommand can be removed in the future
When a system's default emulator is not yet selected, the automatic invocation of choose_emulator function can be erratic (most notably with the joy2key process exiting prematurely). Avoid this issue by disabling the cancel button when invoked in this way.
* Do verification on copy of default_button_codes for each device
(so missing buttons on one device are not pruned from all others)
* Add exception handling for a/b swap to avoid missing buttons blocking
script execution
* Allow dpad control in addition to axis for cursor keys
* Verify existence of keys before mapping
The cursor keys will now be mapped to both the axis and dpad, but if
the dpad is not present, only the axis mappings will be used.
This should also make it possible to add default mappings for X/Y
buttons without having to worry about pad compatibility.
* scripts must be called "name.sh" and live in /opt/retropie/configs/all/runcommand-menu
* scripts are passed the same parameters as onstart / onend ("$SYSTEM" "$EMULATOR" "$ROM" "$COMMAND")
* exit code of 0 returns to user menu, 1 exits without launching, and 2 exits and launches rom
When running under X and showing the launching image with `feh`, if the user "press a button" to access the runcommand menu, the image stays in front of the terminal. This change kills the `feh` if the user "press a button".
* if device parameter is /dev/input/jsX it will read from all joysticks
* if a joystick is removed or another reconnected it will be picked up
* default runcommand and helpers to use all joypads