59 Commits
Author SHA1 Message Date
LibretroAdmin bf06fa747d libretro-common: sync rchd and rflac from RetroArch
Brings in RetroArch's "rchd: allocate nothing per hunk once an image
is open" and "rchd: say how long lent bytes have to live". CHD reads
no longer allocate once the image is open: the staging buffer is
reused, the CD FLAC decoder is kept and rewound, and the hunk cache,
CD sector scratch and FLAC rewind point are allocated at open. A
malloc counter over every sector of CD LZMA, CD FLAC and mixed images
went from 299 allocations during reads to 0.
2026-10-28 20:21:07 +01:00
LibretroAdmin 00805de892 libretro-common: sync from RetroArch
Bring every libretro-common file the core builds up to RetroArch
61606d92b8b026106b51f75365bea592a6fb94b9. 34 files had drifted, including rchd (now accepts
version 5 hunks up to 1 MiB, the largest chdman writes) and
chd_stream, which now reads through vfs_prefetch.

New files the synced sources need: vfs/vfs_prefetch.c and
encodings/encoding_xxh64.c (with their headers), built with HAVE_CHD.

Dropped what nothing builds or includes any more:
streams/file_stream_transforms.c and its header (the core never calls
rfopen/rfread and friends) and the libchdr headers (the core always
reads CHDs with rchd).

tools/chd/run.sh: drop memmap/memmap.c, which the repo does not carry
(the script could not build), and add the new sources plus
retro_eventcount.c that vfs_prefetch needs with threads.
2026-10-28 20:20:53 +01:00
LibretroAdmin fa313b75bc Drop memmap.c from the build
Nothing in the core calls into memmap.c: file_stream maps files through
vfs_implementation, which takes mmap() from the system headers. The
synced copy carries memshm_create, which needs shm_open/shm_unlink from
librt on glibc older than 2.34, so linking it with --no-undefined fails
on the xenial build lanes.
2026-10-09 12:40:44 +02:00
libretroadmin 85e45d084f Lock-free DSP thread on libretro-common; trim libretro-common
The threaded DSP takes no mutex or condition variable. The emulation
thread publishes a monotonic tick count with a release store and wakes
the DSP thread through a retro_eventcount once per 32 ticks and at
frame end; the DSP thread runs every posted tick and writes samples
into a retro_spsc ring that upload hands to the frontend in place.
Mode switches keep samples in order, and the thread runs out every
posted tick before it exits. THREADED_DSP defines HAVE_THREADS and
builds the eventcount and SPSC sources.

libretro-common is synced with RetroArch master and holds only the
sources the core builds and the headers they and the core include;
rstrtod.c is built since file_stream needs it.
2026-10-08 07:42:18 +02:00
LibretroAdmin ea60917d7f chd: decode zstd hunks
The CHD build selects rchd's zstd codec alongside DEFLATE, LZMA and
FLAC and compiles encoding_rzstd.c, so images compressed with cdzs or
zstd read like any other. rchd, chd_stream, encoding_rzstd,
encoding_deflate and compat/intrinsics.h are resynced from RetroArch.

