Commit Graph

1726 Commits

Author SHA1 Message Date
Apteryks 274cd419fa
Honor the LIBRETRO_DATABASE_DIRECTORY environment variable. (#17431)
* Partially revert a change made in 69ceb95ddc.

The change caused the 'libretro_directory' config option to always
revert to the default value, which was not intended behavior.

Reported-by: Michael Cook

* platform: Honor the LIBRETRO_DATABASE_DIRECTORY environment variable.

This is a follow-up to commit 69ceb95ddc.

* frontend/drivers/platform_unix.c
(libretro_database_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_DATABASE to the value of
the LIBRETRO_DATABASE_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.
* configuration.c (config_load_file)
<libretro_database_directory>: New variable. Use the values of
the LIBRETRO_DATABASE_DIRECTORY environment variables instead of their
corresponding configured values, when set.
* docs/retroarch.6: Document.
* retroarch.c (retroarch_print_help): List supported environment
variables, and cross-reference the man page.
2025-01-19 15:25:28 +01:00
sonninnos aefadc04c7
Analog to Digital refactor (#17429) 2025-01-18 02:19:01 +01:00
Apteryks 69ceb95ddc
Add libretro assets directory search path, and have environment variables override configured values (#17054)
* platform_win32: Fix sizeof for DEFAULT_DIR_PLAYLIST.

* frontend/drivers/platform_win32.c (frontend_win32_env_get): Check
the size of correct destination array.

* frontend: Honor the LIBRETRO_ASSETS_DIRECTORY environment variable.

This builds on 763fcd8267 ("unix, win32: Allow set the default
libretro_directory via environment variable") to also allow specifying
the assets directory via an environment variable.

* frontend/drivers/platform_unix.c (frontend_unix_get_env)
<libretro_assets_directory> New variable. Use it to set
DEFAULT_DIR_ASSETS, when available.
* frontend/drivers/platform_win32.c (frontend_win32_env_get): Likewise.

* platform: Honor the LIBRETRO_DIRECTORY environment variable.

Until now, and unlike the defaut core directory, the default
core *info* directory would be hard-coded relative to the installation
directory. Honor the LIBRETRO_DIRECTORY environment variable the same
instead.

* frontend/drivers/platform_unix.c (frontend_unix_get_env): Set
DEFAULT_DIR_CORE_INFO default to the value of the LIBRETRO_DIRECTORY
environment variable, if available.
* frontend/drivers/platform_win32.c (frontend_win32_env_get): Likewise.

* platform: Honor the LIBRETRO_AUTOCONFIG_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_autoconfig_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_AUTOCONFIG to the value of
the LIBRETRO_AUTOCONFIG_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* platform: Honor the LIBRETRO_VIDEO_FILTER_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_video_filter_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_VIDEO_FILTER to the value of
the LIBRETRO_VIDEO_FILTER_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* platform: Honor the LIBRETRO_VIDEO_SHADER_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_video_shader_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_SHADER to the value of
the LIBRETRO_VIDEO_SHADER_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* platform: Honor the LIBRETRO_SYSTEM_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_system_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_SYSTEM to the value of
the LIBRETRO_SYSTEM_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* configuration: Have environment variables override configuration.

Because the configuration file is systematically written when
RetroArch terminates, persisting any previous default/configured
value, setting the LIBRETRO_DIRECTORY, LIBRETRO_ASSETS_DIRECTORY, etc.
environment variables would not have an effect unless the
retroarch.cfg configuration file was cleared.

This seems to go against the common expectation that environment
variables are set by users to *override* the default behavior or
configuration of an application.

* configuration.c (config_load_file) <libretro_directory>
<libretro_assets_directory, libretro_autoconfig_directory>
<libretro_system_directory, libretro_video_filter_directory>
<libretro_video_shader_directory>: New variables. Use the values of
the LIBRETRO_DIRECTORY, LIBRETRO_ASSETS_DIRECTORY,
LIBRETRO_AUTOCONFIG_DIRECTORY, LIBRETRO_SYSTEM_DIRECTORY,
LIBRETRO_VIDEO_FILTER_DIRECTORY and LIBRETRO_VIDEO_SHADER_DIRECTORY
environment variables instead of their corresponding configured
values, when set.
* docs/retroarch.6: Document the environment variables honored and
their behavior.
2025-01-17 20:04:23 +01:00
LibretroAdmin 16209a0936 (configuration.c) Cleanups/remove some redundant char buffers
(rcheevos) Fix warning
2025-01-17 12:32:54 +01:00
LibretroAdmin 7e7224196a Avoid some strlens, and also return size_t in more string
modification functions
2025-01-12 23:39:29 +01:00
neil4 6412f4feef
Overlay: Add Analog Recentering Zone (#17339) 2025-01-04 03:19:02 +01:00
Eric Warmenhoven 53d9452439
Change config_get_path/array return back to bool (#17333) 2025-01-02 14:35:33 +01:00
LibretroAdmin 1e656261b0 Local len variables need to have '_' prefix 2024-12-30 14:03:58 +01:00
LibretroAdmin 0d4eeb647a Warning cleanups/unused variables removal 2024-12-27 15:39:32 +01:00
LibretroAdmin 18c85b5ccd Cleanups -
* Less string copies
* Some general cleanups
* Add extra param to runloop_message_queue_push so we can pass size_t
of the message
* Consistent conventions for local variable usage for certain things
2024-12-27 15:13:45 +01:00
libretroadmin 51e706007b String handling cleanups 2024-12-25 19:06:04 +01:00
libretroadmin 44238e909f Consistent viewport naming conventions 2024-12-24 22:50:51 +01:00
libretroadmin 2cfdccc085 Less string intermediary copies 2024-12-24 18:46:22 +01:00
libretroadmin f8ffcef86c Cleanups 2024-12-24 06:42:59 +01:00
Viačasłaŭ 284161057d
Add microphone support via PipeWire (#17279) 2024-12-23 13:40:35 -08:00
libretroadmin b789e6ee56 More style nits 2024-12-23 05:47:29 +01:00
Viačasłaŭ 963ffc0e77
Add PipeWire audio driver (#17271) 2024-12-19 22:11:27 -08:00
libretroadmin 17fc55c762 fill_pathname_parent_dir_name - small cleanups 2024-12-19 21:05:43 +01:00
Eric Warmenhoven 99c2676efa
Add option to load overlay based on system name (#17233) 2024-12-07 23:58:33 -08:00
Eric Warmenhoven 6a17201d70
ios: fix saving overrides always including libretro_directory (#17205) 2024-11-25 03:18:51 -08:00
zoltanvb 3d221f2c99
Fix autoconf profile saving for devices not in their default port. (#17156)
User slot (player #) and joypad driver port is by default the same, but
it can be changed either manually or automatically (reserved device).
Use the correct index for detecting values associated with the port.
2024-11-03 15:59:30 -08:00
Eric Warmenhoven 99610f0de6
macOS: fix setting core download url based on rosetta (#17147) 2024-11-02 04:04:02 -07:00
Eric Warmenhoven 56810c4a46
apple: default to mfi controller instead of sdl2 (#17133) 2024-10-29 12:05:48 -07:00
sonninnos 84b58dd001
Pixel perfect integer scaling improvements (#17098) 2024-10-14 14:44:10 -07:00
neil4 f85c9693a0
Combine menu entries for RunAhead and Preemptive Frames (#17093) 2024-10-14 04:21:09 -07:00
Viačasłaŭ 3019b926c2
Fix typos (#17068) 2024-10-01 17:36:33 -07:00
sonninnos 6713e3b7f7
(Vulkan) Prefer IMMEDIATE mode without vsync (#17009)
* (Vulkan) Prefer IMMEDIATE mode without vsync

* Clamp max_swapchain_images and hard_sync_frames

* (Vulkan) Improve fastforward frameskip option hack
2024-09-17 10:23:02 -07:00
Eric Warmenhoven be7645024c
ozone: some fixes for better touchscreen handling (#16994) 2024-09-12 11:15:10 -07:00
Eric Warmenhoven 6e2f0a4f30
apple: don't allow opening sdl2 microphone if not using sdl2 audio (#16989) 2024-09-11 12:33:41 -07:00
zoltanvb 4e063934fd
Add option to disable analog stick menu navigation (#16743)
Two new settings added to Settings / Input / Menu Control:
- disable left analog stick in menu navigation
- disable right analog stick in menu navigation

Since the corresponding logic is already a distinct logic flow in
input driver, no change was necessary to analog-to-digital settings
or the like.
2024-09-10 18:13:31 -07:00
Jay Paul e61b3ae2ba
Sort Remaps by Connected Controller (#16747)
* sort remaps by connected controller if option is enabled

* ensure dir name is valid based on input device name

* Fix comments

* Fix forbidden mixed declarations and code

* fixing build errors

* fix additional build warning/error

* Resolved code review change requests

* Changed strlcat to strlcpy as per recommendation

* Retrigger checks

* Use proper path separator.

* Ensure default value is toggled off.

* Ensure that gamepad device name is valid.
2024-09-10 17:39:35 -07:00
libretroadmin b8391e233f * PATH_MAX_LENGTH redefined from 4096 to 2048
* Massive reduction in heap space allocation, going from settings struct
264kb to 119Kb
* Use NAME_MAX_LENGTH for base paths/names, etc
* Use DIR_MAX_LENGTH for directory sizes
2024-09-09 05:47:32 +02:00
libretroadmin 01a9745f5b Settings struct now has a flags variable 2024-09-08 22:49:26 +02:00
libretroadmin 9efb498bde (config_file) Use flags 2024-09-08 18:12:12 +02:00
libretroadmin 8491aaf659 Shave off some bool variables from structs that are allocated a
lot on heap
2024-09-05 11:35:15 +02:00
sonninnos 3f8dc5c49d
Remove 'Frame Rest' (#16936) 2024-08-29 03:35:09 -07:00
kwyxz 4016b2524b
Allow building RetroArch with menu disabled (#16881)
* allow building with --disable-menu --disable-cheevos --disable-qt --disable-slang

* allow building with cheevos while disabling menus and qt
2024-08-15 15:26:59 -07:00
Eric Warmenhoven 12def933dc
cloud sync: add options to sync thumbnails and system files, default off (#16869) 2024-08-11 13:12:35 -07:00
Jason Breitweiser 11d9a841f3
This change allows playlist icons to be replaced with Logos. (#16758)
* This change allows playlist icons to be replaced with Logos. the art is loaded to the Thumbnail Named_Logos folder. It is treated the same as other thumbnails for naming and for automatic download. There is a settings menu option to turn it on and off. It is off by default. This only applies to the xmb menu driver.

* Removed commented out code against the style guide.

* Code cleanup for C89 compatibitity

* Cleaned up errors from Automated CI.

* Cleaned up comments.

* Update gfx_display.c

change strcpy to strlcpy

* Update gfx_thumbnail_path.c

fix code formatting

* Update xmb.c

code formatting changes
2024-08-07 08:39:57 -07:00
zoltanvb b090f85620
Support for non-PNG local thumbnails (#16806)
Allow thumbnails (boxart, title, screenshot) to be loaded in any
other supported format as well, currently jpg, bmp, tga.

Support is for local thumbnails only, downloads are not changed.
PNG format is always preferred. Menu option added for control,
since trying for multiple thumbnail files may impact performance
on slow storage media.
2024-07-24 18:31:41 -07:00
Eric Warmenhoven 63799385fc
iCloud cloud sync driver (#16794) 2024-07-18 22:02:52 -07:00
zoltanvb 7db9a2de60 Test input driver and sensor test screen
A new input driver (test_input), similar to test joypad driver.
Takes its inputs from a json file provided in options. Supports
keyboard input and sensor input (accelerometer, gyroscope,
illuminance).

Remote Retropad extended with a sensor test screen.
2024-07-06 13:55:55 -05:00
Jay Paul 8aa5fd2658 ensure that all folders are enabled by default. 2024-06-25 08:25:28 -05:00
Jay Paul c570a6a20a allow saves and configs to be optionally synced to cloud 2024-06-25 08:25:28 -05:00
Joseph C. Osborn 05faba73e3 Add config values and menu items for viewport bias x/y 2024-06-25 08:18:39 -05:00
Thiago Seus 17fc346a36 Accessibility: change the is_screen_reader_enabled function name to lower case and match with the function name in Java code 2024-06-08 12:01:53 -05:00
Thiago Seus 216f55c7b2 Accessibility: Refactor Android is_narrator_running to align with the rest of RetroArch accessibility API 2024-06-08 12:01:53 -05:00
zoltanvb a9968e9e86 Controller device reservation / preference.
For each player, 2 new options are added:
- a reservation type (no reservation, preferred, reserved)
- a reserved device name

When handling port - player assignments, reserved devices
will be assigned to the respective player port. If reservation
type is "reserved", no other device can take that port
automatically.

Reservation config option and matching function lifted from:
PatrickStankard https://github.com/libretro/RetroArch/pull/16269

Test joypad driver was extended for more tests.

Co-authored-by: Patrick Stankard <me@patrickstankard.com>
2024-06-05 18:17:54 -05:00
Thiago Seus 22646d3e74 Accessibility: enable accessibility if Talkback is on 2024-06-02 14:49:19 -05:00
Eric Warmenhoven 77da47613e macos: default Accessibility on if VoiceOver is on 2024-05-24 03:40:18 +02:00