Commit Graph

865 Commits

Author SHA1 Message Date
twinaphex c744baeb89 Add ctype variants to stdstring and use it in RA 2020-09-27 22:15:32 +02:00
jdgleaver 3d4ddebcaf Add several LCD-effect video filters 2020-09-24 16:11:07 +01:00
twinaphex 0e49f058f3 Use strcpy_literal in more places 2020-09-19 23:59:06 +02:00
jdgleaver 5a0dc5524d Fix string_list memory leaks 2020-09-08 14:58:49 +01:00
twinaphex 318ac1f667 (filebrowser_parse) Use non-heap allocated string_list functions 2020-09-04 06:29:30 +02:00
twinaphex 662e37f670 Replace more instances of string_split 2020-08-26 13:35:05 +02:00
twinaphex ad61d8ff92 Simplify config_get_entry 2020-08-26 02:17:37 +02:00
twinaphex 54dfaaa3bc Simplify config_get_bool 2020-08-26 01:37:57 +02:00
twinaphex 48f2612223 (config_file) config_set - some of the char arrays were too big
for the type in question
2020-08-25 20:58:55 +02:00
twinaphex 1d53f3ca29 Move static functions to the top 2020-08-25 18:38:12 +02:00
twinaphex 6cc8a2acbd Rewrite config_file_new_from_string 2020-08-25 18:37:14 +02:00
twinaphex d573a802c4 Simplify config_file_new_alloc 2020-08-25 18:12:28 +02:00
twinaphex f454665be2 Optimize config_file_exists 2020-08-25 18:10:32 +02:00
twinaphex 2c0fb6ff6c config_file_parse_line - put sub_conf on stack 2020-08-25 17:54:22 +02:00
twinaphex 79c8a94857 (config_file.c) config_set_string - simplify 2020-08-25 15:50:26 +02:00
twinaphex 7771dbd594 Rename config_file_new_internal to config_file_load_internal 2020-08-25 15:36:26 +02:00
twinaphex cd0a27680a (config_file.c) Cleanup 2020-08-25 15:34:11 +02:00
twinaphex 5a69e6e75c Simplify config_file.c code 2020-08-25 15:29:45 +02:00
twinaphex b7b96fb142 (config_file) Cleanups 2020-08-25 12:39:28 +02:00
twinaphex f18af41876 Cut down on add_sub_conf 2020-08-25 12:29:08 +02:00
twinaphex 1e5ccb7319 Create config_file_get_realpath 2020-08-25 12:20:09 +02:00
twinaphex 74a3e5be8a Simplify is_path_accessible_using_standard_io 2020-08-24 23:41:10 +02:00
twinaphex 42a3d433dc Restore this code 2020-08-24 23:25:57 +02:00
twinaphex ceca44b233 Cleanup config_initialize_internal 2020-08-24 23:09:55 +02:00
twinaphex 88f01c51a7 (config_file) Cleanups 2020-08-24 22:57:08 +02:00
twinaphex b681b2af49 config_set_string: simplify 2020-08-24 21:25:55 +02:00
twinaphex a954118faf (config_file) Cleanups 2020-08-24 21:16:25 +02:00
twinaphex 4f29bef56e (config_file) Cleanups 2020-08-24 21:11:41 +02:00
twinaphex 150e96144a Cleanup 2020-08-24 20:40:49 +02:00
twinaphex dd13e6b044 (config_file.c) Use snprintf 2020-08-24 19:39:41 +02:00
twinaphex 24910b6999 (config_file) Simplify config_sort_compare_func 2020-08-24 19:29:24 +02:00
twinaphex f48dc0ff5b Reorder structs, alignment 2020-08-15 20:38:31 +02:00
twinaphex 7642cf5fa5 Struct reorders/alignment 2020-08-14 22:54:46 +02:00
twinaphex 659d50c916 Struct reorderings 2020-08-14 18:31:28 +02:00
Érico Rolim 057dd563aa [linux] Add missing include in nbio_linux.c.
On musl-libc, the compiler would print a warning for nbio_linux.c:
"warning: 'struct timespec' declared inside parameter list will not be
visible outside of this definition or declaration", indicating a missing
header defining this structure.

