Added an input configuration script which will produce a SDL(2) gamecontroller mapping ([1]) based on the user's choices in the EmulationStation input configuration. The result of the mapping is saved in `/opt/retropie/configs/all/sdl2_gamecontrollerdb.txt`, which can be referenced by `runcommand` to load the mappings through SDL hints ([2] or [3]).
Since we're not trying to overwrite the existing built-in mappings, I've added a query method which needs `python3-sdl2` as dependency.
The mapping produced should follow the user's choices as far as inputs are concerned. The only 'outlier' is the 'hotkey enable' button, which is mapped to the 'Guide' SDL gamepad button IF its value is different than the _Select_ input. This way the extra button present on various gamepads (Xbox/PS) or a dedicated button chosen by the user can be mapped separately.
Ref:
[1] https://wiki.libsdl.org/SDL2/SDL_GameControllerAddMapping
[2] https://wiki.libsdl.org/SDL2/SDL_HINT_GAMECONTROLLERCONFIG
[3] https://wiki.libsdl.org/SDL2/SDL_HINT_GAMECONTROLLERCONFIG_FILE
When running under Gnome/Wayland on Ubuntu 22.04 default configuration, the '--fullscreen-borderless' is not actually fullscreen.
The top horizontal panel (?) is still visible and the EmulationStation window is actually pushed down.
Running with just '--fullscreen' is enough, but this is the default, thus there's no need to add any additional parameters when Gnome/Wayland is the current session.
Tested on an updated Ubuntu 22.04, with the default Gnome session.
The last runtime detection changes for the build instructions enable the GL21 renderer only on non-RPI platforms.
The V3D Mesa driver supports OpenGL 2.1, so enable the GL21 renderer when it's used on a Raspberry Pi.
Without this change, the build will use the GL1.4 renderer.
The "X is running" test in emulationstation startup script is deprecated. X was replaced by Xorg a long time ago (pre Debian stretch and Ubuntu bionic). The test could be modified to support Xorg, but emulationstation runs quiet well under x11. Just remove it.
Emulationstation has focus problems under Ubuntu 22.04's "GNOME on Wayland" session. Don't use SDL2's wayland driver and run emulationstation with --fullscreen-borderless if desktop session is "GNOME on Wayland".
I have done some tests running weston/wayland from CLI with a rpi4/raspbian-lite. After startup of weston $XDG_SESSION_TYPE is still "tty". If I start a weston/wayland session with graphical login (display manager sddm or gdm3) $XDG_SESSION_TYPE is "wayland". $WAYLAND_DISPLAY can be found in both constellations and seems to be more reliable. On a rpi4 $WAYLAND_DISPLAY=wayland-0. Just replace $XDG_SESSION_TYPE with $WAYLAND_DISPLAY.
If a Gnome or Weston Wayland session is started under Ubuntu 22.04, SDL2 falls back to x11 videodriver. There is ARM hardware which runs much faster and without graphical glitches if the SDL2 wayland video driver is used. To prevent SDL2 from using x11 video driver, export "SDL_VIDEODRIVER=wayland" if Wayland session is detected.
There was a mix of compareVersions "$__os_debian_ver" OP $arg and [[ "$__os_debian_ver OP $arg ]] around the code.
As $__os_debian_ver is always an integer, use the bash built in operators for performance.
The compareVersions call is significantly slower as it uses an external command (dpkg).
Starting with RaspiOS 'bullseye', the `omxplayer` RPI video player is no longer supported.
Use the new EmulationStation build option (`OMX`) to enable the `omxplayer` bits only for `dispmanx` platforms. The new options is added in https://github.com/RetroPie/EmulationStation/pull/792. The `RPI` build option is used only for pre-setting some program settings on the Raspberry Pi platforms (audio/video memory).
Previously all the module data was in indexed arrays with matching offsets.
Each scriptmodule folder had an initial index and it was incremented per module.
Many package functions expected an index. Indexes were never unique and could change
depending on added modules etc. We also had to convert between them and module IDs.
Now it's all done by module id. There is a numbered index of all modules found, that
increments which is used in the GUI setup menus. But it's not needed by any packaging functions.
md_idx is dropped and the few modules that used it for install checks etc now use md_id.
all packaging functions use the id.
retropie_packages.sh now accepts the module id only.
* if no TTY var is set (as with the ES launch script), try and get it - otherwise xinit will try and start on a VT we don't have access to
* use a single TTY var name in emulationstation launch script
Due to the GLESv1 development headers being dropped for debian buster,
temporarily use the OpenGL driver until GLESv2 support is implemented.
Also remove the experimental driver block from the startup script.
* make sure the hooks and add_system/del_system of es are called from emulationstation-dev
* don't allow both modules installed at once - but don't remove configs when switching.
* fix up retropie.svg install path when called from emulationstation-dev
When configuring "Swap A/B buttons in ES", users will most likely
need to enable the equivalent option (menu_swap_ok_cancel_buttons)
in RetroArch. Do this automatically to minimize user confusion.