Commit Graph

201 Commits

Author SHA1 Message Date
libretroadmin
c05ec27334 task_save_handler - rewrite code - put string on stack instead
of heap, avoid using strlcat
2024-06-16 18:44:08 +02:00
Jamiras
dfcf0c042c fix rewind not working when RetroAchievements cannot identify game 2024-06-12 13:17:52 -05:00
LibretroAdmin
0792144fe3 Revert "Revert "Tweaked limit, amended comment.""
This reverts commit f432cd3f78.
2024-06-04 13:26:41 -05:00
LibretroAdmin
d244ee4d80 Revert "Revert "Increase save state chunk size for all platforms""
This reverts commit d51911fac3.
2024-06-04 13:26:41 -05:00
LibretroAdmin
d51911fac3 Revert "Increase save state chunk size for all platforms"
This reverts commit 9c4ac3546a.
2024-06-03 22:50:28 -05:00
LibretroAdmin
f432cd3f78 Revert "Tweaked limit, amended comment."
This reverts commit c1bb2fd9a1.
2024-06-03 22:50:28 -05:00
Joe Osborn
c1bb2fd9a1 Tweaked limit, amended comment. 2024-05-29 13:36:43 -05:00
Joe Osborn
9c4ac3546a Increase save state chunk size for all platforms
A rationale is given in the comments, but even a class 6 or class 10 SD card can handle reads and writes on the order of MB/s, which means a 4KB chunk size is just wasting time in syscalls.  This could maybe be fixed with a buffering reader but I don't feel comfortable tweaking libretro-common's VFS to handle that.  Instead, I thought it would be good to both remove an ifdef and increase the chunk size to 128KB.  For cores with small states this will should make state saving virtually instantaneous, and for cores with large states it should be a 32x speedup.
2024-05-29 13:36:43 -05:00
Daniel Byon
fc10539f3c
Fix auto save state when state file does not already exist (#16084)
Co-authored-by: Daniel Byon <daniel@danielbyon.com>
2024-01-07 16:59:59 -08:00
David G. F
ab376eb669
Make auto-savestates not use the task queue (#16061)
Auto savestate (and its optional thumbnail) is generated on core unload
(quit, netplay start, etc). This ends up using the task-queue, which in
many cases deadlocks and/or causes a crash due to its asynchronous
nature.

Given that this is a state that must be generated before quiting or
reloading the core, it makes no sense to use the task queue, it should
be a synchronous job like for instance SRAM saving.

This should fix #15248 (tested by @schmurtzm)
2023-12-30 21:44:15 -08:00
David G. F
ea87495a4e
Save improvements (#16053)
* Simplify autosave command function

* Simplify and split save and savestate logic

save.c contains "SRAM" saves and their logic, which uses no task/queue.
2023-12-28 11:10:46 -08:00
Joe Osborn
3167529fbf
increase chunk size for reads/writes under emscripten (#15845) 2023-10-31 07:18:45 -07:00
sonninnos
3246bc6655
Add visibility option for save state notifications (#15616) 2023-08-18 12:38:36 -07:00
libretroadmin
5f94f36204 Explicit typecasts to bool 2023-08-16 17:10:59 +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
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
fc06e2f84f Simplify core_serialize_size and core_serialize_size_special 2023-06-16 17:20:27 +02:00
libretroadmin
e70eb9ded2 Refactor video_driver_cached_frame_has_valid_framebuffer 2023-05-31 00:39:01 +02:00
warmenhoven
54055558f1
Fix several warnings (#15153) 2023-04-04 15:06:34 +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
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
sonninnos
3b129e6098
State slot hotkey adjustments (#14881) 2023-01-21 13:47:55 +01:00
libretroadmin
daa9e352cc Remove asserts 2023-01-09 00:51:05 +01:00
libretroadmin
04f510d503 Cleanup header includes 2022-12-05 15:10:19 +01:00
LibretroAdmin
07378abbdf (task_save) Use flags instead of booleans
(task_screenshot) Start reducing amount of parameters
2022-10-30 18:41:41 +01:00
sonninnos
bbd6c0ae9a
Add delay to savestate notifications (#14514) 2022-10-15 11:29:07 +02:00
LibretroAdmin
91119d038f
(gfx_display/gfx_animation) Use flags instead of bools (#14488)
* (gfx_display/gfx_animation) Use flags instead of bools
* (task_save) Use flags instead of bools
2022-10-07 00:10:32 +02:00
LibretroAdmin
654203be0a (Autosave) Change/improve exit behavior of autosave thread -
if condition variable is signaled, the loop is ran another
last time so we can do a final check/save before stopping the thread.
Old commit courtesy of tobiasjakobi
2022-09-03 00:21:58 +02:00
LibretroAdmin
2463a63c78 (task_save.c) Miscellaneous cleanups:
* Remove unused return type of one function
* Remove some TODO/FIXME notes
* Small style nits
2022-09-02 23:35:48 +02:00
LibretroAdmin
61e24132bf (task_save.c) Simplification in control flow
(snprintf) Try to reduce or simplify snprintf calls, only tend to
use it for processing integers/numbers and avoid it for regular
string concatenation (NOTE: we try to be a bit safer about it to
address earlier cited criticism, although we don't consider concatenating
3 or 4 characters at the end to be insecure)
(msg_hash_to_str) Try to avoid duplicate calls to the same localized
string when we can just cache the results once instead locally
2022-08-27 07:55:02 +02:00
LibretroAdmin
da13fb0f48 Don't include errno.h in files that don't justify its use 2022-08-25 05:19:30 +02:00
sonninnos
ee8993c76a
Silence Linux snprintf warnings (#14131) 2022-07-02 14:08:27 +02:00
twinaphex
460f5e745d Silence some MSVC 2019 code analysis warnings 2022-03-05 14:39:56 +01:00
jdgleaver
42e03cae83
Disable save states based on save state support level defined in core info files (#13562) 2022-02-02 16:49:53 +01:00
jdgleaver
40925baacd Enable SRAM for contentless cores 2021-10-14 13:59:23 +01:00
Michael Burgardt
d8db234df0
Concatinate some previously truncated strings for easier translation (#12120) 2021-09-16 19:00:14 +02:00
bulzipke
8018be5c9b
Fix ram states to file when core deinit (#12956)
* Fix ram states to file when core deinit

* Fix unterminated state_path
Call CMD_EVENT_RAM_STATE_TO_FILE when CMD_EVENT_UNLOAD_CORE too
2021-09-08 18:01:07 +02:00
bulzipke
8adc24ecbc
(3DS) Add bottom screen menu (#12470)
* (3DS) Add bottom screen menu
 -> User can save/load state on botom screen with thumbnail.
 -> Call a save_state_to_file() when RAM state has data to write a disk.
 -> If the bottom screen needs updating, swap the bottom framebuffers.

Add: SAVE/LODE STATE TO RAM
 -> This is useful for devices with slow I/O
 -> 3DS bottom save state use CMD_EVENT_SAVE_STATE_TO_RAM
 -> 3DS bottom load state use CMD_EVENT_LOAD_STATE when RAM state has no data
 -> 3DS bottom load state use CMD_EVENT_LOAD_STATE_FROM_RAM when RAM sate has data

* Rewrite path_get_state to retroarch_get_current_savestate_path

* Fix unterminated state_path
2021-09-03 18:14:03 +02:00
twinaphex
13a2d2419f (PSL1GHT) Fix function prototype for 'button' pad driver
(Task save) Fix warning in platform port
2021-08-09 20:25:27 +02:00
twinaphex
b5d4c5b041 Silence -Wsizeof-pointer-memaccess warnings pointed out here -
https://travis-ci.org/github/libretro/RetroArch/jobs/764003625
2021-03-22 23:43:11 +01:00
twinaphex
6cc51fa5f5 task_load_handler - small cleanups 2021-03-17 10:40:47 +01:00
twinaphex
7e2113b405 (task_save.c) Allocate the string on heap instead of putting it on stack 2021-03-17 10:12:04 +01:00
CrystalCT
9ac61f9cc5 Add some PSL1GHT ifdefs 2021-03-17 08:46:02 +01:00
Jamiras
ba1d48fb6a ensure hardcore remains disabled through load process 2021-02-28 13:07:24 -07:00
Jamiras
1e39de800c
fix undo load state (#12062) 2021-02-21 22:50:27 +01:00
Jamiras
2280d126f3 address feedback 2021-02-18 07:44:52 -07:00
Jamiras
2d841715cb include achievement runtime state in save states 2021-02-17 19:44:39 -07:00
sonninnos
90485b5586 Savestate logging cleanup 2021-02-03 13:29:32 +02:00