Updated the dependencies and scripts for python3:
* `python-dbus` no longer exists in Debian 11 'bullseye' or Ubuntu > 20.04, installl the `python3` version
* `python-gobject` has been superseeded by `python(3)-gi`, the current package is just a transitional package that pulls
`python-gi` and the old `python-gobject-2` (deprecated). Update the dependencies and the scripts to use the new package.
* set python3 as interpreter for the helper scripts. Fixed the dict syntax for getting items
EmulationStation 2.10+ supports pixel based positioning in themes. @tomaz82 who authored the code also
redid the base themes to utilise this and also to use other new features such as variables.
This new code will install the carbon-2021 theme by default when the version of EmulationStation is 2.10 or newer.
It will also only show the new carbon-2021 pixel positioned themes to users via the gui if the installed
EmulationStation supports it.
Users upgrading EmulationStation once the latest changes have been merged to the stable branch will get the new
theme installed, but will need to manually switch to it. However the old theme should work fine still. Some older
themes may show some minor spacing issues due to fixed calculations in the ES code for lists etc.
Since v1.9.6 RetroArch changes the way the "analog to digital" works and since then the "forced mode" is need for some cores (eg. lr-vice, lr-puae).
https://github.com/libretro/RetroArch/pull/12562
qt5 has been removed in all modern versions of Debian and Ubuntu, and the skyscraper script will not work at all without these changes - this dependency change should not break older versions of these operating systems and the package should install fine.
https://askubuntu.com/a/1335187
runcommand.sh install_bin will remove it, so the check needs to be done first.
users that have already updated will have to manually install joy2key though
There has been no user reports of issues, and fron my own testing I have found no issues why
we may need to force the old version apart from if the python library isn't available.
Move much of the helpers.sh start/stop logic and default parameters to a joy2key wrapper script.
Switch runcommand.sh to use new wrapper script
Add tab button to "y" key for use in edit dialogs
Remove runcommand $md_inst on update. If old joy2key is present in runcommand install, trigger joy2key module install.
Remove system.sh python3-sdl2 dependency check - moved to joy2key_depends
When a hat is mapped to another set of inputs other than D-Pad's up/down/left/right in EmulationStation, the resulting RetroArch mapping can be incorrect.
As an example, the following ES input mapping (obtained by probably mapping the physical D-Pad to the left analog stick inputs in EmulationStation):
<input name="leftanalogdown" type="hat" id="0" value="4"/>
<input name="leftanalogright" type="hat" id="0" value="2"/>
<input name="leftanalogleft" type="hat" id="0" value="8"/>
<input name="leftanalogup" type="hat" id="0" value="1"/>
results in the following incorrect RetroArch input configuration:
input_l_y_plus_btn = "h0leftanalogdown"
input_l_x_plus_btn = "h0leftanalogright"
input_l_x_minus_btn = "h0leftanalogleft"
input_l_y_minus_btn = "h0leftanalogup"
Rather than use `input_name`, map the `input_value` to the hat's cardinal directions (up/right/down/left) in the joypad's configuration profile.
Switch to letters for items rather than numerical values to avoid gaps and to make it easier to add items to the
menu without having to renumber items etc, which has happened previously (hence most menus excluding
generated lists don't use number ids in RetroPie).
Remove the "Remove emulator/video mode choice" items and replace with an option in the sub-menu for clearing / removing.
Previously when choosing a default emulator for a rom, (or a default video mode for emulator, emulator + rom etc),
an additional menu item was added below to remove the setting. Although this enabled quick access to remove options
from the main menu, it wasn't that intuitive and doesn't match the way menus work elsewhere in RetroPie.
Now when choosing a default emulator / video mode, there is an option to clear it at the top of the list.
The framebuffer menu now uses the resolution as a key rather than a numbered list (this also fixes the default-item
not working). The video and framebuffer dialogs were merged into one function with some additional descriptions
and menu title information also.
While making these changes a couple of bugs were fixed with default-item functionality - Framebuffer resolution
default-item support was broken as mentioned, but also the main menu also lacked this, so the position wouldn't be
remebered after entering a video menu selection etc.
Added 2 fixes:
* reject malformed hat values for an input in the joystick auto-config file(s).
If it's not one of `h<X>up`, `h<X>right`, `h<X>down`, `h<X>left`, reject the input value.
* fix `SDL_GetError` not being properly shown because of the wrong f-string.
`python3.8(+)` throws a warning for using 'is/is not' with with certain literal types [1].
Simplifying the debug message that shows the `python3-sdl2` wrapper version gets rid of this warning, the end result is the same.
[1] https://docs.python.org/3.8/whatsnew/3.8.html#changes-in-python-behavior
Added a new `joy2key` implementation, using PySDL2 for joystick event handling.
PySDL2 is a python module that wraps SDL2 (and other SDL libraries) using the built-in `ctypes` module.
Pros:
* event handling is simplified a bit, using SDL's event loop.
* (subjective) the code is a bit more structured and easy to follow.
* joystick handling is rewritten based on EmulationStation code, movement is smoother and scrolling is improved.
* support for input repeat to improve scrolling, just keep the input pressed and scrolling continues
Cons:
* module is a bit larger (296 LOC vs 224 in current joy2key.py)
* needs PySDL2 (which might not be packaged, see the notes below) and SDL2
* arguably, device config to keyboard event mapping is more complex (abstracted as InputDev)
Notes:
* availability of PySDL2 as a system package is good, but it's not standard in Debian 10 (stable) at the moment.
The module is present though (as a backport) in Ubuntu 18.04 (and later) and Raspberry Pi OS (Buster).
When it will be universally available, we should probably revisit the code that checks for the version and make it a hard requirement in `get_retropie_depends`, similar to `python3-pyudev`.
* added PgUp/PgDown to the default parameters for `joy2key`, they are mapped in a similar fashion to EmulationStation to the shoulder buttons. This doesn't apply to Runcommand's invocation, since it uses a different set of parameters.
* added a configuration option in `runcommand` for selecting the joy2key version used. Default is the SDL version (when PySDL2 is installed), with the ability to fallback to the previous version (udev based).
This replaces the function __get_current_backends from backends.sh and makes it available to other modules.
Reworded the setBackend function description using emulator.cfg key instead of module_id as some modules
have multiple emulator entries, and the backend config is managed per entry.
/dev/shm/runcommand.info is created early on before the runcomand menu, mode switching and variable
replacements have taken place. This means it can contain incorrect information due to a configuration change,
but will also not include some variable replacements like %XRES%, %YRES% etc.
Saving again fixes this. The original earlier save is still done, in case any runcommand-onstart.sh scripts
utilise it.
0.9.1 is a maintenance release:
"The highlights of this release are better compatibility with current Proton versions, fixes to Xbox One S|X controller support, removal of old dead configuration options, updated and improved documentation, better integration with DKMS, improved logging to aid issue resolving, future proofing the systemd and udev integration, and deprecating support for directional rumble which never properly worked."
The installation has slightly changed, the build was updated accordingly.
This replaces the dispmanx module functionality and reworks the way backend configuration is done,
including adding support for choosing to use X11 for modules using sdl1 or sdl2. A new supplementary
module "backends" handles the configuration (replacing the dispmanx module).
On upgrade /opt/retropie/configs/all/dispmanx.cfg is renamed to /opt/retropie/configs/all/backends.cfg
Existing settings in this file will still work, but will be updated when using the backends configuration.
Previously for some modules that use sdl1, a flag "dispmanx" was set to specify that the code worked
with the sdl1 dispmanx driver on videocore/fkms on the RPI.
This has been replaced with the flags "sdl1" "sdl2" and "sdl1-videocore"
The backend module will use the flags to determine which driver backends are available for current system.
For modules such as advmame which use sdl1 on videocore and sdl2 on other systems, the sdl1-videocore flag
can be used which will only apply to the rpi1-3 using the legacy drivers.
The setDispmanx call to default a module to the dispmanx driver has been replaced with setBackend,
but the setDispmanx function is left for 3rd party module compatibility.
Calls to setDispmanx should be replaced with a call such as:
setBackend "$md_id" "dispmanx"
But support for dispmanx should be checked in the module - eg
hasPlatform "dispmanx" && setBackend "$md_id" "dispmanx"
Module hooks for configure_dispmanx_on / conigure_dispmanx_off are no longer used (only used by fuse).
Instead a function _backend_set_ID is called, with the backend to use, and a force parameter.
By default no existing backend configuration is changed when calling setBackend, unless an additional
parameter of 1 is added. This is so a module won't overwrite a user's existing configuration.
If a module is set to launch under dispmanx, runcommand will handle it as before, but will also
now handle launching sdl1 and sdl2 modules under X. It will also run the matchbox-window-manager
which is required by some software.
If switching a module to launch under X it will check for the correct dependencies. If not installed
the user will be asked to confirm installation.
`mawk` (default AWK on Debian) doesn't know about `gensub`, so use a Posix ERE instead.
Fix also the options index when choosing the PulseAudio sink so the correct audio output is chosen.