On glibc, this definition is provided through the stdlib header.
2020-08-10 00:33:43 -03:00
twinaphex 3680804217 Undo path_basedir_size 2020-08-04 03:05:20 +02:00
twinaphex 4a6f49fc0a (360) Fix build 2020-08-03 22:35:10 +02:00
twinaphex 97297f71af (MSVC 2005) MSVC 2005 and earlier cannot use nbio_windowsmmap.c -
so disable it
2020-08-01 22:51:23 +02:00
twinaphex 3635bf0d01 Silence some warnings 2020-08-01 18:04:56 +02:00
Autechre 343a04e2b8
Merge pull request #11027 from schellingb/archive_cleanup_1b
Use MMAP again for ZIP loading/parsing
2020-07-16 03:28:54 +02:00
Bernhard Schelling b03cdbd0da First set of cleanups to archive handling (Rev B)
- Don't read the entire archive file into memory on systems without HAVE_MMAP
- Support ZIP files between 2GB ~ 4GB on 32bit architectures
- Remove zip exclusive members from `file_archive_transfer`
- Add `zip_context_t` for zip like the already existing `sevenzip_context_t`
- Unify cleanups of zip and 7z in `file_archive_file_backend::archive_parse_file_free`
- Handle some sizes and offsets as int64_t (preparation for future Zip64 support)
- Handle ZIP compression methods in `zlib_stream_decompress_data_to_file_init` not in `file_archive_perform_mode`
- Return progress of 7z iterating with `file_archive_parse_file_progress`
- Uses MMAP where available, for files up to 256MB
2020-07-16 02:47:59 +09:00
Twinaphex 367530683c Get rid of unused variables 2020-07-15 19:47:45 +02:00
twinaphex 06064a0527 Revert "Bring back MMAP support"
This reverts commit 32dcff3880.
2020-07-13 23:52:23 +02:00
twinaphex c84aa90075 Merge branch 'archive_cleanup_1' of git://github.com/schellingb/RetroArch 2020-07-13 21:30:02 +02:00
Bernhard Schelling 32dcff3880 Bring back MMAP support
Will be used where available for files up to 256MB
2020-07-14 03:04:01 +09:00
Bernhard Schelling c05f1e91fc Fix another memory leak that was there originally
When loading a single file out of a ZIP with many files it leaked memory allocated for all found filenames that weren't requested.
2020-07-14 03:00:47 +09:00
Bernhard Schelling a978b939ff Fix C89 build 2020-07-14 01:56:48 +09:00
Bernhard Schelling 54db0fe515 Fix memory leak
Properly release buffers for extracted files from ZIP
Use RETRO_VFS_SEEK_POSITION_START instead of SEEK_SET for filestream_seek
2020-07-14 00:29:46 +09:00
twinaphex 750140779c (libretro-common) Fix 2020-07-13 16:18:46 +02:00
twinaphex be0148406e fill_pathname_application_dir - cleanup 2020-07-11 19:45:24 +02:00
twinaphex 8656b3d6f8 Create specialized optimized path_basedir_size 2020-07-11 19:29:43 +02:00
Bernhard Schelling 0ddb073784 First set of cleanups to archive handling
- Don't read the entire archive file into memory on systems without HAVE_MMAP
- Support ZIP files between 2GB ~ 4GB on 32bit architectures
- Remove zip exclusive members from `file_archive_transfer`
- Add `zip_context_t` for zip like the already existing `sevenzip_context_t`
- Unify cleanups of zip and 7z in `file_archive_file_backend::archive_parse_file_free`
- Handle some sizes and offsets as int64_t (preparation for future Zip64 support)
- Handle compression methods in `zlib_stream_decompress_data_to_file_init` not in `file_archive_perform_mode`
- Return progress of 7z iterating with `file_archive_parse_file_progress`
2020-07-12 00:51:35 +09:00
twinaphex 6e59d52184 Cleanups/comments 2020-07-07 05:58:07 +02:00
twinaphex 5a0bc479b1 (libretro-common) Avoid more callocs 2020-06-28 20:57:00 +02:00
twinaphex c3f8b7741c Add fallback paths for nbio_stdio.c 2020-06-27 14:07:41 +02:00
twinaphex 1ae20ea17c Style nits - turn macro names into upper-case - some while style nits 2020-06-26 20:00:19 +02:00
twinaphex b39ef98d2a Small optimization 2020-06-26 14:45:48 +02:00
twinaphex 2f235f0abb Cleanups 2020-06-25 23:16:08 +02:00
jdgleaver b6364407fd Optimise parsing of configuration files 2020-06-25 15:15:08 +01:00
twinaphex e727e85b1d Updates 2020-06-25 14:01:19 +02:00
twinaphex aa48eeb98e Turn path_default_slash uppercase, and do some optimizations 2020-06-25 13:36:01 +02:00
twinaphex 601a73fa8b Use string_starts_with_size where possible - avoids the strlen 2020-06-25 12:51:04 +02:00
twinaphex 35527c24c3 Revert "Optimize config_get_bool"
This reverts commit 1c38dc67c2.
2020-06-25 12:08:36 +02:00
jdgleaver 9c2b6dffc2 (config_file) Fix handling of comments at the end of config file lines 2020-06-25 10:29:40 +01:00
twinaphex 1c38dc67c2 Optimize config_get_bool 2020-06-25 03:03:42 +02:00
twinaphex 74b3b505c9 This part of the code looked suspicious and was leaking memory
for one codepath
2020-06-24 18:39:21 +02:00
twinaphex 53f3199652 Reordered this code somewhat 2020-06-24 15:40:42 +02:00
jdgleaver 9b22874c73 (config_file) Optimise parsing of 'comment' lines in configuration files 2020-06-24 14:31:46 +01:00
twinaphex b9f65af98a (Libretro-common) Sync 2020-06-24 15:05:03 +02:00
twinaphex 0cdea62072 (core_info.c) Try to avoid config_get_string 2020-06-24 11:57:58 +02:00
jdgleaver 0a33e562f4 Add option to backup/restore installed cores 2020-06-04 12:20:58 +01:00
twinaphex 0edd97d5db file_path.c) Cleanup 2020-05-21 20:04:36 +02:00
jdgleaver f522cfcce8 Optimise 'path_is_absolute()' 2020-05-21 13:28:42 +01:00
Francisco Javier Trujillo Mata 1eeb3dcf30 Adapt PS2 port to new SDK with newlib support (CDVDFS support is missing) 2020-05-20 20:13:19 +02:00
jdgleaver c346e1f816 Various file path handling optimisations 2020-05-20 17:05:22 +01:00
twinaphex 4f9a3f6813 Update 2020-04-28 16:25:00 +02:00
jdgleaver 9eb8472805 Only write config files to disk when parameters change 2020-04-27 17:06:35 +01:00
twinaphex bdf9969c7e Update libretro-common 2020-04-23 07:20:06 +02:00
Vladimir Serbinenko 2fb7ba22e5 PSL1GHT port
Working:

