diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-01-16 21:49:46 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-01-26 22:59:59 +0900 |
| commit | c70a6ffa28c41d0a7b3d6b8822382d406c6da9fa (patch) | |
| tree | b229dafb18dd02da0870c924c3057335c334870a /gnu | |
| parent | 5aadcaaa6577c452fe8042dbd738dba6c3051b4b (diff) | |
gnu: retroarch-minimal: Add new search paths.
This makes it possible to locate system files provided by libretro cores, as
well as database and cheat files.
* gnu/packages/patches/retroarch-improved-search-paths.patch: Extend patch.
* gnu/packages/emulators.scm (retroarch-minimal) [native-search-paths]:
Register new search paths for the LIBRETRO_CHEATS_DIRECTORY,
LIBRETRO_DATABASE_DIRECTORY and LIBRETRO_SYSTEM_DIRECTORY variables.
Reviewed-by: Sou Bunnbu (宋文武) <iyzsong@member.fsf.org>
Change-Id: I48f9a92608c0e36922ce9dcc9bbb61d6ca915002
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/emulators.scm | 12 | ||||
| -rw-r--r-- | gnu/packages/patches/retroarch-improved-search-paths.patch | 210 |
2 files changed, 181 insertions, 41 deletions
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index 49a1b12713b..46a7ee37077 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm | |||
| @@ -2634,6 +2634,18 @@ GLSL (@file{.slang}) shaders for use with RetroArch.") | |||
| 2634 | (separator #f) ;single entry | 2634 | (separator #f) ;single entry |
| 2635 | (files '("share/libretro/autoconfig"))) | 2635 | (files '("share/libretro/autoconfig"))) |
| 2636 | (search-path-specification | 2636 | (search-path-specification |
| 2637 | (variable "LIBRETRO_CHEATS_DIRECTORY") | ||
| 2638 | (separator #f) ;single entry | ||
| 2639 | (files '("share/libretro/database/cht"))) | ||
| 2640 | (search-path-specification | ||
| 2641 | (variable "LIBRETRO_DATABASE_DIRECTORY") | ||
| 2642 | (separator #f) ;single entry | ||
| 2643 | (files '("share/libretro/database/rdb"))) | ||
| 2644 | (search-path-specification | ||
| 2645 | (variable "LIBRETRO_SYSTEM_DIRECTORY") | ||
| 2646 | (separator #f) ;single entry | ||
| 2647 | (files '("share/libretro/system"))) | ||
| 2648 | (search-path-specification | ||
| 2637 | (variable "LIBRETRO_VIDEO_FILTER_DIRECTORY") | 2649 | (variable "LIBRETRO_VIDEO_FILTER_DIRECTORY") |
| 2638 | (separator #f) ;single entry | 2650 | (separator #f) ;single entry |
| 2639 | (files '("share/libretro/filters/video"))) | 2651 | (files '("share/libretro/filters/video"))) |
diff --git a/gnu/packages/patches/retroarch-improved-search-paths.patch b/gnu/packages/patches/retroarch-improved-search-paths.patch index 6fcd4745acf..ae815bfbb14 100644 --- a/gnu/packages/patches/retroarch-improved-search-paths.patch +++ b/gnu/packages/patches/retroarch-improved-search-paths.patch | |||
| @@ -1,38 +1,27 @@ | |||
| 1 | Allows discovery of assets file via the LIBRETRO_ASSETS_DIRECTORY environment | 1 | Add support for various environment variables, used in search paths. |
| 2 | variable. | ||
| 3 | 2 | ||
| 4 | Upstream-status: https://github.com/libretro/RetroArch/pull/17054 | 3 | Upstream status: https://github.com/libretro/RetroArch/pull/17440 |
| 5 | 4 | ||
| 6 | diff --git a/configuration.c b/configuration.c | 5 | diff --git a/configuration.c b/configuration.c |
| 7 | index 5808a3f21c..0cc2909102 100644 | 6 | index 7eb6c08e1e..0449e77ac2 100644 |
| 8 | --- a/configuration.c | 7 | --- a/configuration.c |
| 9 | +++ b/configuration.c | 8 | +++ b/configuration.c |
| 10 | @@ -3573,6 +3573,11 @@ static bool config_load_file(global_t *global, | 9 | @@ -3568,6 +3568,14 @@ static bool config_load_file(global_t *global, |
| 11 | { | 10 | { |
| 12 | unsigned i; | 11 | unsigned i; |
| 13 | char tmp_str[PATH_MAX_LENGTH]; | 12 | char tmp_str[PATH_MAX_LENGTH]; |
| 14 | + char* libretro_directory = NULL; | 13 | + char* libretro_directory = NULL; |
| 15 | + char* libretro_assets_directory = NULL; | 14 | + char* libretro_assets_directory = NULL; |
| 16 | + char* libretro_autoconfig_directory = NULL; | 15 | + char* libretro_autoconfig_directory = NULL; |
| 16 | + char* libretro_cheats_directory = NULL; | ||
| 17 | + char* libretro_database_directory = NULL; | ||
| 18 | + char* libretro_system_directory = NULL; | ||
| 17 | + char* libretro_video_filter_directory = NULL; | 19 | + char* libretro_video_filter_directory = NULL; |
| 18 | + char* libretro_video_shader_directory = NULL; | 20 | + char* libretro_video_shader_directory = NULL; |
| 19 | static bool first_load = true; | 21 | static bool first_load = true; |
| 20 | bool without_overrides = false; | 22 | bool without_overrides = false; |
| 21 | unsigned msg_color = 0; | 23 | unsigned msg_color = 0; |
| 22 | @@ -3848,12 +3853,6 @@ static bool config_load_file(global_t *global, | 24 | @@ -3862,6 +3870,38 @@ static bool config_load_file(global_t *global, |
| 23 | strlcpy(path_settings[i].ptr, tmp_str, PATH_MAX_LENGTH); | ||
| 24 | } | ||
| 25 | |||
| 26 | -#if !IOS | ||
| 27 | - if (config_get_path(conf, "libretro_directory", tmp_str, sizeof(tmp_str))) | ||
| 28 | - configuration_set_string(settings, | ||
| 29 | - settings->paths.directory_libretro, tmp_str); | ||
| 30 | -#endif | ||
| 31 | - | ||
| 32 | #ifdef RARCH_CONSOLE | ||
| 33 | if (conf) | ||
| 34 | video_driver_load_settings(global, conf); | ||
| 35 | @@ -3861,6 +3860,20 @@ static bool config_load_file(global_t *global, | ||
| 36 | 25 | ||
| 37 | /* Post-settings load */ | 26 | /* Post-settings load */ |
| 38 | 27 | ||
| @@ -45,15 +34,33 @@ index 5808a3f21c..0cc2909102 100644 | |||
| 45 | + } | 34 | + } |
| 46 | + | 35 | + |
| 47 | + libretro_autoconfig_directory = getenv("LIBRETRO_AUTOCONFIG_DIRECTORY"); | 36 | + libretro_autoconfig_directory = getenv("LIBRETRO_AUTOCONFIG_DIRECTORY"); |
| 48 | + if (libretro_autoconfig_directory) | 37 | + if (libretro_autoconfig_directory) /* override configuration value */ |
| 49 | + configuration_set_string(settings, | 38 | + configuration_set_string(settings, |
| 50 | + settings->paths.directory_autoconfig, | 39 | + settings->paths.directory_autoconfig, |
| 51 | + libretro_autoconfig_directory); | 40 | + libretro_autoconfig_directory); |
| 52 | + | 41 | + |
| 42 | + libretro_cheats_directory = getenv("LIBRETRO_CHEATS_DIRECTORY"); | ||
| 43 | + if (libretro_cheats_directory) /* override configuration value */ | ||
| 44 | + configuration_set_string(settings, | ||
| 45 | + settings->paths.path_cheat_database, | ||
| 46 | + libretro_cheats_directory); | ||
| 47 | + | ||
| 48 | + libretro_database_directory = getenv("LIBRETRO_DATABASE_DIRECTORY"); | ||
| 49 | + if (libretro_database_directory) /* override configuration value */ | ||
| 50 | + configuration_set_string(settings, | ||
| 51 | + settings->paths.path_content_database, | ||
| 52 | + libretro_database_directory); | ||
| 53 | + | ||
| 54 | + libretro_system_directory = getenv("LIBRETRO_SYSTEM_DIRECTORY"); | ||
| 55 | + if (libretro_system_directory) /* override configuration value */ | ||
| 56 | + configuration_set_string(settings, | ||
| 57 | + settings->paths.directory_system, | ||
| 58 | + libretro_system_directory); | ||
| 59 | + | ||
| 53 | if ( (rarch_flags & RARCH_FLAGS_HAS_SET_USERNAME) | 60 | if ( (rarch_flags & RARCH_FLAGS_HAS_SET_USERNAME) |
| 54 | && (override_username)) | 61 | && (override_username)) |
| 55 | { | 62 | { |
| 56 | @@ -4032,15 +4045,27 @@ static bool config_load_file(global_t *global, | 63 | @@ -4026,15 +4066,27 @@ static bool config_load_file(global_t *global, |
| 57 | *settings->paths.path_menu_wallpaper = '\0'; | 64 | *settings->paths.path_menu_wallpaper = '\0'; |
| 58 | if (string_is_equal(settings->paths.path_rgui_theme_preset, "default")) | 65 | if (string_is_equal(settings->paths.path_rgui_theme_preset, "default")) |
| 59 | *settings->paths.path_rgui_theme_preset = '\0'; | 66 | *settings->paths.path_rgui_theme_preset = '\0'; |
| @@ -85,18 +92,18 @@ index 5808a3f21c..0cc2909102 100644 | |||
| 85 | #ifdef _3DS | 92 | #ifdef _3DS |
| 86 | if (string_is_equal(settings->paths.directory_bottom_assets, "default")) | 93 | if (string_is_equal(settings->paths.directory_bottom_assets, "default")) |
| 87 | diff --git a/docs/retroarch.6 b/docs/retroarch.6 | 94 | diff --git a/docs/retroarch.6 b/docs/retroarch.6 |
| 88 | index 7478040e17..f864e0e0d5 100644 | 95 | index 7478040e17..d38a8ee565 100644 |
| 89 | --- a/docs/retroarch.6 | 96 | --- a/docs/retroarch.6 |
| 90 | +++ b/docs/retroarch.6 | 97 | +++ b/docs/retroarch.6 |
| 91 | @@ -1,6 +1,6 @@ | 98 | @@ -1,6 +1,6 @@ |
| 92 | .\" retroarch.6: | 99 | .\" retroarch.6: |
| 93 | 100 | ||
| 94 | -.TH "RETROARCH" "6" "November 1, 2011" "RETROARCH" "System Manager's Manual: retroarch" | 101 | -.TH "RETROARCH" "6" "November 1, 2011" "RETROARCH" "System Manager's Manual: retroarch" |
| 95 | +.TH "RETROARCH" "6" "September 28, 2024" "RETROARCH" "System Manager's Manual: retroarch" | 102 | +.TH "RETROARCH" "6" "January 20, 2025" "RETROARCH" "System Manager's Manual: retroarch" |
| 96 | 103 | ||
| 97 | .SH NAME | 104 | .SH NAME |
| 98 | 105 | ||
| 99 | @@ -239,3 +239,36 @@ Disables all kinds of content patching. | 106 | @@ -239,3 +239,54 @@ Disables all kinds of content patching. |
| 100 | .TP | 107 | .TP |
| 101 | \fB-D, --detach\fR | 108 | \fB-D, --detach\fR |
| 102 | Detach from the current console. This is currently only relevant for Microsoft Windows. | 109 | Detach from the current console. This is currently only relevant for Microsoft Windows. |
| @@ -123,6 +130,24 @@ index 7478040e17..f864e0e0d5 100644 | |||
| 123 | +"joypad_autoconfig_dir" configuration file option. | 130 | +"joypad_autoconfig_dir" configuration file option. |
| 124 | + | 131 | + |
| 125 | +.TP | 132 | +.TP |
| 133 | +\fBLIBRETRO_CHEATS_DIRECTORY\fR | ||
| 134 | +Specify the directory where RetroArch looks for cheat files, | ||
| 135 | +overriding the value of the "cheat_database_path" configuration file | ||
| 136 | +option. | ||
| 137 | + | ||
| 138 | +.TP | ||
| 139 | +\fBLIBRETRO_DATABASE_DIRECTORY\fR | ||
| 140 | +Specify the directory where RetroArch looks for database files, | ||
| 141 | +overriding the value of the "content_database_path" configuration file | ||
| 142 | +option. | ||
| 143 | + | ||
| 144 | +.TP | ||
| 145 | +\fBLIBRETRO_SYSTEM_DIRECTORY\fR | ||
| 146 | +Specify the directory where RetroArch looks for system files, | ||
| 147 | +overriding the value of the "system_directory" configuration file | ||
| 148 | +option. | ||
| 149 | + | ||
| 150 | +.TP | ||
| 126 | +\fBLIBRETRO_VIDEO_FILTER_DIRECTORY\fR | 151 | +\fBLIBRETRO_VIDEO_FILTER_DIRECTORY\fR |
| 127 | +Specify the directory where RetroArch looks for video filters, | 152 | +Specify the directory where RetroArch looks for video filters, |
| 128 | +overriding the value of the "video_filter_dir" configuration file | 153 | +overriding the value of the "video_filter_dir" configuration file |
| @@ -134,21 +159,24 @@ index 7478040e17..f864e0e0d5 100644 | |||
| 134 | +overriding the value of the "video_shader_dir" configuration file | 159 | +overriding the value of the "video_shader_dir" configuration file |
| 135 | +option. | 160 | +option. |
| 136 | diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c | 161 | diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c |
| 137 | index c157d355a1..ddf0b5ca87 100644 | 162 | index 778f54eeda..cce011c875 100644 |
| 138 | --- a/frontend/drivers/platform_unix.c | 163 | --- a/frontend/drivers/platform_unix.c |
| 139 | +++ b/frontend/drivers/platform_unix.c | 164 | +++ b/frontend/drivers/platform_unix.c |
| 140 | @@ -1324,6 +1324,10 @@ static void frontend_unix_get_env(int *argc, | 165 | @@ -1323,6 +1323,13 @@ static void frontend_unix_get_env(int *argc, |
| 141 | { | 166 | { |
| 142 | unsigned i; | 167 | unsigned i; |
| 143 | const char* libretro_directory = getenv("LIBRETRO_DIRECTORY"); | 168 | const char* libretro_directory = getenv("LIBRETRO_DIRECTORY"); |
| 144 | + const char* libretro_assets_directory = getenv("LIBRETRO_ASSETS_DIRECTORY"); | 169 | + const char* libretro_assets_directory = getenv("LIBRETRO_ASSETS_DIRECTORY"); |
| 145 | + const char* libretro_autoconfig_directory = getenv("LIBRETRO_AUTOCONFIG_DIRECTORY"); | 170 | + const char* libretro_autoconfig_directory = getenv("LIBRETRO_AUTOCONFIG_DIRECTORY"); |
| 171 | + const char* libretro_cheats_directory = getenv("LIBRETRO_CHEATS_DIRECTORY"); | ||
| 172 | + const char* libretro_database_directory = getenv("LIBRETRO_DATABASE_DIRECTORY"); | ||
| 173 | + const char* libretro_system_directory = getenv("LIBRETRO_SYSTEM_DIRECTORY"); | ||
| 146 | + const char* libretro_video_filter_directory = getenv("LIBRETRO_VIDEO_FILTER_DIRECTORY"); | 174 | + const char* libretro_video_filter_directory = getenv("LIBRETRO_VIDEO_FILTER_DIRECTORY"); |
| 147 | + const char* libretro_video_shader_directory = getenv("LIBRETRO_VIDEO_SHADER_DIRECTORY"); | 175 | + const char* libretro_video_shader_directory = getenv("LIBRETRO_VIDEO_SHADER_DIRECTORY"); |
| 148 | #ifdef ANDROID | 176 | #ifdef ANDROID |
| 149 | int32_t major, minor, rel; | 177 | int32_t major, minor, rel; |
| 150 | char device_model[PROP_VALUE_MAX] = {0}; | 178 | char device_model[PROP_VALUE_MAX] = {0}; |
| 151 | @@ -1765,12 +1769,20 @@ static void frontend_unix_get_env(int *argc, | 179 | @@ -1764,12 +1771,20 @@ static void frontend_unix_get_env(int *argc, |
| 152 | "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO])); | 180 | "cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_INFO])); |
| 153 | else | 181 | else |
| 154 | #endif | 182 | #endif |
| @@ -174,7 +202,7 @@ index c157d355a1..ddf0b5ca87 100644 | |||
| 174 | #ifdef ASSETS_DIR | 202 | #ifdef ASSETS_DIR |
| 175 | if (path_is_directory(ASSETS_DIR "/assets")) | 203 | if (path_is_directory(ASSETS_DIR "/assets")) |
| 176 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], | 204 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], |
| 177 | @@ -1778,7 +1790,10 @@ static void frontend_unix_get_env(int *argc, | 205 | @@ -1777,7 +1792,10 @@ static void frontend_unix_get_env(int *argc, |
| 178 | "assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS])); | 206 | "assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS])); |
| 179 | else | 207 | else |
| 180 | #endif | 208 | #endif |
| @@ -186,7 +214,7 @@ index c157d355a1..ddf0b5ca87 100644 | |||
| 186 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], | 214 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_ASSETS], |
| 187 | "/usr/local/share/retroarch", | 215 | "/usr/local/share/retroarch", |
| 188 | "assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS])); | 216 | "assets", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS])); |
| 189 | @@ -1838,7 +1853,11 @@ static void frontend_unix_get_env(int *argc, | 217 | @@ -1837,7 +1855,11 @@ static void frontend_unix_get_env(int *argc, |
| 190 | "filters/video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); | 218 | "filters/video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); |
| 191 | else | 219 | else |
| 192 | #endif | 220 | #endif |
| @@ -199,12 +227,23 @@ index c157d355a1..ddf0b5ca87 100644 | |||
| 199 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], | 227 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], |
| 200 | "/usr/local/share/retroarch", | 228 | "/usr/local/share/retroarch", |
| 201 | "filters/video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); | 229 | "filters/video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); |
| 202 | @@ -1872,8 +1891,13 @@ static void frontend_unix_get_env(int *argc, | 230 | @@ -1869,12 +1891,27 @@ static void frontend_unix_get_env(int *argc, |
| 231 | "records_config", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG])); | ||
| 232 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT], base_path, | ||
| 203 | "records", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT])); | 233 | "records", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT])); |
| 204 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE], base_path, | 234 | - fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE], base_path, |
| 205 | "database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); | 235 | - "database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); |
| 206 | - fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER], base_path, | 236 | - fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER], base_path, |
| 207 | - "shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER])); | 237 | - "shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER])); |
| 238 | - fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS], base_path, | ||
| 239 | - "cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); | ||
| 240 | + if (!string_is_empty(libretro_database_directory)) | ||
| 241 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_DATABASE], | ||
| 242 | + libretro_database_directory, | ||
| 243 | + sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); | ||
| 244 | + else | ||
| 245 | + fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_DATABASE], base_path, | ||
| 246 | + "database/rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); | ||
| 208 | + if (!string_is_empty(libretro_video_shader_directory)) | 247 | + if (!string_is_empty(libretro_video_shader_directory)) |
| 209 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_SHADER], | 248 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_SHADER], |
| 210 | + libretro_video_shader_directory, | 249 | + libretro_video_shader_directory, |
| @@ -212,19 +251,45 @@ index c157d355a1..ddf0b5ca87 100644 | |||
| 212 | + else | 251 | + else |
| 213 | + fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER], base_path, | 252 | + fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SHADER], base_path, |
| 214 | + "shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER])); | 253 | + "shaders", sizeof(g_defaults.dirs[DEFAULT_DIR_SHADER])); |
| 215 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS], base_path, | 254 | + if (!string_is_empty(libretro_cheats_directory)) |
| 216 | "cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); | 255 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_CHEATS], |
| 256 | + libretro_cheats_directory, | ||
| 257 | + sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); | ||
| 258 | + else | ||
| 259 | + fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CHEATS], base_path, | ||
| 260 | + "cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); | ||
| 217 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], base_path, | 261 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OVERLAY], base_path, |
| 262 | "overlays", sizeof(g_defaults.dirs[DEFAULT_DIR_OVERLAY])); | ||
| 263 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_OSK_OVERLAY], base_path, | ||
| 264 | @@ -1891,8 +1928,13 @@ static void frontend_unix_get_env(int *argc, | ||
| 265 | "saves", sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM])); | ||
| 266 | fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SAVESTATE], base_path, | ||
| 267 | "states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE])); | ||
| 268 | - fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM], base_path, | ||
| 269 | - "system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM])); | ||
| 270 | + if (!string_is_empty(libretro_system_directory)) | ||
| 271 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_SYSTEM], | ||
| 272 | + libretro_system_directory, | ||
| 273 | + sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM])); | ||
| 274 | + else | ||
| 275 | + fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_SYSTEM], base_path, | ||
| 276 | + "system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM])); | ||
| 277 | #endif | ||
| 278 | |||
| 279 | #ifndef IS_SALAMANDER | ||
| 218 | diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c | 280 | diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c |
| 219 | index 26ed25c04f..0cc9a9dc95 100644 | 281 | index adb27b425c..f12fb8717e 100644 |
| 220 | --- a/frontend/drivers/platform_win32.c | 282 | --- a/frontend/drivers/platform_win32.c |
| 221 | +++ b/frontend/drivers/platform_win32.c | 283 | +++ b/frontend/drivers/platform_win32.c |
| 222 | @@ -565,24 +565,38 @@ static void frontend_win32_env_get(int *argc, char *argv[], | 284 | @@ -566,24 +566,51 @@ static void frontend_win32_env_get(int *argc, char *argv[], |
| 223 | { | 285 | { |
| 224 | const char *tmp_dir = getenv("TMP"); | 286 | const char *tmp_dir = getenv("TMP"); |
| 225 | const char *libretro_directory = getenv("LIBRETRO_DIRECTORY"); | 287 | const char *libretro_directory = getenv("LIBRETRO_DIRECTORY"); |
| 226 | + const char *libretro_assets_directory = getenv("LIBRETRO_ASSETS_DIRECTORY"); | 288 | + const char *libretro_assets_directory = getenv("LIBRETRO_ASSETS_DIRECTORY"); |
| 227 | + const char* libretro_autoconfig_directory = getenv("LIBRETRO_AUTOCONFIG_DIRECTORY"); | 289 | + const char* libretro_autoconfig_directory = getenv("LIBRETRO_AUTOCONFIG_DIRECTORY"); |
| 290 | + const char* libretro_cheats_directory = getenv("LIBRETRO_CHEATS_DIRECTORY"); | ||
| 291 | + const char* libretro_database_directory = getenv("LIBRETRO_DATABASE_DIRECTORY"); | ||
| 292 | + const char* libretro_system_directory = getenv("LIBRETRO_SYSTEM_DIRECTORY"); | ||
| 228 | + const char* libretro_video_filter_directory = getenv("LIBRETRO_VIDEO_FILTER_DIRECTORY"); | 293 | + const char* libretro_video_filter_directory = getenv("LIBRETRO_VIDEO_FILTER_DIRECTORY"); |
| 229 | + const char* libretro_video_shader_directory = getenv("LIBRETRO_VIDEO_SHADER_DIRECTORY"); | 294 | + const char* libretro_video_shader_directory = getenv("LIBRETRO_VIDEO_SHADER_DIRECTORY"); |
| 230 | if (!string_is_empty(tmp_dir)) | 295 | if (!string_is_empty(tmp_dir)) |
| @@ -246,6 +311,10 @@ index 26ed25c04f..0cc9a9dc95 100644 | |||
| 246 | ":\\filters\\audio", sizeof(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER])); | 311 | ":\\filters\\audio", sizeof(g_defaults.dirs[DEFAULT_DIR_AUDIO_FILTER])); |
| 247 | - fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], | 312 | - fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], |
| 248 | - ":\\filters\\video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); | 313 | - ":\\filters\\video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); |
| 314 | - fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CHEATS], | ||
| 315 | - ":\\cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); | ||
| 316 | - fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_DATABASE], | ||
| 317 | - ":\\database\\rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); | ||
| 249 | + if (!string_is_empty(libretro_video_filter_directory)) | 318 | + if (!string_is_empty(libretro_video_filter_directory)) |
| 250 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], | 319 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], |
| 251 | + libretro_video_filter_directory, | 320 | + libretro_video_filter_directory, |
| @@ -253,17 +322,27 @@ index 26ed25c04f..0cc9a9dc95 100644 | |||
| 253 | + else | 322 | + else |
| 254 | + fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], | 323 | + fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER], |
| 255 | + ":\\filters\\video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); | 324 | + ":\\filters\\video", sizeof(g_defaults.dirs[DEFAULT_DIR_VIDEO_FILTER])); |
| 256 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CHEATS], | 325 | + if (!string_is_empty(libretro_cheats_directory)) |
| 257 | ":\\cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); | 326 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_CHEATS], |
| 258 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_DATABASE], | 327 | + libretro_cheats_directory, |
| 259 | ":\\database\\rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); | 328 | + sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); |
| 329 | + else | ||
| 330 | + fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CHEATS], | ||
| 331 | + ":\\cheats", sizeof(g_defaults.dirs[DEFAULT_DIR_CHEATS])); | ||
| 332 | + if (!string_is_empty(libretro_database_directory)) | ||
| 333 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_DATABASE], | ||
| 334 | + libretro_database_directory, | ||
| 335 | + sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); | ||
| 336 | + else | ||
| 337 | + fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_DATABASE], | ||
| 338 | + ":\\database\\rdb", sizeof(g_defaults.dirs[DEFAULT_DIR_DATABASE])); | ||
| 260 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_PLAYLIST], | 339 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_PLAYLIST], |
| 261 | - ":\\playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS])); | 340 | - ":\\playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_ASSETS])); |
| 262 | + ":\\playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST])); | 341 | + ":\\playlists", sizeof(g_defaults.dirs[DEFAULT_DIR_PLAYLIST])); |
| 263 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG], | 342 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG], |
| 264 | ":\\config\\record", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG])); | 343 | ":\\config\\record", sizeof(g_defaults.dirs[DEFAULT_DIR_RECORD_CONFIG])); |
| 265 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT], | 344 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_RECORD_OUTPUT], |
| 266 | @@ -605,12 +619,26 @@ static void frontend_win32_env_get(int *argc, char *argv[], | 345 | @@ -606,12 +633,26 @@ static void frontend_win32_env_get(int *argc, char *argv[], |
| 267 | else | 346 | else |
| 268 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CORE], | 347 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CORE], |
| 269 | ":\\cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE])); | 348 | ":\\cores", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE])); |
| @@ -296,3 +375,52 @@ index 26ed25c04f..0cc9a9dc95 100644 | |||
| 296 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS], | 375 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS], |
| 297 | ":\\downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS])); | 376 | ":\\downloads", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE_ASSETS])); |
| 298 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT], | 377 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SCREENSHOT], |
| 378 | @@ -620,8 +661,13 @@ static void frontend_win32_env_get(int *argc, char *argv[], | ||
| 379 | ":\\saves", sizeof(g_defaults.dirs[DEFAULT_DIR_SRAM])); | ||
| 380 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SAVESTATE], | ||
| 381 | ":\\states", sizeof(g_defaults.dirs[DEFAULT_DIR_SAVESTATE])); | ||
| 382 | - fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SYSTEM], | ||
| 383 | - ":\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM])); | ||
| 384 | + if (!string_is_empty(libretro_system_directory)) | ||
| 385 | + strlcpy(g_defaults.dirs[DEFAULT_DIR_SYSTEM], | ||
| 386 | + libretro_system_directory, | ||
| 387 | + sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM])); | ||
| 388 | + else | ||
| 389 | + fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_SYSTEM], | ||
| 390 | + ":\\system", sizeof(g_defaults.dirs[DEFAULT_DIR_SYSTEM])); | ||
| 391 | fill_pathname_expand_special(g_defaults.dirs[DEFAULT_DIR_LOGS], | ||
| 392 | ":\\logs", sizeof(g_defaults.dirs[DEFAULT_DIR_LOGS])); | ||
| 393 | |||
| 394 | diff --git a/retroarch.c b/retroarch.c | ||
| 395 | index a7e5f5299f..59d7879ec5 100644 | ||
| 396 | --- a/retroarch.c | ||
| 397 | +++ b/retroarch.c | ||
| 398 | @@ -6516,7 +6516,28 @@ static void retroarch_print_help(const char *arg0) | ||
| 399 | "Path for the save state files (*.state). (DEPRECATED, use --appendconfig and savestate_directory)\n" | ||
| 400 | , sizeof(buf) - _len); | ||
| 401 | |||
| 402 | + /* Flush buffer here to avoid the error "error: string length ‘752’ | ||
| 403 | + * is greater than the length ‘509’ ISO C90 compilers are required | ||
| 404 | + * to support" */ | ||
| 405 | fputs(buf, stdout); | ||
| 406 | + | ||
| 407 | +#if defined(__linux__) || defined(__GNU__) || (defined(BSD) && !defined(__MACH__)) | ||
| 408 | + buf[0] = '\0'; | ||
| 409 | + _len = 0; | ||
| 410 | + _len += strlcpy(buf + _len, | ||
| 411 | + "\nThe following environment variables are supported:\n\n" | ||
| 412 | + " LIBRETRO_ASSETS_DIRECTORY\n" | ||
| 413 | + " LIBRETRO_AUTOCONFIG_DIRECTORY\n" | ||
| 414 | + " LIBRETRO_CHEATS_DIRECTORY\n" | ||
| 415 | + " LIBRETRO_DATABASE_DIRECTORY\n" | ||
| 416 | + " LIBRETRO_DIRECTORY\n" | ||
| 417 | + " LIBRETRO_SYSTEM_DIRECTORY\n" | ||
| 418 | + " LIBRETRO_VIDEO_FILTER_DIRECTORY\n" | ||
| 419 | + " LIBRETRO_VIDEO_SHADER_DIRECTORY\n\n" | ||
| 420 | + "Refer to `man 6 retroarch' for a description of what they do.\n" | ||
| 421 | + , sizeof(buf) - _len); | ||
| 422 | + fputs(buf, stdout); | ||
| 423 | +#endif | ||
| 424 | } | ||
| 425 | |||
| 426 | #ifdef HAVE_DYNAMIC | ||
