Commit Graph

771 Commits

Author SHA1 Message Date
LibretroAdmin 82d8b9630a
Merge pull request #17750 from BinBashBanana/master 2025-04-10 03:35:45 -07:00
BinBashBanana 05cefc9a4d AudioWorklet driver, misc. emscripten fixes 2025-03-28 19:41:40 -07:00
pstef 3bf6635ec6 Make printf format match the type 2025-03-28 09:48:20 +00:00
pstef d5ba7902a4 Reduce stack usage in command.c
by using PATH_MAX_LENGTH to define the length of buffers that store
paths.
2025-03-23 09:31:08 +00:00
Joe Osborn c413bcc626
Threaded emscripten fixes (#17614)
* Actually read CLI args in emscripten

* Fix fetchfs manifest parsing, increase download chunk size

The chunk size should probably be made a parameter in the future.  The
larger chunk size trades longer hitches for fewer hitches.

* Add exec command driver and API functions for emscripten.

Under WASMFS, stdin/stdout can't be customized the way they can with
the JS FS implementation.  Also, this approach frees up stdin/stdout
and simplifies interaction with the command interface for web embedders.

* fixup upload paths, show use of new emscripten cmd interface

* Add JS library function names to EXPORTS as well as EXPORTED_FUNCTIONS for older emsdk versions
2025-02-24 09:25:05 -08:00
LibretroAdmin 1a561ea0c2 Less passing around of settings_t pointer 2025-02-10 16:11:18 +01:00
LibretroAdmin ddd7ff2d33 get rid of some settings_t pointer passing 2025-02-10 15:47:18 +01:00
LibretroAdmin 376e4b307c Style nits 2025-02-09 15:40:45 +01:00
sonninnos 2c06049a2f
Allow CLI --entryslot fallback to normal states (#17539) 2025-02-09 06:11:13 +01:00
LibretroAdmin 0b329018ee Less string buffers and less string copies 2025-01-16 23:59:22 +01:00
zoltanvb 9e048d8d77
Reset save state index on content load, if auto index is not enabled. (#17391) 2025-01-11 02:50:35 +01:00
sonninnos 1e32a1e5e9
Save state logging and label unifications (#17384) 2025-01-10 14:47:28 +01:00
zoltanvb 5399faaa9d
Fix savestate auto-index detection (#17351) 2025-01-06 11:45:00 +01:00
LibretroAdmin 1e656261b0 Local len variables need to have '_' prefix 2024-12-30 14:03:58 +01:00
LibretroAdmin 56c63b8c19 Small cleanups - conventionalize char *s, size_t parameter usage 2024-12-30 09:44:40 +01:00
LibretroAdmin 4297f02544 Use returntype for fill_pathname_basedir 2024-12-28 23:11:24 +01:00
LibretroAdmin 9376b99ea6 - Make some functions static in command.c
- Set returntype to size_t for some functions, avoid strlen
2024-12-28 22:49:03 +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 2cfdccc085 Less string intermediary copies 2024-12-24 18:46:22 +01:00
libretroadmin de8f979cb7 less string copies 2024-12-24 05:10:09 +01:00
libretroadmin b3e5c578b3 Faster shader capabilities queries 2024-12-22 21:58:51 +01:00
LibretroAdmin 739f2ff55c
Reduce calls to path_remove_extension - use fill_pathname instead (#17270)
* Reduce calls to path_remove_extension - use fill_pathname instead

* More fill_pathname usage
2024-12-20 21:40:58 -08:00
Joe Osborn abe7d01e74
Report replay frame number for active_replay stdout api (#17039)
This changes the replay movie's frame_ptr (a 20-bit number used to
point to a log of file offsets) into a frame counter, which is masked
against the 20-bit pattern for use in the file offset log but also
functions as a time index into the replay.  Right now that is reported
in `GET_CONFIG_PARAM active_replay` but in the future it could be used
to show how far into the replay we are during playback or how long the
replay is during recording.
2024-09-27 14:37:31 -07:00
Eric Warmenhoven b557bc9523
Fixing compiler warnings (#17001) 2024-09-14 13:11:20 -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
zoltanvb 98c79b3f14
Add savestate wraparound. (#16947)
When save state auto indexing is enabled, and maximum kept states
are limited, wrap around after reaching the configured maximum.

A gap in the indexing is used to keep track of most recent state.
If e.g. maximum kept amount is 5, then indexes 0..5 will be used,
if 3 is empty, most recent state is 2.
2024-09-03 22:01:41 -07:00
zoltanvb cef6da6a03
Missed a tiny bit of detail: actually deleting the file. (#16845) 2024-08-06 17:03:16 -07:00
zoltanvb c057c8bfb2
Delete savestate thumbnails if needed (#16836)
Apply garbage collection also for the savestate thumbnails.
2024-08-02 22:23:39 -07:00
libretroadmin e279592ce6 Cut down on some snprintf calls 2024-06-15 01:29:08 +02:00
libretroadmin 3e85a17d7a iFix warnings picked up by -fanalyzer 2024-05-23 23:50:23 +02:00
sonninnos fc6d251be9
Fix save new config name when core loaded (#16458) 2024-04-23 09:54:04 -07:00
libretroadmin 6c303be476 Fix core config saving 2024-04-23 18:52:56 +02:00
Eric Warmenhoven 5fd4eb905c
iOS QOL improvements (#16444)
* iOS/tvOS: bundle cores as frameworks as opposed to dylibs

* iOS/tvOS: update plist to indicate controller support

* iOS/tvOS: living within the sandbox

* iOS/tvOS: import content through share sheet

* iOS/tvOS: default audio sync off due to crash on background

* iOS/tvOS: don't try altkit if there's no reason to

* iOS/tvOS: enumerate cores for appstore distribution
2024-04-18 03:01:39 -07:00
sonninnos 9dfa1df39e
Remove some unneeded logging (#16298) 2024-02-26 20:59:01 -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
zoltanvb 232095797e
Set fixed locale for numbers, close to config read/write (#15782)
Move setlocale() closer to config file read/write.
2023-10-31 12:03:24 -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
sonninnos 12136ad516
Add 'Save As' option for remaps and overrides (#15630) 2023-08-21 16:11:48 -07:00
libretroadmin 947249ac25 Cut down on more strlens 2023-07-15 09:52:47 +02:00
libretroadmin 9e34f22a29 Silence Xcode code warnings + general cleanups 2023-07-14 18:05:54 +02:00
libretroadmin aa8d029369 Turn command_memory_get_pointer function static 2023-07-05 03:37:00 +02:00
libretroadmin d514f1ded3 Avoid false positives with code analysis tools - rename
variables called 'system'
2023-07-05 03:29:49 +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 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 f66a8dc538 Cleanup unused variable warnings 2023-06-01 22:34:16 +02:00
libretroadmin c24744eae5 Remove video_driver_show_mouse/hide_mouse 2023-05-29 18:58:23 +02:00
libretroadmin 91ea92e50b Get rid of some menu_driver_ctl commands 2023-05-10 21:30:09 +02:00
Joe Osborn d118259589
Make cmd interface more useful for replay information (#15132)
* Add 'active replay' config get to config command and flush stdout for command replies; tweak output of play replay command

* guard on have_bsv_movie
2023-03-24 22:41:07 +01:00