* packaging
* running cores
* switching cores
* gamepad including axis
* rgui
* audio
* video

Not working:

* OSD
* menus other than rgui
* shaders
* Graphical acceleration
* Proper signing
* ODE build
* rumble
* keyboard
* mouse

Not tested:

* A lot
2020-03-30 05:39:22 +02:00
twinaphex cd9ca691ca (libretro-common) Update copyright 2020-01-31 15:43:42 +01:00
twinaphex d631da7d11 Start taking settings dependencies out of rarch_log_file_init
function
2020-01-30 19:04:05 +01:00
twinaphex 12ec690044 Add samples test file for config_file 2020-01-30 17:02:52 +01:00
twinaphex 74cd84399f Cleanups - Replace '== NULL' 2020-01-30 16:47:33 +01:00
twinaphex eb4e365820 (libretro-common) Cleanups 2020-01-27 17:00:18 +01:00
twinaphex df8f93e9d5 Split up VFS file_path code into separate file 2020-01-09 15:44:48 +01:00
jdgleaver 1df3e20bdd Add option to automatically rotate overlays 2019-10-04 12:15:57 +01:00
Twinaphex ae7d956341 Silence warning 2019-09-23 01:44:53 +02:00
twinaphex b94b9e2adb Go back to plain strlcpy/strlcat - probably best to look at
opportunities to reduce these calls vs. replacing them with
unsafe macros
2019-09-23 00:19:01 +02:00
LazyBumHorse db723df879 fix path_relative_to 2019-09-22 16:29:54 +02:00
twinaphex 7cfd996802 Add return value to fill_pathname_noext 2019-09-21 01:41:56 +02:00
twinaphex 6d8bc91220 Start returning sizes for file_path functions 2019-09-21 00:01:09 +02:00
twinaphex 3b057d9605 Start using STRLCAT_CONST_INCR and STRLCPY_CONST 2019-09-20 23:33:17 +02:00
twinaphex 15470596ad Remove 'puts' lines 2019-09-19 04:19:18 +02:00
twinaphex f4c6b06b49 (file_path.c) Remove some strlcpy/strlcat invocations 2019-09-19 03:45:18 +02:00
twinaphex 8fa6230426 Cleanups 2019-09-18 02:16:47 +02:00
twinaphex 5024b77492 Prevent more strlcats that are quite trivial 2019-09-17 02:43:40 +02:00
twinaphex 4d45174940 file_path.c - cleanups 2019-08-11 22:37:23 +02:00
Brad Parker 7935cc80ee media: add function to parse cue and detect system from first data track 2019-07-30 02:37:00 -04:00
jdgleaver 35cdff8704 (config_file.c) Only attempt to load config file if it exists 2019-07-25 12:25:52 +01:00
LazyBumHorse 6285c05948 add resolve_symlinks parameter to path_resolve_realpath() and cleanup playlist_resolve_path() 2019-07-22 13:44:35 +02:00
LazyBumHorse 7006764c12 replace realpath() by custom code which does not resolve symlinks 2019-07-22 12:10:28 +02:00
Twinaphex 388c4857d3
Merge pull request #9140 from LazyBumHorse/shader_paths
much improved handling of relative shader paths
2019-07-20 21:54:58 +02:00
LazyBumHorse 2245af23e9 much improved handling of relative shader paths
- save texture paths in relative format as well
 - always write portable relative paths on Windows using '/' instead of '\'
 - remove an ancient piece of code that could sometimes fail loading relative paths
 - fix absolute path handling between different drives for Windows
 - integrate video_shader_resolve_relative() into video_shader_parse_* functions
