Add back GZDoom, the feature centric port for all Doom engine games, based on ZDoom. Since LZDoom is no longer developed, let's try to add back the few still active Doom projects.
Since it was removed, besides countless other features addded, it has gained a GLES2/OpenGL2 + Vulkan renderer. Unfortunately, 32bit support has been dropped entirely since 4.9, so 32bit platforms will have to use the 4.8.0 release.
Recent versions auto-detect the available video renderers and can switch to the less intesive GLES2/GL2 renderer, but for old versions (32bit) the preferred renderer has to be set via `vid_preferbackend`.
Besides the mappings parsed from RetroArch's auto-configuration profiles, there's a generic mapping used for gamepads that don't have a profile saved.
Unfortunately this never worked, since the initialization of the mapping - in the `add_mappings` function - had the buttons and hats parameters switched. This changeset fixes this, creating a correct mapping.
The issue was reported in https://retropie.org.uk/forum/topic/35063/, `joy2key_sdl` would crash with a Python3 error since the (wrong) generic mapping would produce the incorrect data type and values for the `filter_active_events` method.
Added a patch for CMake to fix generating/building Bombermaaan with older SDL2/SDL2_mixer:
- on Bullseye/Ubuntu 20.4, `sdl2_mixer-config.cmake` doesn't contain the target aliases in the `SDL2_mixer` namespace.
- on Buster, `sdl2-config.cmake` doesn't contain the target aliases in the `SDL2` namespace and the includes/libraries are not correctly added to the compilation and linkage options.
ENV variables __builder_repo && __builder_branch are used to switch to another repository/branch for building.
This is used to more easily build binaries before branches are merged into master. Primarily for SDL binaries, but simplifies testing for other modules.
Older distcc init.d scripts contain a PATH= line which we were replacing.
Newer distcc init.d scripts exclude it, so we need to insert it before the DAEMON line
Bookworm has changed the RP repo location to 'archive.raspberryp.com', due to a larger RPF operation to leave the .org just for the Foundation.
To detect whether we're running on RasPI OS, make sure we check for the new domain in the output from `apt-cache`.
Since Bullseye, `kodi` should be installed from the RPT repos, since it's build with the necessary patches/optimization directly by the RP folks.
However, the version in the repos don't always overrides the version present in the upstream Debian/Raspbian repositories [1] and installation fails.
Added a workaround to always prefer the Kodi packages originating from archive.raspberrypi.com/archive.raspberrypi.org.
I think Bullseye and previous had 'archive.raspberrypi.org' for RP repostories, while Bookworm has switched to 'archive.raspberrypi.com', so we can't use the URL for pinning. Added a pin based on the 'l'(Location ?) field of the release from the repository.
[1] https://github.com/raspberrypi/bookworm-feedback/issues/144
Switched the Quasi88 upstream repository to the "Quasi88Kai" fork [1], since it has some new developments and also supports SDL2.
Changes in the fork:
* General updates to the build system and migration to CMake
* All files converted to UTF-8
* Many improvements in Windows, X11, GTK and SDL backends
* Add a RetroAchievements-compatible version "RAQUASI88" (only for Windows at this time)
Had to apply a build patch since:
* SDL2 2.0.10 libraries do not provide the SDL:SDL aliases in the `sdl2-config.cmake`
* Buster's GCC (8) is implementing the filesystem C++17 API in `libstdc++fs`
[1] https://github.com/winterheart/quasi88
The original repository has long been abandoned, but several forks are still active. The (most ?) active one has added support for SDL2 (Audio, GameController API) and MIDI (Fluidsynth) among other things and it even has some SDL3 support in the works. [1]
This commit switches the source of the emulator to [1] and adjusts the dependencies, build instructions and files included. When building with Fluidsynth, install a minimal soundfont and also generate a minimal configuration referencing the installed soundfont path.
[1] https://github.com/TurtleBazooka/px68k, based on https://github.com/kenyahiro/px68k, original repository at https://github.com/hissorii/px68k.
Notable changes in this fork.
* Utilizes SDL2 Renderer (GPU), so "sdl-gfx" is unnecessary
* Supports Full-Screen Mode.(F11)
* Soft keyboard (Right click on F12Menu mode)
* SCSI DiskImage support (Can boot from *.HDS)
* Change final screen output to 24bit (RGB565→RGBA8888)
* Support MIDI-Play (Internal/Munt/fluidsynth/USB-MIDI) (NB: didn't find anything in sources about MUNT, I assume is used on Windows as MIDI softsynth)
* Support US-Keyboard layouts. keyconf.dat shoudl be copied into .keropi folder
* Printer output is saved to File
* Can use XBOX like USB-GamePad (hot-pluggable)
* Add support for CyberStick! (DIGITAL/ANALOG mode)
* FileName's UTF8/SJIS automatic detection Japanese display (dedicated table conversion)
Added the SDL12-Compat backend, using a shim library which implements the `sdl1.2` API over SDL2.
The new `sdl12-compat` backend should be used for SDL1 applications when:
* the platform doesn't have `dispmanx` anymore (e.g. `rpi` platforms with RaspiOS Bullseye and later)
* `sdl2` has a working accelerated video & rendering drivers
* not running under `x11` (i.e. KMS)
Note: for SDL1+Videocore specific applications, which use directly the dispmanx/legacy GL stack (e.g. `pcsx-rearmed`, `advmame-1.4`, etc.), the backend will not help.
Since recent kernels don't have the BCM string in `/proc/cpuinfo`, update the Raspberry Pi detection to use the device tree.
Other updates:
* simplifed the selection of the OMX output plugin and port number. Applies only to Pi models 0-4, since Pi5 cannot use OMX
* disabled pre-setting the 'pulse' SDL audio driver for non-OMX/ALSA devices. SDL will try 'pulseaudio' ('pulse' is the SDL 1.2 name) then 'alsa' in this order, so there's no need to force it to 'pulseaudio'. Starting with 2.0.22, SDL supports a list of drivers in the AUDIODEVICE hint, but Buster based systems are not there yet.
Latest mame has an issue linking on Raspberry Pi OS Bullseye. It fails with
/usr/bin/ld: BFD (GNU Binutils for Raspbian) 2.35.2 assertion fail ../../bfd/elf32-arm.c:9876
Work around this by using the gold linker.
Replaced the `mesa-drm` scriptmodule and the `modetest` utility with a new program, based on the [kmsxx](https://github.com/tomba/kmsxx) project.
1. Added a new scriptmodule to install the new modesetting utilities:
* kmsblank - blank screen(s)
* kmstest - set modes and planes and show test pattern on crtcs/planes,
and test page flips
* kmsprint(-rp) - print information about DRM objects (connectors, encoders, video modes, crtcs)
* fbtest - show info about the console framebuffer
It's based on https://github.com/tomba/kmsxx, forked to add a custom `kmsprint-rp` utility which we can use in `runcommand` instead of `modetest`.
Advantages over `modetest`:
- it's based on a simpler standalone project and not part of Mesa, less code.
- it's has a modularized C++ API for working with Cards/Encoders/Connectors/CRTCs/etc, modeled after the DRM API entities
- works with any DRM/KMS card and doesn't have any card specific code like `modetest`
- it's faster than modetest (both when KMS is enabled or disabled)
- can print the analog video modes when the 'composite' output is enabled for RPI. I think `modetest` can be modified to support it, but with `kmsxx` is working without any special handling.
Note that a Debian package of the `kmsxx` upstream project is packaged in Rasberry PI OS (as `kms++-utils`), but it's not part of Debian. Packaging it as part of RetroPie helps with:
- integration with `runcommand`, since we can run our own custom query utility
- resolution switching on other KMS platforms
2. Changes to `runcommand`:
- replaced `modetest` with `kmsprint-rp`. The format for the modeline printing has changed a bit, to make it easier to parse and integrate the result in `runcommand`. In addition to the rounded/integral refresh rate, there's a new column to show a decimal refresh rate; the _[p|n][h|v]sync_ flags have been reformatted as _[h|v]sync[-|+]_.
- simplified the modeline parsing for KMS, taking advantage of the new format
- refresh rate (from KMS modeline) is now be a decimal number (.2f), supported by RetroArch
Modified the 'stop' action to use `start-stop-daemon` [1] instead of a simple `pkill`.
The advantage is that we don't need to use `sleep` to ensure the script is stopped, since `start-stop-daemon` monitors the process and will exit when is stopped. The `retry` action is to send a SIGKILL after 1 second, to ensure the process is stopped.
The modification will shorten the time it takes to 'stop' the joystick handling utility, since we don't have to wait - unconditionally - for 1 sec every stop. This will shorten the runtime of `runcommand` .
[1] https://man7.org/linux/man-pages/man8/start-stop-daemon.8.html. Since it's part of `dpkg`, it's basically present on every Debian based system.
On RasPI OS 11/12 (bullseye/bookworm) the `vcgencmd` command has moved completely to `/usr/bin`, while on Buster it's just a symlink from `/usr/bin/` to `/opt/vc/bin`. Remove the full path to the command and just check whether is't in our `$PATH` before running.
Check if '/dev/dri/card0' exists before running `$KMSTOOL` (now 'modetest') to check for kernel modesettings support.
This avoids 'modetest' being executed and removes almost 2 sec from the `runcommand` runtime on a Pi3.
The 'xorg' (meta)-package will install the necessary packages to run an Xorg server and to launch applications under an Xorg environment.
We need to map 'xorg' for:
- Pi5 needs an additional package that provides configuration for Xorg, without it the server will not start. Unfortunately the package has no reverse dependency (for now), so it must be installed explicitely.
- One of the recommended packages installed is the 'xserver-xorg-legacy' package, which breaks our x11 apps launched from `runcommand`. We already uninstall it when the setup script starts (regardless of how it was installed), but let's not install it ourselves when 'xorg' is a dependency for one of our own scriptmodules.
NOTE: `runcommand` breakage under `-legacy` is due to our redirection of STDIN/STDOUT. The `-legacy` provided wrapper checks whether the current controlling tty is a 'real console' tty by looking at the major/minor device numbers and bails out if it's not 4/1.
Add the `xset` commands to disable the display powersave and screen blanking, since gamepad activity is ignored by Xorg and the display will go to sleep if no keyboard/mouse is active.
I removed the script launchers ccbee7c05a, but the `xset` commands haven't been added `XINIT-WM` launchers.
Extend the XINIT: launch prefix with two new ones in order to start a window manager before an x11 application is started.
XINIT-WM: will start a window manager without the cursor
XINIT-WMC: will start a window manager with the cursor
This is similar to how the 'x11' backend starts an application, but without additional configuration set in 'backends.cfg'.
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.
Upgrading via 'apt' the Bluez package with a the version from Debian updates will overwrite the RP package. This breaks pairing for some gamepads, thus try to always have installed the RP package.
Pin the package so it's always installed/updated from archive.raspberrypi.org on RaspiOS 10 'Buster'.
Added a related change to how 'apt' is run when updating from `raspbiantoolsz:
* add '--allow-downgrades' to make sure that 'bluez' is retrieved from the RP repos if it was already upgraded by an upstream update.