Commit graph

431 commits

Author SHA1 Message Date
Craig Hackney
7a944ff374
Updates to allow building on Ubuntu-22.04.2 with clang 2023-08-10 11:01:02 -07:00
cmitu
b01984a161 input: export additional info for joysticks inputs
Added some extra info to help RetroPie's auto-configuration scripts by exporting the joystick Vendor and Product IDs, which should help with RetroArch's joypad profile generation.

 Since 2.0.14, SDL's joystick name (`SDL_CreateJoystickName`) is a normalized version of the name reported by the OS (culled consecutive spaces, trimming trailing spaces, renaming known joystick names like Xbox/PS). This breaks the input auto-configuration scripts in RetroPie, which generate a config with new name, while the emulators/ports expect to find the OS reported name (e.g. RetroArch - see #3398 [1] for an example).

 This issue is affecting especially PC users, which are not using RetroPie's (old) SDL version and who's RetroArch configuration is incomplete.
Using the Vendor/Product ID would help these situations and support the new SDL versions when added to RetroPie.

[1] https://github.com/RetroPie/RetroPie-Setup/issues/3398
2023-04-13 15:22:33 +01:00
pjft
34b2545b0d
Merge pull request #815 from cmitu/input-vestige
input: remove useless XML node in the temporary output
2022-12-15 07:58:03 +00:00
cmitu
5bc3fba063 input: remove useless XML node in the temporary output
The `<inputAction>` node is useless for the temporary input configuration, so remove it.

Normally, because of the previous `reset` call of the parent document, it would be empty, but I've encountered situations when the memory is not cleared and there's (random binary) garbage added to the temporary configuration file. This results in a broken XML file and the auto-configuration scripts in RetroPie will all fail.
2022-12-15 06:32:57 +00:00
Richard Eklycke
5a6ff039c7 TextureData: Fix memory leak of svgImage 2022-12-04 23:29:44 +01:00
pjft
48b2db560a
Merge pull request #809 from Gemba/fix_num_joystick_assertion
Fixes ES crash after boot on stale SDL joy add/remove events.
2022-08-23 17:13:22 +01:00
pjft
2600ba9bf0
Merge pull request #807 from cmitu/get-the-time
timeutil: fix building with recent `gcc` versions.
2022-08-22 22:00:15 +01:00
Gemba
4ba672b7cd Fixes ES crash after boot on stale SDL joy add/remove events.
This happens whenever a joystick is remved during ES splashscreen. Putting the PR here after initial discussion in forum:

https://retropie.org.uk/forum/topic/33014/failed-assertion-on-connected-joysticks-terminates-emulationstation-on-specific-conditions
2022-08-22 19:11:53 +02:00
cmitu
5ba5498a62 timeutil: fix building with recent gcc versions.
Included `time.h` to get the declarations of `time_t` and `struct tm`.
Should fix building with `gcc` 12.x.
2022-08-20 17:04:51 +01:00
Richard Eklycke
3feff1c4dd FileSystemUtil: Update path cache when creating new directory
With this fix in place, emulationstation will start up correctly
when there is no ~/.emulationstation directory present.
2022-08-20 15:47:48 +02:00
Jools Wills
6451038d2b
Merge pull request #792 from cmitu/audio-changes
RPI support: split omxplayer build option
2022-05-22 20:40:01 +01:00
Aaron Pfeifer
0d9cbb6e16 Fix VideoPlayerComponent not handling multiple child processes needed to be reaped when Scripting events are being fired 2022-05-12 21:00:11 -04:00
cmitu
b99e8c21ba RPI support: add a separate omxplayer build option
Modified the build options and source files to enable `omxplayer` for video previews only when the `OMX` option is used.
Updated the build instructions on RPI accordingly and added some notes about the deprecation of the BRCM GPU drivers in RasPI OS 'Bullseye'.

Previously, the `RPI` build option would be used to add both RPI specific audio settings/VRAM limits AND add `omxplayer` support. However, `omxplayer` does not work with the RPI KMS video driver (`vc4-kms-v3d`) or with a 64bit RPI system, due to the lack of OpenMAX (OMX) API support.
The new RasPi OS ('bullseye') has made the KMS driver the default [1] and doesn't offer `omxplayer` anymore (considered deprecated [2]).

Splitting the OMX support from the RPI option allows to set some default values for RPI systems without automatically adding the `omxplayer` bits.

