Commit Graph
20967 Commits
Author SHA1 Message Date
lakhantheboss 22cfc4b0bb fix(libSceSaveDataDialog.native): initialize result directory name on empty selection
When sceSaveDataDialogGetResult is passed a non-null dir_name pointer but no directory name was selected by the dialog, write the empty string into dir_name so the caller's output buffer is properly null-terminated instead of retaining uninitialized bytes.
2026-10-21 19:57:36 +05:30
NikoandClaude Opus 5.5 d16be88e39 feat(libSceAudioOut): return 0 from sceAudioOutSetMainOutput like the firmware stub
sceAudioOutSetMainOutput threw "not implemented". In firmware 12.70
the export is `xor eax,eax; ret` (PS5-Audio-Passthrough-Research,
docs/FINDINGS.md line 25 at cf3c921): it reads no argument, changes
nothing and returns 0. It now does the same, defined in AudioOut.cpp
next to the Sys output calls.

Its parameters stay unknown and other firmware versions are
unverified. The debt file records this under Silent stubs, which
check_conventions requires for an export that returns a constant,
in place of the function's unknown-signature line.

The audio_out_sys test checks that the call does not throw and
returns 0; on main both checks fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 16:25:58 +02:00
NikoandClaude Opus 5.5 673ff23c5b feat(libkernel_sys): export _openat
_openat now opens files as openat does. It reads the mode argument only
when O_CREAT is set, as openat and _open do, and calls openat with the
same descriptor, path, flags and mode, so it returns the same
descriptors and errors.

The PS5 3.20 libkernel_sys export list (DNNDHH/PS5-3.20_Libs) has
_openat, NID bGVEgWXy6dg, as well as openat (A8Yk5AhNDck). In FreeBSD
11.4, _openat is the openat system call stub (lib/libc/sys/Makefile.inc,
amd64/SYS.h) and only libthr's openat adds a cancellation point
(thr_syscalls.c). openat here is not a cancellation point, so
forwarding to it leaves _openat without one, as in FreeBSD.

The openat debt entry now names _openat and no longer says that
O_NOFOLLOW is ignored: open, and so openat, has returned EMLINK for
O_NOFOLLOW on a symbolic link since 9421484572.

The kernel_sys test opens a file through a directory descriptor with
_openat and reads it back, creates one with O_CREAT, O_EXCL and mode
0600, checks outside Windows that it has mode 0600, reopens it for
writing, and checks EEXIST, EINVAL, EBADF and ENOTDIR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 16:25:53 +02:00
NikoandClaude Opus 5.5 3e1b0f5aa4 feat(libSceLibcInternal): export __inet_ntoa_r
The PS5 3.20 export inventory of libSceLibcInternal lists
__inet_ntoa_r next to inet_ntoa_r, and no AnyPS5 library exported it,
so a title importing it could not resolve it. It now runs inet_ntoa_r:
FreeBSD 11.4's arpa/inet.h names the function __inet_ntoa_r, and
inet_ntoa.c makes inet_ntoa_r a weak alias of it.

__inet_addr, __inet_aton and __inet_ntoa are in the same inventory,
but libc already exports them and the relinker also looks up
libSceLibcInternal imports in libc, so they are not added here.

