Commit graph

220 commits

Author SHA1 Message Date
Conn O'Griofa
c6ee671d59 runcommand: improve retroarch KMS support
On KMS systems, hide the retroarch render resolution option, and
populate the target mode (including fullscreen flag) instead.
2019-12-30 20:19:06 +00:00
Conn O'Griofa
b7a3caa437 runcommand: update for X11 modesetting
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.
2019-12-30 20:19:06 +00:00
Conn O'Griofa
16a1670cd9 runcommand: update for KMS modesetting
* 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.
2019-12-30 20:19:06 +00:00
Conn O'Griofa
eea3b8f75c runcommand: add support for 768p resolutions 2019-08-16 03:16:34 +01:00
Conn O'Griofa
85c2908f36 runcommand: add support for generic kms
* Add fbi and fbset to depends for generic kms targets
* Ensure %XRES% and %YRES% is available to runcommand for generic kms targets
2019-08-16 03:15:53 +01:00
Conn O'Griofa
39a6f67ad7 runcommand: allow passing of x/y resolution for kms
* %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).
2019-07-11 07:44:35 +01:00
Conn O'Griofa
305a359f6a runcommand: let retroarch run in X session
Previously, retroarch would fail to launch from an xinit session due to
the xinit server arguments not being appended correctly.
2019-07-04 15:34:07 +01:00
Conn O'Griofa
9ab553f5b9 runcommand: improve joy2key interactivity
* 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.
2019-03-17 03:58:15 +00:00
Conn O'Griofa
750a61e48f joy2key: daemonize to prevent early-init related errors
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).
2019-03-17 01:12:08 +00:00
Conn O'Griofa
0311a953fd joy2key: protect against IndexError and KeyError exceptions
Various IndexError or KeyError exception could occur if 'a', 'b', 'x' or 'y'
mappings were not available due to arrays accessing unexpected elements.
2019-03-13 08:11:50 +00:00
Conn O'Griofa
f614804f23 joy2key: fix sys.exit() by avoiding naked exceptions
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.
2019-03-10 02:43:12 +00:00
Jools Wills
227da16c09 runcommand - detect retroarch by emulator id not command string 2018-12-06 14:38:16 +00:00
Jools Wills
96d61cb69f runcommand - remove help reference to snes (probably was supposed to reference system in question but not needed 2018-10-22 23:46:35 +01:00
Jools Wills
60405b0313 runcommand - don't disable joystick if menu is disabled - fixes #2515
* if there is no default emulator chosen then you will not be able to navigate the default emulator menu.
2018-10-22 23:44:27 +01:00
Hugo Hromic
d693761a7c runcommand - use existing VIDEO_CONF variable
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.
2018-08-15 22:22:04 +01:00
Jools Wills
7ec5e2e5ea runcommand.sh - escape $ in commandline before doing eval to avoid variable expansion - fixes #2386 2018-05-07 18:01:51 +01:00
Conn O'Griofa
e92b039947 joy2key: normalize device path & check parent directory
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.
2018-03-14 20:52:32 +00:00
Jools Wills
abd0bd74e1 runcommand - call runcommand-onend.sh when exiting without launching - fixes #2291 2018-02-12 11:55:05 +00:00
Jools Wills
d983a738d4 Revert "joy2key: use USR1 signal handler with more graceful exit handling"
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.
2018-01-31 18:10:21 +00:00
Jools Wills
083e32c898 remove newbrcmlibs flag as all binaries that link against the libraries have been rebuilt 2017-11-22 19:23:04 +00:00
Conn O'Griofa
d4c653a3d2 joy2key: use USR1 signal handler with more graceful exit handling
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.
2017-11-02 01:14:47 +00:00
Dan McGoo
5d72fcbd1a Fix for joy2key.py related to issue #1798. 2017-10-18 22:32:20 +09:00
Jools Wills
ee41a3f613 added new flag "newbrcmlibs" for management of switch to renamed libbrcm* gles libs #2091
* 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
2017-10-08 15:26:23 +01:00
Conn O'Griofa
208f156a14 runcommand: fix default emulator dialog behaviour
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.
2017-09-20 00:51:19 +00:00
Jools Wills
042cdef9ac variable quoting 2017-09-19 15:36:32 +01:00
Steve Robb
a2d4ecdce8 Allow multiple instances of the same token in an emulator command. 2017-08-27 15:21:43 +01:00
Conn O'Griofa
eb2c3681aa joy2key: fix key verification for multiple devices
* 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
2017-07-28 06:12:19 +01:00
Conn
96e6efca46 joy2key: implement key verification & dpad support
* 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.
2017-07-20 08:05:45 +01:00
slajerek
056c988736 fix for PlayStation DS4 controller lagging due to a badly placed time.sleep and long time of processing large number of accelerometer events 2017-07-11 22:03:48 +02:00
Jools Wills
e4210872f4 runcommand - add user menu
* 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
2017-06-16 17:10:05 +01:00
meleu
967d323d6b joy2key gets button maps from retroarch configs 2017-05-21 17:50:11 -03:00
Jools Wills
f91aeb8bfd runcommand - added sleep after feh with the image delay so it matches fbi delay. 2017-03-29 15:56:43 +01:00
Jools Wills
c16f670ff3 runcommand - added configurable delay time for launch images 2017-03-29 15:53:36 +01:00
Lauri Hakko
ecc75e6d7b --frames isn't used by retroarch anymore 2017-03-04 20:41:08 +02:00
Jools Wills
fd64440857 runcommand - fix per emulator+rom video mode loading - fixes #1869 2017-02-01 19:30:04 +00:00
Jools Wills
8587dcaac7 runcommand - add additional render/fb resolutions / share list for both 2017-01-12 21:28:39 +00:00
meleu
6828887974 kill "feh" when invoking runcommand menu
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".
2017-01-09 20:59:20 -02:00
Jools Wills
991b4a3665 fix for launching X applications from ES on recent Xserver - fixes #1805 2016-12-27 21:56:27 +00:00
Jools Wills
12901a53b1 joy2key - support reading from multiple joysticks
* 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
2016-12-21 23:48:15 +00:00
Jools Wills
67e2e74732 runcommand - support launch artwork when running under X11 via feh 2016-12-07 21:06:56 +00:00
Jools Wills
4bd518e2b2 runcommand - only show art in IS_SYS mode 2016-12-07 20:28:53 +00:00
Jools Wills
0236bb73d9 runcommand - quoting 2016-12-07 20:27:46 +00:00
Jools Wills
5b0830c17a runcommand - add support for a per rom custom launching image - closes #1781 - thanks to meleu. 2016-12-07 20:16:04 +00:00
Jools Wills
849f631085 runcommand - fix copying of mode array #1767 2016-11-28 16:55:27 +00:00
Jools Wills
d9bc6e55e6 runcommand - save and restore framebuffer depth 2016-11-25 22:18:30 +00:00
Jools Wills
b2de74673f test for character device for user supplied __joy2key_dev 2016-11-25 16:59:03 +00:00
Jools Wills
1b2141718e runcommand - still use device name from $__joy2key_dev if set 2016-11-25 16:15:41 +00:00
Jools Wills
d53eeb62c9 runcommand - fix config key names after globals capitalisation - fixes #1745 2016-11-17 03:15:11 +00:00
Jools Wills
5e369663b7 styleguide / cleanups 2016-11-13 23:32:34 +00:00
Jools Wills
61f54ae87d runcommand - remove get_sys_command params 2016-11-13 14:29:36 +00:00