Commit Graph

2290 Commits

Author SHA1 Message Date
libretroadmin
437d9ddbf1 (task_translation.c) Fix warning 2023-12-18 01:39:00 +01:00
libretroadmin
2980eb7e12 Silence some warnings 2023-12-17 05:11:18 +01:00
Jesse Talavera
17c9227a9c
Fix the build when XDelta is enabled on certain platforms (#15968)
* Rename the `MIN_MATCH` defined by xdelta3 to `XD3_MIN_MATCH`

- zlib defines its own macro by that name, but with a different value

* Don't redefine `SIZEOF_ARRAY` in xdelta3 if it already exists

* Don't define ssize_t in xdelta3, rely on libretro's definition instead

* Enable xdelta3 support in MSVC 2015-2019

* Fix some invalid MSBuild condition syntax

* Always build xdelta with XD3_USE_LARGESIZET as 1

* Fix an `#if` in task_patch.c

* Enable `HAVE_XDELTA` in the UWP build

* First crack at fixing Xdelta support for Android
2023-12-05 08:32:16 -08:00
Jesse Talavera-Greenberg
cbf49a0b77
XDelta patch support (Take 2) (#15915)
* Add xdelta in deps

* Include <assert.h> in xdelta3.h

- Otherwise the static_assert calls can fail

* Build xdelta3 in Makefile.common

* Add xdelta support to the softpatching infrastructure

- The patching itself isn't fully implemented yet

* Adjust how xdelta3.h checks the sizes of some types

- Now checks max values instead of relying on autotools

* Add some enums that were excluded by the cherry-pick

* Remove stray whitespace

* Adjust SIZE macros in xdelta3.h

- Move them outside the XD3_USE_LARGEFILE64 block
- Add more SIZE declarations
- Make SIZEOF_UNSIGNED_LONG_LONG contingent on the presence of ULLONG_MAX

* Reintegrate xdelta support

* Enable support for xdelta's secondary compressors

- Necessary for some patches

* Fix some format specifiers

* Remove unnecessary files from xdelta

* Include xdelta3.h with a relative path

* Add xdelta3 headers to HEADERS variable

* Gate Xdelta support behind HAVE_XDELTA

- HAVE_XDELTA is on by default
- HAVE_PATCH is still required for HAVE_XDELTA to be meaningful
- Support is mostly contingent on the availability of LZMA
- Anything modern should be okay
- Legacy platforms (e.g. DOS) may need to have Xdelta support disabled
- At least until some other solution can be found

* Disable HAVE_XDELTA on platforms where the build recently failed

- These come from looking at the failed builds on GitHub
- These are guesses, and may turn out to be wrong

* Fix a potential memory leak

- Whoops, looks like I need to call two cleanup functions
- xd3_close_stream exists separately from xd3_free_stream

* Split the --help printout for --xdelta into its own strlcat call

- GCC was complaining about #ifdefs within macro arguments being non-portable

* Fix some incorrect printf format specifiers

* Modify Xdelta to adhere to C89

- It's mostly using RetroArch's INLINE macro instead of the inline keyword

* Slight cleanups

* Remove a stray comma that was hindering C89 builds

* Add XDelta support to CHANGES.md

* Change how the xdelta patch's name is computed

- To be in line with other recent refactoring

* Fix an incorrect merge

- Whoops, this part was from before I figured out how to get the size of a patched file

* Explain the song-and-dance behind computing a patched file's size

* Define some XDelta3-related constants to 0 on 32-bit platforms

* Adjust some Xdelta-related macro definitions

- Exclude the encoder, since we're not making patches
- Move some #defines to after inclusion of <stdint.h>, to fix undefined behavior
- Remove _WIN32_WINNT overrides, since they were for code that we're not using

* Fix Xdelta support

* Wrap an encoder-only function in `#if XD3_ENCODER`
2023-11-23 20:19:07 -08:00
Viačasłaŭ Chalikin
6b0313ed21
Fix: request builder for the AI Service (#15879) 2023-11-06 10:52:17 -08:00
zoltanvb
aaff36d024
Small fixes for signedness warnings. (#15873) 2023-11-05 15:33:49 -08:00
Joe Osborn
3167529fbf
increase chunk size for reads/writes under emscripten (#15845) 2023-10-31 07:18:45 -07:00
Viačasłaŭ Chalikin
43105ab5c7
Add Belarusian language option (#15780) 2023-10-31 05:51:57 -07:00
Cpod12
274d47f957
Xunkar's AI service rework updated (#15640)
* AI service rework

* File missing

* Fixed C89 build

* Fixed usage of inline for C89 build

* Fixed an overlay unloading bug

Made sure to unload the overlay on release and when the server returns empty values in automatic modes.

* Fixed forward decl (c89)

* Fixed OpenGL texture loading

Moved image display to the main thread for now

* Changed some formatting slightly

* Fixed struct variable order and put brackets on newlines

* Moved pointer, fixed retroarch.cfg, and replaced strlcat with strlcpy

* Fixed catenation issue

* Fixed a few other catenation issues

* Fixed one more concatenation  issue

* Fixed concatenation issue

* Fixed a few other concatenation issues

* Fixed one more concatenation  issue

* potential fix for parsing issue

---------

Co-authored-by: Xunkar <329857+xunkar@users.noreply.github.com>
2023-10-24 00:27:06 -07:00
Eric Warmenhoven
793cb0cfa3
Fix ios-vulkan-ppsspp, and a small cloud save fix (#15801) 2023-10-15 05:45:03 -07:00
Joe Osborn
2baf9ec7e0
Enqueue replay record/playback until next frame (#15751)
* Enqueue replay record/playback until next frame

This fixes a bug where stdin commands activated via polling would
trigger replay record/playback in the middle of a frame, then input
checking would pull from them before the next frame came around---it
only makes sense to change the active replay in between frames, not
during them.

* fix comment syntax
2023-10-04 00:53:51 -07:00
libretroadmin
c82401dcb4 input_device_info - slim down - we don't need config_path and some of
the char arrays can be much smaller
2023-08-30 08:34:21 +02:00
sonninnos
5533f3881f
Prevent directory creation on bogus thumbnail downloads (#15634) 2023-08-21 23:07:38 -07:00
sonninnos
3246bc6655
Add visibility option for save state notifications (#15616) 2023-08-18 12:38:36 -07:00
Eric Warmenhoven
db39d78b8c
cloudsync: Don't sync playlists (#15608) 2023-08-16 22:04:55 -07:00
libretroadmin
c5088ce2ca Silence some warnings and general cleanups 2023-08-16 22:08:01 +02:00
libretroadmin
5f94f36204 Explicit typecasts to bool 2023-08-16 17:10:59 +02:00
libretroadmin
dadb5a6f41 Explicit typecasts to bool 2023-08-16 00:21:19 +02:00
sonninnos
d5c09b65e0
Don't write bogus thumbnails to disk (#15593) 2023-08-14 17:29:53 -07:00
libretroadmin
c8e6506687 Fix --disable-menu errors 2023-08-14 23:36:19 +02:00
Eric Warmenhoven
3ef31d2eee
cloud sync: clean up directory/filename mapping, log errors (#15561) 2023-08-07 20:43:22 +02:00
Eric Warmenhoven
fcedac5d0d
strlen -> STRLEN_CONST, fix warning (#15555) 2023-08-06 09:17:47 +02:00
Eric Warmenhoven
20f48ea800
cloud sync - fix a couple manifest management bugs (#15552) 2023-08-05 13:59:10 +02:00
Eric Warmenhoven
893b0d142e
Cloud Sync (#15548)
* cloud sync - algorithm and abstract cloud storage API

* WebDAV cloud sync driver, and associated net_http improvements

* Cloud sync settings menu
2023-08-04 09:20:50 +02:00
Jamiras
e1c366317a
allow callback to look at response BODY even when HTTP status code indicates failure (#15532) 2023-07-29 04:59:44 +02:00
sonninnos
e258235459 Save 'overwrite_playlist' to manual scan playlist 2023-07-26 15:57:49 +02:00
libretroadmin
55996bc9b6 Silence warnings 2023-07-17 17:43:50 +02:00
libretroadmin
aeff636a0f Minor cleanups to config_file.c 2023-07-17 09:45:52 +02:00
libretroadmin
bd090dea71 Replace more strlcat calls 2023-07-16 18:07:49 +02:00
libretroadmin
f39f1f6ff2 Make sure core_info_find is called first before using the data struct 2023-07-15 16:00:48 +02:00
libretroadmin
cd8fffe5d3 Rename all local variables for retro_system_info to sysinfo 2023-07-15 07:45:20 +02:00
libretroadmin
cf0d0e93a6 rarch_system_info_t local vars should be renamed from 'system'
to 'sys_info' to avoid false positive code analysis errors
2023-07-15 07:22:38 +02:00
libretroadmin
2acaa1f888 Fix cast warning 2023-07-15 06:30:26 +02:00
libretroadmin
9e34f22a29 Silence Xcode code warnings + general cleanups 2023-07-14 18:05:54 +02:00
nfore
9ca5c5e623 Revive/rewrite Keyboard Overlay and OSK Toggle
Add keyboard overlay preset, keyboard submenu, and osk_toggle hotkey. Use overlay caching for osk_toggle.

For now, keyboard menu has only preset path, auto-scale toggle, and opacity.

Related fixes:
- input_keyboard_event: Don't check hotkey binds when device is RETRO_DEVICE_POINTER
- Add input_keymaps_translate_rk_to_ascii() for correct character input to input_keyboard_event
- input_overlay_poll: Delay clearing INPUT_OVERLAY_BLOCKED flag until there is no overlay input (Avoids stray input after osk_toggle)
- Send keyboard events for modifiers before other keys (for correct modifier+key input if hitboxes overlap)
2023-07-09 04:42:49 +02:00
nfore
8a81d39437 Overlay Caching
Adds overlay_cache_ptr to keep a disabled overlay in memory when it's expected to be shown again.

Most input_overlay_deinit calls are replaced with input_overlay_unload, which caches the overlay unless initing/deiniting core or disabling overlays.

Loading a cached overlay is done as a swap, intended for osk_toggle.

Related updates:
- Fewer parameters for the overlay loading task. Use current settings when enabling an overlay
- Add input_overlay_check_mouse_cursor() to preserve show/hide mouse behavior
- Don't apply input_overlay_show_mouse_cursor in windowed mode (controlled by mouse grab only)
- Remove some dead code
2023-07-09 04:42:49 +02:00
nfore
f1cdd7a807 Fix overlay block_x_separation regression
block_x_separation was being ignored by auto-scale
2023-07-08 19:08:59 +02:00
libretroadmin
d514f1ded3 Avoid false positives with code analysis tools - rename
variables called 'system'
2023-07-05 03:29:49 +02:00
nfore
dd18152921 Fix overlay reach_x/y regression 2023-07-01 20:04:07 +02:00
Bernhard Schelling
c60878a10d Add netpacket interface
Adds a new libretro interface for a core to send and receive custom network packets for implementing a communication based multiplayer system instead of using the default state serialization based multiplayer. Connection management is still done by the frontend while a core gains the ability to easily support tunneling of multi-console data communication traffic.
2023-06-29 13:55:14 +02:00
libretroadmin
c92d7d3071 (task_database_cue.c) Simplifications 2023-06-20 20:07:44 +02:00
libretroadmin
bdc398d79f - Safer code - use strlcpy where possible instead of manual character
assignments for strings longer than 2 chars
- Use strlcpy concatenation instead of strlcat
- Make sure that what remains of iteration of the '_len' variable
for manual char assignment
is done in a safer way so mistakes are less possible
2023-06-20 16:33:55 +02:00
libretroadmin
fa80ec099f Rewrite some strlcat calls to strlcpy 2023-06-20 13:21:26 +02:00
libretroadmin
12e7b31633 database_info_list_iterate_found_match - use two strlcpys here instead
of snprintf
2023-06-20 07:18:44 +02:00
Bernhard Schelling
2c9bc8d850 Fix "variable set but not used" when HAVE_PATCH is not defined 2023-06-19 18:18:01 +02:00
libretroadmin
c253bf4cbd Reduce char arrays -
* titles and msgs sent to runloop_msg_queue_push should just be
128 in size
* single extensions queried by frontend around 16
2023-06-19 18:16:40 +02:00
libretroadmin
0bf3d21538 Reduce some char arrays which are too big 2023-06-19 17:31:50 +02:00
libretroadmin
9d027e51fe if 0 out update_single_core code 2023-06-19 16:51:04 +02:00
libretroadmin
e8242253a7 Reduce strlcat calls where possible 2023-06-19 06:00:10 +02:00
libretroadmin
0517354181 * replace more strlcat calls with strlcpy
* Get rid of unnecessary string copies by clever usage of strlcpy
* Get rid of unnecessary temp variables when not needed
2023-06-18 22:37:01 +02:00
libretroadmin
edecf0cb2d Replace more strlcat calls with strlcpy 2023-06-18 19:25:24 +02:00
libretroadmin
2ab38eaf98 Reduce some local char variables which were unnecessarily big,
and reduce some temp char variables
2023-06-18 12:31:49 +02:00
libretroadmin
631301b3f7 * Cut down on strlcat calls when possible and replace them with clever
usage of strlcpy (when position/offset of previous strlcpy/snprintf call
is known. strlcat implementation in libretro-common makes implicit strlen
call, using strlcpy avoids this
* Reduce a bunch of local char variables by use of said clever usage,
should save up on local stack size usage
2023-06-18 12:06:12 +02:00
libretroadmin
fc06e2f84f Simplify core_serialize_size and core_serialize_size_special 2023-06-16 17:20:27 +02:00
libretroadmin
7d60a2cc8f Move functions around, make some static, move some around 2023-06-16 03:27:19 +02:00
libretroadmin
489a5b9ac6 Fix MSVC2010 warning 2023-06-15 13:43:53 +02:00
Grisly Glee
4202f8650d
Fix trivial signedness warnings (#15377)
* Fix trivial signedness warnings

* Followup on trivial signedness warnings
2023-06-14 04:43:11 +02:00
sonninnos
6b9727911b
Improve scanner console output (#15345)
* Improve scanner console output

* More scanner console output coloring
2023-06-11 12:46:30 +02:00
libretroadmin
696dae6e70 Refactor away some video driver functions 2023-05-31 01:09:38 +02:00
libretroadmin
e70eb9ded2 Refactor video_driver_cached_frame_has_valid_framebuffer 2023-05-31 00:39:01 +02:00
libretroadmin
3737b99b05 Cleanups 2023-05-30 22:10:03 +02:00
libretroadmin
c0ba738f0d Header uniformity - enums on top, then structs, then public declarations 2023-05-30 21:03:36 +02:00
libretroadmin
7f55153457 take_screenshot - make function somewhat more readable 2023-05-30 12:26:52 +02:00
libretroadmin
c09fb6d95d Cleanups 2023-05-30 12:19:53 +02:00
libretroadmin
976d7b8067 Get rid of some useless wrapper functions 2023-05-28 17:56:28 +02:00
libretroadmin
f2bb150b0a Get rid of some menu_driver_ctl calls 2023-05-11 05:22:17 +02:00
libretroadmin
c3b16e1803 Get rid of MENU_ENTREIS_CTL_UNSET_REFRESH and
MENU_ENTRIES_CTL_GET_REFRESH
2023-05-11 01:18:26 +02:00
libretroadmin
91ea92e50b Get rid of some menu_driver_ctl commands 2023-05-10 21:30:09 +02:00
libretroadmin
0674613d28 Change return types of menu_driver_list_get_selection/get_size
and simplify struct
2023-05-10 08:36:44 +02:00
libretroadmin
099f33e0b3 (Menu) Simplifications 2023-05-06 22:10:55 +02:00
sonninnos
8f5442da5b Improve CLI scan console output 2023-05-03 20:29:40 +02:00
sonninnos
f5f1d35370 Add content import/scan via CLI 2023-05-03 20:29:40 +02:00
kikmon
d446f39c63
[PS1 Scanning] Serial extraction is now considered a failure if PSX.EXE is found, allowing CRC fallback and actually fixing the game scanning (#15241)
Co-authored-by: papa <anonymous>
2023-04-30 23:36:50 +02:00
libretroadmin
c087b044c2 * Add TODO/FIXME localize notes
* More snprintf optimizations
2023-04-30 19:30:07 +02:00
libretroadmin
3871ac4455 * Add FIXME LOCALIZE notes
* Some snprintf optimizations
2023-04-30 17:26:57 +02:00
libretroadmin
01cd40b1fc Increase conf_key_base size a bit 2023-04-28 20:21:08 +02:00
libretroadmin
cce75e274f (task_overlay) Cut down on snprintfs 2023-04-28 20:18:53 +02:00
libretroadmin
07eddd7229 Cleanups 2023-04-23 16:09:24 +02:00
warmenhoven
54055558f1
Fix several warnings (#15153) 2023-04-04 15:06:34 +01:00
Valentin
b0b5a40d44
add overlay parameter to control x/y separation in auto-scale mode (#15106) 2023-03-31 01:33:39 +01:00
libretroadmin
2902d11b1a Rewinding code should not be a forced built-in dependency 2023-03-17 16:08:41 +01:00
Joe Osborn
be5b198692
Replay rewind fix (#15079)
* Rewind during recording isn't visibly busted anymore but it doesn't rewind the replay properly during playback or record, inputs get clobbered; check frame pos/ptr stuff.

* Fix rewinding during movie recording and playback?
2023-03-11 18:37:48 +01:00
Joe Osborn
807640fed3
Associate states with replays (#15070)
* change bsv file suffix to replay, update strings

* add trivial RPLY block to save states

* WIP rerecording support, doesn't load states properly yet--issue with checking identifiers?

* Fixed a type error to get time identifiers working right, ready for testing

* handle case where state without replay data is loaded during replay

* cleanups

* whitespace cleanup

* Cleanups, change replay file format magic, fix logic around future states

* Remove failed future message

* Add play-replay-from-slot command, fix load-state-from-slot to use given slot

* build fixes

* Fix race conditions in emscripten build and incorrect replay state incrementing

* Style fix for single line if

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-08 00:10:59 +01:00
Joe Osborn
4d81f70f00
Replay nomenclature (#15054)
* change bsv file suffix to replay, update strings

* Fix bsv cli args

* Fix help whitespace

* Fix another message

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-03 23:16:48 +01:00
Joe Osborn
2125770236
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle

see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.

bsv files are also now stored with states, not saves.

* Compilation fixes

* Added command impls for play and record replay, and some code in load state to do the right thing there

* Guard some parts of the new code with HAVE_BSV_MOVIE

* wip, menu fixes

* more menu fixes, osd for movie errors, halt recording properly

* Menu and label fixes

* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks

* Fix replay autoincrement

* fix endif placement, whoops

---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-03 00:52:22 +01:00
libretroadmin
4fa19e552a CXX_BUILD buildfixes 2023-02-23 17:09:45 +01:00
libretroadmin
7ebab640d7 Cleanups/style nits 2023-02-23 13:15:14 +01:00
libretroadmin
8eff57f4d6 (task_movie) Cleanups/style nits 2023-02-21 11:10:25 +01:00
serakeri
347ea8157c
Various memory access fixes to prevent crashes (#14459) (#15000)
Prevent double free and null dereference when the controller is quickly reconnected.
Handle error when controller device query returns null instead of crashing.
2023-02-21 06:09:36 +01:00
libretroadmin
1d9cb216ca Silence some warnings/LTO issues 2023-02-19 10:21:37 +01:00
Joe Osborn
23976e9b44
Fix bsv playback from a starting state for dosbox (#14939)
This relaxes a warning about save state sizes for cores like
dosbox-pure that don't report accurate save state sizes.

Before, the warning would be issued and the state would not be loaded;
now, the warning is issued and the state is loaded anyway.

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-02-02 20:44:30 +01:00
Joe Osborn
5dbdde4316
BSV ergonomics improvements (#14929)
* BSV ergonomics improvements

- Date stamp toggled recordings instead of overwriting or using save
slot number
- Properly stop movie on playback EOF; also pause emulation
- Add recording flag to match playback flag in bsv state enum
- Rename bsv "movie path" to "movie auto path" to clarify role
- Allow stopping movie playback before EOF using record toggle hotkey
---------

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-31 05:34:26 +01:00
Joe Osborn
f149519351
Allow for both -e and -R to start a BSV file recording at a state (#14898)
* Allow for both -e and -R to start a BSV file recording at a state

The key issue is that loading a state takes some time, and the BSV
recording shouldn't start until that's done.

The minimal patch for this would just be a change to runloop.c which
moves movie initialization after entry state loading, throwing in a
task_queue_wait().  This makes for some awkward repeated autoload OSD
messages and doesn't solve the underlying issue.

Most of this change puts BSV recording start/stop into tasks, like
saving and loading are tasks; this was important to centralize BSV
operations a bit more and is the first part of a refactoring towards
more robust input recording.  The necessary wait is introduced in the
begin-recording callback.

Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-01-25 07:15:32 +01:00
libretroadmin
61c986ddfa Buildfix 2023-01-22 21:44:39 +01:00
libretroadmin
e798f99fea Several RARCH_CTL switches don't belong to retroarch state but
runloop state, hence remove
2023-01-22 20:16:14 +01:00
libretroadmin
378e90e745 retroarch.h functions should be namespaced 'retroarch_' instead
of 'rarch_'
2023-01-22 16:58:22 +01:00
libretroadmin
01c3684b10 Cleanups - try to remove stdio.h include where possible 2023-01-21 22:25:38 +01:00
sonninnos
3b129e6098
State slot hotkey adjustments (#14881) 2023-01-21 13:47:55 +01:00
sonninnos
127c676048
Cleanup runloop_environment logging + readability (#14855) 2023-01-16 01:49:25 +01:00
libretroadmin
daa9e352cc Remove asserts 2023-01-09 00:51:05 +01:00