guest_inet_address formats an address through __inet_ntoa_r into a
buffer of exactly the text's size, and checks that a buffer one byte
short is returned unchanged with ENOSPC and that inet_ntoa's buffer is
left alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 16:25:51 +02:00
hypermistandClaude Opus 5.5 44cc6ecb12 fix(libs): return what the firmware returns from 29 more calls it does not implement
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-22 03:15:51 +13:00
Dean 2c4b116da9 Merge pull request #7729 from milescoviello/fix/one-sample-depth-iter
fix(agc): draw a PS_ITER_SAMPLE program once per pixel into a one-sample depth target
2026-10-22 03:14:54 +13:00
hypermistandClaude Opus 5.5 4e57df0082 fix(libkernel_sys): return what the firmware returns from 20 calls it does not implement
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-22 03:12:01 +13:00
Dean e072e8840a Merge pull request #8269 from thuanquang/test/wcsncat-s-cases
test(libc): cover wcsncat_s exact fit, one too many and unterminated destination
2026-10-22 03:09:31 +13:00
Maz f638400709 fix(savedata): queue conversion completion events 2026-10-21 18:07:54 +04:00
slopggobblercobbler81 66b6314989 fix(relinker): reject section header file ranges outside the input file 2026-10-21 16:07:53 +02:00
orezraeyandClaude Opus 5.5 038d9a97d7 fix(libSceAgcDriver): return the console's workload stream registration errors
Measured on firmware 13.60: registering an id outside 1 to 31 or one
already registered returns 0x8a6c0033, checked before a null stream,
which returns 0x8a6c0035; unregistering an id outside 1 to 31 returns
0x8a6c0033 and one that is not registered 0x8a6c003a.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 11:06:19 -03:00
janzezno 1fcfacb27e fix(agc): keep completion write-backs off the full sync in the recorded-store recheck 2026-10-21 16:05:49 +02:00
Adrià f90a3f7297 Merge pull request #8523 from MarrasFederico/feat/kqueue-read-on-kqueue
feat(libkernel): watch a kqueue with EVFILT_READ
2026-10-21 16:03:30 +02:00
SebastianandClaude Opus 5.5 9497840de5 feat(libkernel): implement named POSIX semaphores
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QnkpF2oEMofseVz9Z7WEAC
2026-10-21 13:58:38 +00:00
Federico Marras 3c242fdd81 feat(libSceNgs2.native): map ATRAC9 waveform blocks as the module does in sceNgs2CalcWaveformBlock 2026-10-21 15:57:30 +02:00
Adrià 663de1ab21 Merge pull request #8516 from Felipebmaitan/feat/rudp-context-options
feat(libSceRudp): retain and query context options
2026-10-21 15:56:00 +02:00
MaxandClaude Opus 5.5 dfdfc9bca3 fix(libc): return the byte difference from strcmp, strncmp and memcmp
The console's compares return the difference of the first two bytes
that differ, read as unsigned char, as the prosper console oracle
measured. The host functions they called return only the sign on
Windows and differ by host C library.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:55:52 +02:00
Adrià 1b5d7021a3 Merge pull request #8471 from NoOverflow/feat/libSceNpAuth-a-variants
feat(libSceNpAuth): implement sceNpAuthGetAuthorizationCodeA and sceNpAuthGetIdTokenA
2026-10-21 15:52:56 +02:00
Adrià 145223c440 Merge pull request #8488 from orezraey/feat/playgo-set-language-mask
feat(libScePlayGo): store the language mask scePlayGoSetLanguageMask sets
2026-10-21 15:52:50 +02:00
hypermist 8e08acba70 Merge remote-tracking branch 'upstream/main' into feat/libc-sce-v2-thread-sync
# Conflicts:
#	core/libs/tests/GuestLibcThreads.cpp
2026-10-22 02:52:08 +13:00
Daniele Giovane f6d0623216 feat(libkernel_sys): implement pthread attribute and initial-thread queries 2026-10-21 15:50:39 +02:00
Evgeniy KazarinandClaude Opus 5.5 d6e270ea9f fix(libc): stop write-protecting resident runs on Windows
A clean resident run was made read-only so that the next collect
could skip GetWriteWatch, and the first guest store into it was
resumed on the guest thread. The exception frame Windows builds for
that fault overwrites the System V red zone below rsp (#361), which
is what #5596 removed for singly mapped direct memory. Resident runs
are now never armed and are collected with GetWriteWatch only.

Refs #9136

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 21:43:56 +08:00
orezraeyandClaude Opus 5.5 39cc6af2b1 fix(libkernel): compare the search start before rounding it
Measured on firmware 13.60: a start whose rounding to 16 KiB overflows
finds nothing, and of two equal free ranges the lowest is returned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:41:28 -03:00
JJenkx 78a31eecda test(agc): initialize geometry point-size registers in stage fixture 2026-10-21 09:41:22 -04:00
Federico Marras 9cde6f6fb5 Merge remote-tracking branch 'upstream/main' into feat/ngs2-calc-vag-block 2026-10-21 15:41:02 +02:00
orezraeyandClaude Opus 5.5 4319a7a5e7 fix(libkernel): match sceKernelAvailableDirectMemorySize arguments to PS5
Measured on firmware 13.60: an alignment that is not zero or a power of
two returns EINVAL before anything else; bounds with nothing between
them return ENOMEM, a negative start searches from the bottom, only the
start is rounded up to 16 KiB and the end is used as given; null outputs
are skipped; errors leave both outputs untouched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:39:19 -03:00
akkadbakkad89 3e0feb4bef feat(libc): export _Thrd_yield 2026-10-21 19:07:15 +05:30
KernelPanicNT 9f5640af66 fix(libSceNgs2): return the custom rack creation errors
sceNgs2RackCreate and sceNgs2RackCreateWithAllocator now return the firmware's errors for a custom rack whose buffer count is outside 1 to 4 or below the submixer's max_inputs, whose module buffer id is at or above the count, or whose submixer has more than 37 channels, and for the state sizes of the Gain, Reverb and PitchShift modules, the Reverb option size and word, and the PitchShift option word. Racks that pass these checks with one of these modules or Convolution, with more than one buffer, more than 8 channels or a submixer max_inputs other than 1 or 2 still throw, and so does sceNgs2RackQueryBufferSize for the rejected options.
2026-10-21 13:35:52 +00:00
Adrià 80565c5942 Merge pull request #8431 from juanpimg/feat/prx-declare-ps5-3.20-exports-tier2
feat(prx): declare the missing PS5 3.20 system exports in the next tier of libraries
2026-10-21 15:32:51 +02:00
Adrià 5faed506a5 Merge pull request #8428 from hypermoist/feat/libkernel-pthread-cleanup-push
feat(libkernel): implement pthread_cleanup_push and pthread_cleanup_pop
2026-10-21 15:32:45 +02:00
Adrià ba6abe1fd4 Merge pull request #8418 from hypermoist/feat/videoout-remove-buffer-attribute-option
feat(libSceVideoOut): implement sceVideoOutRemoveBufferAttributeOption
2026-10-21 15:32:40 +02:00
Adrià 1ae3f38d9e Merge pull request #8400 from slider/feat/libkernel-mutex-np
feat(libkernel): add mutex ownership, relative lock and spin/yield accessors
2026-10-21 15:32:34 +02:00
Federico Marras 428cd4e3ee feat(libSceNgs2.native): parse 8-, 24- and 32-bit PCM and float waveforms 2026-10-21 15:32:32 +02:00
Adrià f62069e840 Merge pull request #8363 from MarrasFederico/feat/video-recording-p-status
feat(libSceVideoRecordingP): report a recorder that is never open in sceVideoRecordingGetStatus
2026-10-21 15:32:27 +02:00
Adrià 5bd9912658 Merge pull request #8317 from hypermoist/feat/agc-static-buffers
feat(libSceAgc): implement static buffers and qwords
2026-10-21 15:32:19 +02:00
Federico Marras 2e706ed2e1 feat(libSceNgs2.native): map VAG waveform blocks in sceNgs2CalcWaveformBlock 2026-10-21 15:28:54 +02:00
xXPBSXxandClaude Sonnet 5.5 61fca3ae9b fix(libSceUlt): keep the reader-writer lock state alive until sceUltReaderWriterLockDestroy has unlocked it
Destroy locked the state's mutex through a reference into the map entry and
then erased the entry. When that held the last shared_ptr, the state was
freed before the lock guard unlocked its mutex. Take a shared_ptr copy
before the guard so the state outlives it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 15:28:50 +02:00
Yunus Shaikh d98ee15162 fix(agc): keep a rewatched import's memory compared once it is shared
Since #6678 a Windows host import under 1 MiB returns to the write watch
when its deferred settle completes (rewatchSettledImports). Grand Theft
Auto V (PPSA04264) imports buffers that are resident direct memory at that
point and later become shared 16 KiB views, when a second mapping of the
same direct memory demotes them. From then on the write watch arms them,
every guest store into them faults and is resumed, and the resumed faults
damage the red zone the game's zlib inflate_fast reloads its pointers
from, so the open world crashes in every run (#9136).

Before #6678 such a range stayed out of the write watch for good and was
compared. Rewatch now marks each range it returns to the watch with
GuestArenaCompareWhenShared first. While the memory stays resident it is
write-watched, as #6678 intends. Once it is shared its collects fail and
it is compared again, as before #6678, instead of being armed.

agc_rewatched_direct_shared maps direct memory resident, takes a block
out of the watch and rewatches it as a settle does, then maps the same
memory a second time. The rewatched block must collect while resident,
then collect as 0 through either mapping, stay unarmed and show the
store through both, while a block that never left the watch is still
collected.
2026-10-21 06:27:21 -07:00
Yunus Shaikh 98adb5f205 fix(libc): refuse to collect a shared page marked to be compared
On Windows a fault that AnyPS5 resumes in guest code can overwrite the
guest's red zone, [rsp-0x80, rsp-0x10) (#361). WindowsMappings arms every
alias of a shared page read-only when a clearing collect settles it, so
each guest store into that page faults and is resumed.

CompareWhenShared marks the pages of a range, and disarms any alias of
them that is already armed. Once a marked page is shared, collectable()
and the fresh pre-check refuse a clearing collect over it before anything
is armed, so its aliases are never armed and the caller compares the
range instead. While the page is still a resident run it is collected
through GetWriteWatch as before, which takes no fault.

windows_write_watch gains CheckComparedWhenShared: a marked resident
range stays collected, then a second mapping makes it shared, and from
then on its collects fail, neither mapping is armed and stores into it
take no fault, while the unmarked half of the same mapping is still
collected.
2026-10-21 06:27:20 -07:00
Federico Marras 4fb70223dd fix(libSceNgs2.native): report one ATRAC9 frame as the parsed decoder delay 2026-10-21 15:26:05 +02:00
SimoneandClaude Opus 5.5 c020ce8934 feat(libSceCesCs): implement generic MBCS character, Shift-JIS code and JIS X 0213 helpers
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:24:37 +02:00
SimoneandClaude Opus 5.5 f974e91f08 feat(libSceCesCs): convert GBK and EUC-CN through the CP936 table
Add the GBK (CP936) and EUC-CN profiles, their scalar conversions to
and from UTF-8, UTF-16, UTF-32 and UCS-2, and accept both profiles in
the MBCS string conversions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:24:24 +02:00
SimoneandClaude Opus 5.5 79fe0b903c feat(libSceCesCs): add UTF-16 and UTF-32 forms of the SBC and MBCS string conversions
Implement sceCesSbcTo{Ucs2,Utf16,Utf32}* and their inverses, and the
UTF-16 and UTF-32 MBCS string conversions and length queries, on the
existing single-byte, CP932 and CP51932 profiles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:23:56 +02:00
simonbronkandClaude Opus 5.5 3990593a19 feat(libSceCesCs): implement Shift-JIS and EUC-JP scalar conversions
Implement the single-character conversions between the CP932 and
CP51932 profiles and UTF-8, UTF-16, UTF-32 and UCS-2 in both
directions, and the Shift-JIS to JIS X 0208 row/cell arithmetic.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:23:34 +02:00
Federico Marras d6b384688a feat(libkernel_sys): implement the scePthread scope, atfork and setconcurrency forms 2026-10-21 15:18:19 +02:00
orezraeyandClaude Opus 5.5 c416e3aca3 feat(libkernel): implement shared event flags and sceKernelCloseEventFlag
Measured on firmware 13.60: attribute 0x100 makes a flag openable by
name, and only such flags can be opened. Each open returns a new handle
on the same flag, which sceKernelCloseEventFlag releases. Closing a
creator handle and deleting through an opened one return EPERM. Two live
shared flags cannot share a name, names of 32 or more bytes return
ENAMETOOLONG, and a missing name returns ESRCH. After the creator
deletes the flag, an opened handle polls and waits with EACCES and sets,
clears and cancels with no effect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:17:32 -03:00
1a74a6cdd9 fix(shader): keep a v_writelane lane known across computed-index window stores
fdfawef324 notes that current LLVM spills SGPRs into VGPRs it allocates like any other
register, so one window register can be an ordinary register early in a
program and hold spill lanes later. ReadLaneEliminator only followed a
spilled lane across M0-indexed window stores for slots never used as
ordinary registers, so RESIDENT EVIL 4 (PPSA07411) and LEGO Horizon
Adventures (PPSA14632) kept their reloaded descriptors as run-time
values and stopped. A known lane can only come from a v_writelane chain,
so keep it across a computed-index store instead; a constant-index store
of the slot still ends the spill. This is fdfawef324's suggestion on
#6277.

That such a store misses the spill cannot be proven for these programs,
so it is checked at run time where a replaced read depends on it: a
backward liveness over each slot and lane whose known value a replaced
read used puts a WindowLaneGuard before every computed-index store at
which that lane is live, and the guard records a WindowLaneSpill fault
when the store changes that lane of the slot. The driver reads the fault
buffer back for every program with such a guard and reports the dispatch
or draw as failed, so a broken assumption is no longer silent. This also
covers the pure spill slots main already folds.

Co-authored-by: fdfawef324 <[email protected]>
Co-Authored-By: Claude <[email protected]>
2026-10-21 20:17:08 +07:00
JJenkx a914d58c0c fix(agc): version point journal after polygon mode 2026-10-21 09:13:32 -04:00
JJenkx b779c90159 test(shader): retain sample order through legacy point replay 2026-10-21 09:13:32 -04:00
JJenkx 19be2835f2 test(shader): preserve legacy point requests after denorm serialization 2026-10-21 09:13:32 -04:00