tools/chd/run.sh compresses a synthetic two-track image with each CD
codec chdman offers and checks every sector against the CUE it came
from, raw and cooked, under ASan and UBSan.
2026-10-03 06:18:03 +02:00
Antonio SJ Musumeci f36833d57b Update libretro-common and adopt RCHD
- Refresh the vendored libretro-common tree to the pinned upstream snapshot.
- Replace CHD stream integration with VFS-backed RCHD decoding and per-track logical maps.
- Build the RCHD and RFLAC codec closure and remove obsolete libchdr and LZMA dependency trees.
- Negotiate frontend VFS v3 for file, path, and directory access with legacy fallback.
- Preserve mixed-track gaps, raw-sector offsets, and native CD-DA sample order.
2026-08-20 19:51:11 -05:00
Antonio SJ Musumeci 862fb18efe chd_stream: support full-disc track streams 2026-06-02 15:11:40 -05:00
Antonio SJ Musumeci 087a5b0dac chd_stream: harden metadata parsing 2026-06-02 15:11:40 -05:00
RTA 409e1d19fb libretro: add core options v2 categories with legacy fallback 2025-12-26 17:53:06 +01:00
jdgleaver 9027196cd7 Fix threaded DSP + switch to rthreads 2021-12-14 17:54:20 +00:00
twinaphex 7f2b967618 Buildfixes for MSVC (need to discuss this with rtissera too for libchdr) 2021-02-12 01:15:34 +01:00
twinaphex 15a775bd2d Last needed buildfix for OSX PPC 2019-12-27 08:06:23 +01:00
twinaphex 77facb0571 Buildfix 2019-12-27 08:02:51 +01:00
jdgleaver 7346ef4148 Add enhanced core options 2019-08-01 18:03:19 +01:00
Brad Parker b93466aec1 update libretro-common 2019-07-21 12:24:40 -04:00
bparker06 440e410ea3 Update cdrom.c 2019-07-15 10:40:46 -04:00
twinaphex bf84ba3a1e Add missing header include 2019-07-15 07:27:24 +02:00
Brad Parker 8ed6e40430 update libretro-common 2019-07-15 01:11:48 -04:00
Brad Parker 216aa7e1ae update libretro-common 2019-07-08 16:12:16 -04:00
Brad Parker a79324f57a update libretro-common 2019-07-06 17:33:29 -04:00
Brad Parker 28bfb76d9c update libretro-common 2019-07-05 11:10:00 -04:00
Brad Parker 77b2a060a8 update libretro-common 2019-07-04 23:24:34 -04:00
Brad Parker 4818f79a30 update libretro-common 2019-07-02 03:35:09 -04:00
Brad Parker 285d8b0a3a update libretro-common 2019-07-02 00:22:17 -04:00
Brad Parker 21074d6b29 initial CD read support 2019-07-01 16:50:58 -04:00
natinusala 1973b683e0 Cleaner Switch CHD workaround 2019-01-31 11:16:16 +01:00
natinusala 8c4ac93745 libnx: fixed CHD support 2019-01-30 20:44:55 +01:00
Antonio SJ Musumeci 686ec95e8d add ability to run DSP on separate thread 2018-08-29 07:55:56 -04:00
twinaphex 30f0f75338 Update libretro-common 2018-04-19 08:15:48 +02:00
twinaphex 4d99049752 Buildfix 2018-04-16 08:33:45 +02:00
twinaphex d7cdb9c029 Update libretro-common files 2018-04-13 01:14:38 +02:00
twinaphex ae295c85da Updates 2018-03-28 16:44:28 +02:00
twinaphex 11331e27b8 Updates 2018-03-28 16:42:40 +02:00
twinaphex 1324bd4d4f Update 2018-03-28 16:40:02 +02:00
twinaphex 9419718480 Add missing retro_assert.h 2018-03-28 16:38:22 +02:00
twinaphex 7c2a1b7f83 Update libretro-common 2018-03-28 16:32:04 +02:00
twinaphex 6a50b7d58f Update 2018-03-24 11:42:25 +01:00
twinaphex 8be2ef5b6c - Update some libretro-common headers
- Buildfix for builds that don't include CHD support
2018-03-23 11:17:03 +01:00
Antonio SJ Musumeci 51498aebec add CHD support and rework cd image loading / reading
It doesn't appear there are any libretro standard libraries to manage
CDROM images. While such a thing would be useful in the long run for
this change I've imported the pce fast deps used by libchdr and
libretro-common's chd_stream.
2018-03-19 12:49:33 -04:00
twinaphex b49b04821f Update 2018-03-17 03:34:46 +01:00
twinaphex 2cdd338e89 Backport trapexit PR 2018-03-16 20:53:13 +01:00
twinaphex 5f3804f470 Updates to libretro-common 2018-01-05 13:57:28 +01:00
twinaphex 9a29f31cb4 Update 2017-12-16 18:54:28 +01:00
twinaphex d2c9b07e2a update 2017-12-16 15:52:41 +01:00
twinaphex 5a8e52186b Update 2017-12-16 14:18:31 +01:00
twinaphex 311daea6d9 Update files 2017-12-16 03:20:45 +01:00
twinaphex d2c91928d6 Update 2017-09-16 09:43:46 +02:00
twinaphex e7fe418d89 Update libretro-common 2017-09-16 09:42:33 +02:00
twinaphex 9053104066 Update 2017-08-05 13:20:23 +02:00
twinaphex 3382855b4d Updates 2017-07-02 06:51:49 +02:00