[1] https://www.raspberrypi.com/news/raspberry-pi-os-debian-bullseye/
[2] https://github.com/popcornmix/omxplayer/commit/1f1d0ccd65
2022-05-07 17:54:05 +01:00
pjft
e26fa8d48b
Merge pull request #784 from Gemba/fb_enhance_cli_help
Brooming of --help output
2022-04-24 22:07:37 +01:00
Gemba
feaf44afac restructured --help output, removed legacy --help output from README.md and
removed surplus SplashScreenProgress switch (always true).
2022-03-20 22:12:13 +01:00
Gemba
69ee73c764 fixes continued scrolling on system leave and reenter navigation 2022-03-01 08:45:17 +01:00
Tomas Jakobsson
c7b3b42efc Skip isDirectory check on known directory paths 2022-02-08 10:19:00 +01:00
Tomas Jakobsson
1e23dc54f2 Merge branch 'master' into game-system-select-events 2022-02-01 16:50:38 +01:00
Tomas Jakobsson
f4cae18e32 Don't wrap if maxWidth is 0 or negative 2022-01-30 20:21:17 +01:00
Jools Wills
3eb9f65872 cosmetic - convert CRLF file to LF 2022-01-30 19:02:49 +00:00
Tomas Jakobsson
367e0b00ea Fix broken lineendings 2022-01-27 15:55:02 +01:00
Tomas Jakobsson
bd2ae7d343
Merge pull request #769 from cmitu/jp-wordwrap
Improve text wrapping (rebased #269)
2022-01-25 10:08:45 +01:00
Tomas Jakobsson
842e8f4f19
Merge pull request #732 from Gemba/fb_minor_err_msg_on_noexec_script
Improved warning message when userscript is not mode 755.
2022-01-25 10:08:02 +01:00
cmitu
bc4f81b547 Improve text wrapping (rebased #269)
This is a re-work of PR#269 and PR#314:

* originally proposed by @eagle0wl and discussed/tested with @zigurana during #269, with the motivation being to accomodate texts in languages that don't use spaces between successive characters and words (e.g. Japanese/Chinese).

* @zigurana created a smaller PR in #314 (now closed), but hasn't been updated after @tomaz82's work that changed the Unicode (UTF8) string handling functions (see #297).

I've taken the changes from @zigurana's PR (#269) and updated the code to use `Utils::String::chars2Unicode`.

I added a smaller change for parsing the text. Since we analyze each Unicode code point now (instead of a string), I replaced the `sizeText` call with a simpler function, which gets the size for just the codepoint being scanned. `lineWidth` is consequently incremended for each Unicode code point or reset on a new line.

The performance of `textWrap` looks similar or better than the previous implementation (based in whitespace tokenization) and the results are similar to what was tested during the initial PR (#269).

**NOTE**: the line breaking for non-whitespace texts is a simple split around Unicode code points. Each language may have additional rules for line breaking in texts (i.e. some characters are not allowed at the end/beginning of a line, etc.). These rules are not implemented in this update, it would require additional text analysis.

Some details on line breaking rules for Japanese/Chinese/Korean languages can be consulted at https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages

Original descriptions for the changes on which this modification is based:

* from @eagl0wl's #269, _refine text wordwrap_:
 > refined single-multibyte text wordwrap.
 > You can now properly wrap Japanese character strings.
 > You can see some screenshot. If necessary, I can present more screenshots.
 >   http://eagle0wl.hatenadiary.jp/entry/2017/10/24/003606

* from @zigurana's #314, _Line-breaking (wrapping) for non ascii strings_
 > New PR (replacing #269).

Closes: #269
Supercedes: #269
2022-01-25 08:05:31 +00:00
Tomas Jakobsson
1aa46958ab Base SVG size on height 2022-01-20 11:33:18 +01:00
Tomas Jakobsson
ab38884a15 Potentially fix multithread issue 2022-01-20 11:33:11 +01:00
Tomas Jakobsson
495753abe6 Silence compiler warnings 2022-01-20 11:33:00 +01:00
Tomas Jakobsson
367277cb35
Merge pull request #770 from cmitu/date-time-format
TimeUtil: use `strftime` for date/time formatting.
2022-01-20 11:23:06 +01:00
Tomas Jakobsson
d4eb62b62c
Merge pull request #766 from TheMasterWho/feature/ScreensaverSlideshowVideos
Feature: Slideshow screensaver video support
2022-01-19 13:26:57 +01:00
Tomas Jakobsson
8675f38bd9
Merge pull request #767 from johnodon/master
Update FileSystemUtil.cpp - Allow for multilevel absolute paths in gamelist.xml
2022-01-18 20:33:24 +01:00
Jools Wills
d6d39e4d95
Merge pull request #762 from cmitu/hidapi
input: disable the SDL2 HIDAPI drivers by default
2022-01-10 19:20:41 +00:00
pjft
13c3300279
Revert default ThreadedLoading option 2021-12-26 09:13:43 +00:00
cmitu
1df4bbfc8e TimeUtil: use strftime for date/time formatting.
The change extends the DateTime formatting options and simplifies a bit the code.
2021-12-20 12:36:20 +02:00
TheMasterWho
300828e445
Rename instances of image to media in SlideShow Screensaver mode
* renamed image to media and added setting rename function

* replaced references to 'image' with 'media' and removed hardcoded video extensions

* fixed a bug when checking a null path
2021-10-10 16:00:20 -04:00
johnodon
a2ff3f035a
Update FileSystemUtil.cpp 2021-09-13 12:13:53 -04:00
TheMasterWho
0b5e9a7cb3 refactored ScreenSaver startScreenSaver method to allow video files in slideshow mode 2021-09-06 23:11:42 -04:00
cmitu
b19b1b0ffb input: disable the SDL2 HIDAPI drivers by default
This ensures that configurations created before HIDAPI drivers were enabled by default (2.0.12)
will work when EmulationStation uses a newer SDL2 version.

Using the HIDAPI drivers may produce a different name for joysticks and pottentially changes the mapping.
Example using a PS4 (Dualshock 4) controller:
 - without HIDAPI, the controller is named "Wireless Controller", with HIDAPI enabled is named "PS4 Controller"
 - without HIDAPI, the D-Pad is detected as a HAT, but with the drivers enabled it's detected as a series of buttons
 - the device GUID is different between the 2 configurations
The different name would probably break also the input configuration script for RetroArch, which doesn't use SDL2 as default input driver and would receive a wrong name and wrong mappings.

Note that the HIDAPI drivers are available just for a few controller models (PS4/PS4/Amazon Luna/Stadia/Xbox360(w)/Xbox One/Steam),
but these controllers are widely used and breaking their configuration would cause much confusion.
2021-08-20 16:58:48 +01:00
Gemba
ee89794993 Improved randomisation: card deck approach, use ranlux48 and random_device for seed
- Use C++11 built-in ranlux48 and random_device for seeding
- Shuffles systems (aso.) like a card deck and picks top system until empty, then shuffles again
- Fixes the flaws of the current random implementation: Real 1/N chance for an element in a set of N
- Minor refactorings
2021-07-13 11:42:22 +02:00
EnsignRutherford
40898ffc22 Changed the placement of the screensaver-start event to occur before the screensaver is started as that will fire off an event depending on the setting. 2021-06-19 12:04:44 -04:00
John Rassa
62fd08c26d
Merge pull request #666 from benjdero/simplify-grid-update
Simplify grid tiles update code
2021-05-29 09:10:15 -04:00
pjft
584f741b8e
Merge pull request #745 from Gemba/fb_no_confirm_quit
CLI option --no-confirm-quit for skipping the confirm dialog on quit …
2021-05-21 07:44:47 +01:00
Ryan McClelland
1bc75ed9b6 handle error while reading file
tellg can report -1 if there was an error while reading the file, because it was casted to a size_t type which is unsigned, this will become 18446744073709551615. It will then attempt to allocate that many bytes and of course crash. This will just return an empty resource if there was an error.
2021-05-20 23:28:36 -07:00
EnsignRutherford
077db00d59 Added an additional optional parameter to "Scripting" module and added code to fire an event when ES is configured to bring up a startup system. 2021-05-18 12:58:22 -04:00
EnsignRutherford
f6ae6e09c1 Changes necessary to implement Scripting events for "game-select", "system-select" and "screeensaver-game-select". 2021-05-17 11:29:14 -04:00
Ryan McClelland
3c4117bc5e fix issue with svg cropping the width 2021-05-10 12:05:24 -07:00
Tomas Jakobsson
29223d9a2e ProfilingUtil 2021-05-06 08:52:41 +02:00
pjft
e6f5880da0
Merge pull request #740 from Gemba/fb_fullscreen_paging_with_lr_lb
Full screen paging in gamelist view with lb/rb
2021-04-17 09:38:55 +01:00
Gemba
f85ac44257 CLI option --no-confirm-quit for skipping the confirm dialog on quit actions 2021-04-12 21:47:30 +02:00
Gemba
3b8058da7c Feature: Remove from favorites/collections with double press of Y button 2021-04-11 19:09:01 +02:00
Gemba
014af4afa2 full screen paging in gamelist view with lb/rb 2021-04-05 18:40:52 +02:00