Switched SDLTRS to be built from https://gitlab.com/jengun/sdltrs, which is an active fork of the original SDLTRS emulator.
* use the SDL2 branch, which should be more portable (KMS/Odroid/etc.)
* create a minimum configuration for $HOME/.sdltrs.t8c
* although not explicitely specified, the main license seems to be BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)
* simplify a bit the emulator starting commands
* makefile patch is still needed for our compiler flags
* CPU_FLAGS isn't used so not sure what happened here - mistake or I missed out something.
* use CXXFLAGS for the additional videocore flags, to override makefile logic
* re-add make clean
Makefile for lr-flycast has a lot of copy and paste and unneeded compiler parameters. Although moving the
logic to the module could still break with Makefile changes, it gives us more control over both
compiler parameters, as well as adding other platforms without having to upstream changes.
Removed !mali flag but this will need testing still. Current changes are tested on rpi+videocore, rpi+mesa,
and rpi4(aarch64)+mesa
Also removed DISTCC workaround as this is now built without Link Time Optimisation. The Makefile patch is also
dropped, as this is no longer needed.
There has been a lot of contributions to this module, and unfortunately some of the logic has become rather obfuscated,
with a lot of duplication. This is a combination of an earlier changeset I had, but adding aarch64 needed enough logic
changes, it made sense to include it all. There are more improvements needed, but this de-duplicates some of the logic.
Vero4k may need a revisit.
Changes include:
* temporarily disable rice and gles2n64 for aarch64 due to build errors (just HOST checking errors so may well be easily fixed)
* remove a lot of vero4k specific blocks in favour of the mali flag
* enable mali for module (builds ok on odroid xu)
* check for 32bit to enable binaries for rpi
* use -mcpu only for rpi3/rpi4 aarch targets - but we need to revisit and simplify gcc params for 32bit targets also
* config file symlinking should be done only as part of install
* makeUserDir $md_conf_root/$md_id is needed as the config directory won't be created until addPort otherwise
lr-gpsp:
cpu_threaded.c built with -O2 on gcc 8 produces a non working binary. This source already had
a different optimisation level from the rest of the code (O2 vs O3). However, on gcc-8 it causes
a non working binary when built with anything other than O0, but this could have some performance
issues (would need testing on a rpi1).
I compared all the different optimisation flags enabled by O1 and also with any changes from gcc-6,
but not all GCC optimisations are controllable from flags. It was not possible to produce a working
binary with O1 - even disabling all the configurable optimisations enabled by O1.
The issue is most likely undefined behaviour in this file (which has a lot of large macros), and it
probably needs some fixes. However it could be a bug in the gcc-8 optimiser code.
As the issue isn't present with gcc-6, and as gcc-6 is available on Debian buster, the easiest
workaround is to just force the code to be build with gcc-6.
Also adjusted the makefile to pass parameters for the make clean, as some platform specific objects
are not removed otherwise.
gpsp:
Forced gcc-6 as with lr-gpsp.
Simplified the module flags to just include videocore platforms.
Before setting the SDL2 env variables that configure the modesetting for DRM/KMS, validate the CrtcId/ModeId tuple against the current list reported by `modetest`. Changes in the kernel DRM driver could make the existing modesetting configuration (stored in `videomodes.cfg`) invalid because of different CrtcId and/or ModeId in new versions of the driver.