2019-07-20 18:29:46 +02:00
twinaphex efb98a8a01 Cleanup file_archive_get_file_backend 2019-07-20 16:01:56 +02:00
twinaphex c2c7c106a1 Add conf->path for config_file_new_from_path_to_string 2019-07-20 00:39:55 +02:00
twinaphex 0cdfd4c542 Use config_file_new_from_path_to_string entirely 2019-07-18 16:15:02 +02:00
twinaphex 41a2fabb4e Create config_file_new_from_path_to_string 2019-07-18 12:03:50 +02:00
twinaphex a6d6c21e52 Rename config_file_new_null to config_file_new_alloc 2019-07-17 19:50:32 +02:00
twinaphex 0c31437c24 Create config_file_new_null 2019-07-17 18:27:53 +02:00
Yoshi Sugawara dba1302360 Playlist (iOS): support abbreviating and expanding application and home directory paths so that playlist entries are valid across installs
iOS: add call to realpath() when setting directory to ensure expanding special chars in paths work; fixed braces style
2019-07-15 16:11:22 -10:00
twinaphex 594dd84e6e Fix 'declaration hides parameter' 2019-07-14 13:21:14 +02:00
twinaphex 6bc0f0fcbd (config_file) Be more safe with free 2019-07-13 15:23:28 +02:00
Brad Parker 15d97dbaf3 cdrom: add disc dump option 2019-07-08 16:06:35 -04:00
twinaphex 33d4d8b7c9 Update libretro-common 2019-06-14 13:13:49 +02:00
twinaphex 133c38c601 (file_path.c) Cleanups 2019-06-14 04:57:17 +02:00
jdgleaver feae08e5e7 (Wii) Fix recursive path_mkdir() operations 2019-06-10 14:26:41 +01:00
LazyBumHorse d67a118ad4 path_relative_to: fix return in void function 2019-06-08 19:15:52 +02:00
LazyBumHorse 2816730b2f make shader presets use relative paths
Also change fill_pathname_resolve_relative() to apply path_resolve_realpath() as well
2019-06-07 16:11:06 +02:00
twinaphex c3c3eedfa2 file_archive_get_file_list - file_archive_walk returns boolean type,
not integer
2019-05-31 07:48:10 +02:00
twinaphex 22d762be67 We need to split up zlib headers in libretro-common to its own separate
dir
2019-05-27 03:40:14 +02:00
twinaphex 32f9b9ab9a (PS4/ORBIS) Move path_is_directory code parts to VFS layer - hope I did
it right
2019-05-22 02:32:22 +02:00
twinaphex f117d763d6 Create path_stat and use it 2019-05-22 02:21:30 +02:00
twinaphex 64f9477ef6 Simplify find_last_slash for non-WIN32 2019-05-12 05:02:45 +02:00
twinaphex 985ed6cd2b Small cleanups 2019-05-12 04:47:27 +02:00
twinaphex 74388d8490 Remove string_concat 2019-05-10 18:05:58 +02:00
twinaphex 5794c2051c path_mkdir - safety check 2019-05-06 03:09:44 +02:00
twinaphex 0919cd9746 (Legacy Win32) Be more careful with retro_vfs_stat_impl 2019-05-06 03:00:51 +02:00
twinaphex 39eadbab6f Use string_concat in more performance critical areas 2019-04-30 21:17:51 +02:00
twinaphex bc2bdd5734 config_file_read not needed anymore 2019-04-30 13:37:10 +02:00
twinaphex 0984a13665 We can't use RARCH_LOG and friends inside libretro-common code 2019-04-29 14:49:24 +02:00
twinaphex 4c3e0d44b8 Revert "Start using string_is_equal_memcmp and"
This reverts commit 26d6aee1eb.
2019-04-29 04:04:33 +02:00
twinaphex 26d6aee1eb Start using string_is_equal_memcmp and
string_is_equal_memcmp_fast
2019-04-28 17:23:11 +02:00
Twinaphex 4c154f347d
Merge pull request #8649 from Ghabry/uwp-vfs
UWP VFS: Calculate buffer offset correctly when read fails due to EOF
2019-04-28 12:20:13 +02:00
Ghabry 5faf6a124d UWP VFS: Calculate buffer offset correctly when read fails due to EOF 2019-04-28 12:15:46 +02:00
twinaphex 6888a0cc71 (config_file.c) Seems unnecesary to check if a config file is a
directory first
2019-04-28 03:12:59 +02:00
Ghabry c209b0b3d9 UWP: Improve IO performance by manually buffering short reads.
Reduce copies by binding by reference in the lambdas
2019-04-27 23:47:52 +02:00
Ghabry 4390317992 Revert "(UWP/WinRT)"
This reverts commit b43b3e2bb0.
2019-04-27 15:01:01 +02:00
twinaphex b43b3e2bb0 (UWP/WinRT)
- Disable VFS for now - seems to be very problematic right now
- Move uwp_is_path_accessible_using_standard_io to file_path.c
since it seems to have no VFS dependencies, and rename it to
is_path_accessible_using_standard_io so it could possibly be later
used for other platforms as well that also have sandboxed filesystems
2019-04-27 09:20:19 +02:00
twinaphex 3e72c502a8 strlen optimizations :
- use STRLEN_CONST for constant strings, translates to sizeof
which should be computed at compile-time
- found some places where we are needlessly calling strlen two
times instead of just once
2019-04-27 04:21:10 +02:00
twinaphex 2b401ce13b (archive_file) Small optimizations - use one strlen less in one instance 2019-04-27 02:39:33 +02:00
twinaphex a2cb3f60a4 path_get_extension - fix regression 2019-04-27 02:17:17 +02:00
twinaphex fbae4efc97 Simplify path_basename and path_get_extension 2019-04-27 02:07:25 +02:00
twinaphex 1598cc773c More small cleanups 2019-04-26 12:53:12 +02:00
twinaphex 68ab984603 (archive_file) Safe optimizations 2019-04-26 12:46:44 +02:00
twinaphex aa156bd804 Have to revert this for now 2019-04-26 11:28:08 +02:00
twinaphex 60c028a562 (archive_file) Some optimizations 2019-04-26 10:26:48 +02:00
twinaphex ddace03872 (config_file.c) Cleanups 2019-04-26 06:28:10 +02:00
twinaphex fb653d22dc (file_path.c) Small simplifications 2019-04-26 04:49:42 +02:00
twinaphex f573626144 Simplify path_parent_dir 2019-04-23 23:21:16 +02:00
twinaphex b8694ff127 (file_path.c) More simplifications 2019-04-23 23:10:53 +02:00