Commit Graph

1943 Commits

Author SHA1 Message Date
Claude 13444c82e9
fix(libc): print NaN without a sign in the guest printf formatter
The guest formatter handed NaN to the host's snprintf, which prints
-nan for a negative NaN and +nan or " nan" with the + and space flags.
FreeBSD 11's vfprintf clears the sign of every NaN and prints nan (NAN
for the upper-case conversions), keeping the width and the - flag and
ignoring 0. The formatter now does the same for a, e, f and g and
their long double forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VZWLdTjf1S57iLgn2rcaFb
2026-10-13 08:26:41 +00:00
Adrià e96bfffa59
Merge pull request #4877 from jagrat04/feat/libkernel_sys-renameat
feat(libkernel_sys): implement renameat
2026-10-13 10:23:01 +02:00
jagrat Singh 2a8e745267 feat(libkernel_sys): implement renameat 2026-10-13 10:19:35 +02:00
Adrià 4899658e87
Merge pull request #4882 from Lorkydey/feat/libkernel-coredump-stop-info-cpu
feat(libkernel): answer CPU stop-info queries outside the coredump handler
2026-10-13 10:19:19 +02:00
Adrià db3d379c87
Merge pull request #4870 from jagrat04/feat/libkernel_sys-unlinkat
feat(libkernel_sys): implement unlinkat
2026-10-13 10:16:19 +02:00
Adrià 534451426a
Merge pull request #4860 from jagrat04/feat/libSceNpEntitlementAccess-pft-flag
feat(libSceNpEntitlementAccess): implement sceNpEntitlementAccessGetPftFlag
2026-10-13 10:13:42 +02:00
jagrat Singh 55ddffe269 feat(libkernel_sys): implement unlinkat 2026-10-13 10:11:24 +02:00
Adrià bd826d52f8
Merge pull request #4816 from winstrex/feat/agc-get-gs-prim-payload
feat(libSceAgc): implement sceAgcGetGsPrimPayload
2026-10-13 10:11:08 +02:00
Adrià Franch dd5853d8bc docs(debt): cite the source of sceNpEntitlementAccessGetPftFlag 2026-10-13 10:08:30 +02:00
jagrat Singh 7900b59d52 feat(libSceNpEntitlementAccess): implement sceNpEntitlementAccessGetPftFlag
Reports a full game, not a Play First Trial: 0 is written to the uint32_t output and 0 returned; a null pointer returns 0x817D0002.

Signature, value, one-word write and error match sceNpEntitlementAccessGetGameTrialsFlag and sharpemu src/SharpEmu.Libs/Np/NpEntitlementAccessExports.cs:98-116. 0x817D0002 is the parameter error of KytyPS5, prosper and sceNpEntitlementAccessGetEntitlementKey. The library has no initialization state, so none is checked. Update technical debt documentation and add unit test in guest_offline_imports.
2026-10-13 10:08:24 +02:00
Adrià c080fc2d5b
Merge pull request #4786 from p3n1cillin/claude/load-exec-restart
feat: convert a title's other executables and start them with sceSystemServiceLoadExec
2026-10-13 10:02:50 +02:00
Adrià 42e5edadbe
Merge pull request #4708 from Aathish-D/feat/savedata-get-convert-progress
feat(libSceSaveData): implement sceSaveDataGetConvertProgress
2026-10-13 09:56:01 +02:00
Adrià 0587a755d6
Merge pull request #4775 from p3n1cillin/claude/pad-angular-velocity-deadband
feat(libScePad): apply the angular velocity deadband
2026-10-13 09:55:21 +02:00
Adrià a527286241
Merge pull request #4743 from jagrat04/feat/libkernel_sys-mkdirat
feat(libkernel_sys): implement mkdirat
2026-10-13 09:55:12 +02:00
p3nicillin 99efb32c40 feat: convert a title's other executables and start them with sceSystemServiceLoadExec
The relinker's repeatable --executable converts another executable of the
title beside the output, sharing its libs, app0 and guest modules.
sceSystemServiceLoadExec maps /app0 paths to those executables, passes the
argument list on the new command line and finds the main executable through
APS5_EBOOT. RetroArch (PPSA99169) starts its frontend picker this way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 08:51:50 +01:00
Aathish b078f475ec feat(libSceSaveData): implement sceSaveDataGetConvertProgress 2026-10-13 09:48:44 +02:00
Adrià fc1f063f51
Merge pull request #4622 from jagrat04/feat/libkernel-lutimes
feat(libkernel): implement lutimes
2026-10-13 09:48:07 +02:00
Adrià a373241de4
Merge pull request #4582 from jagrat04/feat/libkernel-madvise-madv-protect-pr
feat(libkernel): accept MADV_PROTECT advisory hint in madvise
2026-10-13 09:44:18 +02:00
Adrià 6d7b873702
Merge pull request #4945 from nicolasfalesy/fix/libc-unwind-backtrace-cursor
fix(libc): let a title's own libunwind read _Unwind_Backtrace frames
2026-10-13 09:36:45 +02:00
Adrià 9ba9ac1c8b
Merge pull request #4834 from GoodTimeclubs/feat/exports-ppsa01317
feat(exports): export the calls PPSA01317 imports
2026-10-13 09:33:36 +02:00
Adrià 30caf2b2a5
Merge pull request #4682 from bubblegg/feat/netctl-get-if-stat
feat(libSceNetCtl): add sceNetCtlGetIfStat
2026-10-13 09:26:47 +02:00
Adrià 6c87f76b57
Merge pull request #4753 from p3n1cillin/claude/audio-out-ex-monitor-info
feat(libSceAudioOut): list no audio descriptors in sceAudioOutExGetMonitorInfo
2026-10-13 09:26:42 +02:00
p3nicillin 3292cd39fb feat(libSceSystemService): relaunch the title for sceSystemServiceLoadExec of its own eboot.bin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 08:25:03 +01:00
Dean c2565f0149
Merge pull request #4391 from MarcZX100/codex/socket-descriptors-4366
fix(libkernel): give guest sockets ordinary descriptor numbers below FD_SETSIZE
2026-10-13 19:52:08 +13:00
Nicolas Falesy db3ec02c54 fix(libc): let a title's own libunwind read _Unwind_Backtrace frames
Homebrew built with the ps5-payload-dev SDK links LLVM libunwind
statically but imports _Unwind_Backtrace from libSceLibcInternal. Its
trace callback then reads each frame with its own _Unwind_GetIP, which
treats the context as a libunwind cursor and calls through the virtual
table in its first word. AnyPS5's context started with the saved RAX, so
the call jumped to a register value and the title crashed on its error
path (vkQuake, PPSA99010, without its game data). The context now starts
with a table in AbstractUnwindCursor's slot order that answers register
reads and writes, validFloatReg and isSignalFrame; other slots throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvDbpwUPTa78oCAJqe7m9K
2026-10-13 01:55:14 -04:00
Dean ea2bbefb2b
Merge pull request #4402 from jakezwang/fix/spirv-redundancy-memory
fix(shader): release bundled optimizer traversal maps
2026-10-13 18:49:45 +13:00
Dean 2cc97e1057
Merge pull request #4197 from MarcZX100/codex/audit-coredump-userdata
feat(libkernel): implement coredump user data calls
2026-10-13 18:24:28 +13:00
Dean 7e181fcc38
Merge pull request #3874 from oneandonlydean/up4/import-window-compare
perf(agc): compare an import window's pages when the window closes
2026-10-13 17:55:13 +13:00
Dean e268844924
Merge pull request #4700 from Nesyth/fix/agc-comp-to-single-dcc-reads
fix(agc): read comp-to-single DCC keys of sampled textures and storage images
2026-10-13 17:54:09 +13:00
Dean 9b7c8ea965
Merge pull request #4811 from milescoviello/carry/localtime-range-windows-4807
fix(libc): convert local times before 1970 and after 3000 on Windows
2026-10-13 17:51:16 +13:00
Dean e15c316ead
Merge pull request #4733 from fdfawef324/fix/libc-collate-char-capacity
fix(libc): size collate<char>::do_transform strings as the console does
2026-10-13 17:50:55 +13:00
Dean 1268ba8cd4
Merge pull request #4727 from gjonn/feat/hull-dynamic-control-point-index
feat(shader): read hull inputs at a control-point index computed from data
2026-10-13 17:50:35 +13:00
Dean b7025517e1
Merge pull request #4656 from milescoviello/fix/rwlock-writer-preference
fix(libkernel): hold back new rwlock readers while a writer waits
2026-10-13 17:49:30 +13:00
Dean 73a5f3a41c
Merge pull request #4667 from babyhuey/feat/libkernel-sysctl-hw-model
feat(libkernel): report hw.model from sysctl
2026-10-13 17:48:21 +13:00
screamm c8379be922 feat(libkernel): implement the coredump user-data calls
sceCoredumpWriteUserData (Dbbkj6YHWdo) and sceCoredumpDebugTextOut
(dei8oUx6DbU) get the signatures of Orbital's db_types.json (cc408367)
and SharpProspero's KernelSystem.cs (5dfdb4b0): ssize_t (const void*,
size_t) and void (const char*, int). WriteUserData moves out of
Unimplemented.cpp.

User data belongs to the core dump handler: the Vita's
sceCoredumpWriteUserData returns 0x800A0003 ("No user-data capture is
active") outside it (vita-headers e66ebe90), and the RED engine's PS4
crash handler makes every coredump call from its handler (Vangaurd
4f86d2b0). The handler is never invoked here, so WriteUserData returns
SCE_COREDUMP_ERROR_NOT_IN_COREDUMP_HANDLER (0x81180003, shadPS4
coredump_error.h e0a46675) sign-extended and keeps nothing; a null,
empty or wrapping buffer throws because the order of the console's
checks is unknown. DebugTextOut prints its text to stderr with the
[coredump] prefix; a negative length or a null text with a nonzero
length throws.

Evidence: Broken Sword Reforged (PPSA21480) reaches the family through
its sibling, #3704 comment 6113687542: "`ERROR agc_graphics.cpp:266
Sony call failed with code 8a6c9018` (the resource registration error,
followed by the error dialog), then `sceCoredumpWriteUserString not
implemented`." WriteUserString has no declaration in any source and
keeps throwing; its TechnicalDebt entry records the call. 007 First
Light (PPSA11386) imports WriteUserData (#2523) without calling it
before its stop.

Test: guest_coredump_user_data.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 04:43:50 +00:00
Dean e51428bf23
Merge pull request #4759 from fdfawef324/fix/bda-span-read-split
fix(shader): split a BDA span read's in-place loads from its fallback
2026-10-13 17:00:47 +13:00
Dean 226b40db0f
Merge pull request #2132 from Raghav314/fix/agc-msaa-fill-clear
fix(agc): clear a multisampled target on a uniform fill of its color memory
2026-10-13 17:00:26 +13:00
Dean 3fed8e9bf3
Merge pull request #2121 from Raghav314/fix/agc-cb-resolve-source-samples
fix(agc): take a CB resolve's sample count from its source target
2026-10-13 17:00:06 +13:00
Dean 0d54077b9a
Merge pull request #4500 from ee6aba54/feat/agc-depth-surface-storage
feat(libSceAgcDriver): storage image access to depth surfaces
2026-10-13 16:50:53 +13:00
screamm e99816e8f3 fix(libkernel): give guest sockets ordinary descriptor numbers below FD_SETSIZE
libkernel numbered guest sockets from GuestSockets::FirstDescriptor
(0x10000000), so a title that puts a socket in a 1024-bit fd_set writes
fd / 8 bytes past it. The Epic Online Services SDK does this on its
RtcNetworkThread and three titles stop there (#1794):

Palworld PPSA23126 (queeeef, main a11c8f7f7):
  FATAL: unhandled exception 0xc0000005 on thread 37164 'RtcNetworkThread'
    rip 0x00007ffcdb1ea2be eossdk-ps5-shipping.prx.guest.prx+0xdea2be
    rcx 0000000010000005 rsi 0000000000400000 r12 0000000010000005
The Mound PPSA26223 (xXPBSXx, main 0a8b1d32b):
  FATAL: unhandled exception 0xc0000005 on thread 'RtcNetworkThread',
  rip eossdk-ps5-shipping.prx.guest.prx+0xefc6f4, rcx = 0x10000005,
  rsi = 0x400000
Dying Light 2 PPSA02262 (tv7):
  FATAL: unhandled exception 0xc0000005 on thread 'RtcNetworkThread'
    rcx 0000000010000005 ... rsi 0000000000400000 ... r12 0000000010000005

On FreeBSD 11.4 (8c639945) FD_SETSIZE is 1024 (sys/sys/select.h:58-59)
and sockets take the lowest free entry of the one process descriptor
table that files use (kern_descrip.c:1643-1660 fdalloc,
uipc_syscalls.c kern_socket through falloc).

Every socket number is now a real host descriptor: a zero-access NUL
handle registered with _open_osfhandle on Windows (as directory
descriptors already are) and an F_DUPFD_CLOEXEC duplicate of the host
socket on Linux. The socket table maps that number to the socket, so
"is this a socket" is a table lookup instead of a range check at the 31
former FirstDescriptor comparisons. close releases both the socket entry
and the number, dup and dup2 duplicate the number through the host table
and keep the socket shared, dup2 of a file onto a socket number drops the
socket entry, and sceKernelClose now closes sockets too. sceNetSocket and
sceNetAccept take their ids from the same table instead of a counter from
32, so libkernel and libSceNet numbers never collide.

select polls guest sockets alongside libSceNet sockets, the random device,
stdio and (on Linux) host descriptors; poll throws only for an open
descriptor that is not a guest socket and reports POLLNVAL otherwise.
File calls that used to fail with EBADF on the socket range return
FreeBSD's answer for a socket: lseek ESPIPE (kern_lseek), ftruncate and
getdirentries EINVAL (invfo_truncate, getvnode), flock EOPNOTSUPP;
fstat on a socket throws. pread on a closed descriptor returns EBADF.

title failing on host descriptor numbers; these three titles are that
case, and this change keeps host numbering for files and only moves
sockets into it.

Tests: guest_socket_descriptors (new: socket below 1024, select on a
socket and a file together, close frees the number for a file, dup of a
socket, sceKernelClose), guest_select (socket and pipe together, Linux),
guest_poll, guest_dup, guest_socket_pair, guest_fstatfs,
guest_posix_filesystem and guest_sce_net updated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 20378375b31eb5db922db6e55f45e44a4dae6445)
2026-10-13 03:22:36 +00:00
Dean Galvin e322c6e064 fix(agc): a pending CMASK clear takes precedence over a refused color fill
ApplyFastClear took the color fill before the CMASK clear, so a partial
fill of a multisampled target's color memory threw at the next use even
when a CMASK fast clear was pending over the whole target. The CB reads
a cleared tile's color from the clear registers whatever the memory
holds, so the CMASK clear is applied and the recorded fill dropped.
2026-10-13 15:48:03 +13:00
raghav314 d57f9cfb03 fix(agc): take a CB resolve's sample count from its source target
DecodeColorMetadataPass treated a CB_COLOR_CONTROL resolve as one only
when PA_SC_AA_CONFIG has a sample count, and checked the source against
it. A title that resolves with the rasterizer single-sample fell through
to the draw path and threw "only normal color rendering with copy ROP is
supported (... mode resolve)".

A color target's sample count is CB_COLOR_ATTRIB.NUM_SAMPLES, separate
from the rasterizer's; radeonsi itself writes PA_SC_AA_CONFIG 0 for a
multisampled framebuffer when rasterizer multisampling and line
smoothing are off. So a resolve is decoded when either the rasterizer or
CB0 is multisampled, and its sample count is CB0's. When the rasterizer
is multisampled, the source still has to match it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:46:45 +13:00
Dean bef5f45bbc
Merge pull request #4729 from zaydzaari/research/rtc-minute-separator-1342
fix(rtc): reject date strings ending at the minutes
2026-10-13 15:37:15 +13:00
Dean 255a91abd6
Merge pull request #4809 from MarcZX100/codex/unaligned-shader-abi-4782
fix(agc): accept unaligned shader headers in ABI resolution
2026-10-13 15:36:40 +13:00
Dean 834de1ab10
Merge pull request #4199 from sanxchep/fix/msaa-guest-guard
fix(agc): size multisample guest guards by fragment blocks
2026-10-13 15:36:14 +13:00
Dean 37a0a3608c
Merge pull request #4480 from milescoviello/carry/fcntl-record-locks-windows-4479
feat(libkernel): implement fcntl record locks on Windows
2026-10-13 15:36:03 +13:00
Dean Galvin f15671ecf3 fix(agc): copy the depth plane again after a storage write
A sampled copy of a depth plane is kept while the surface's write
serial is unchanged. Storing a written storage view back into the
depth image did not bump the serial, so a later draw or dispatch that
sampled the plane as an array or cube kept the values from before the
store. The store-back bumps it now.

The dispatch test samples the plane through a copy, stores to it in a
dispatch and samples it again.
2026-10-13 15:00:36 +13:00
Dean Galvin 889e5d436a fix(agc): refuse depth storage views the plane copy cannot serve
A 2D array or cube view with the plane's extent and format reached the
ordinary path and read guest bytes the depth was never written to; it
throws again, with the message main has for it. A multisampled surface
is refused before the plane copy, as sampling it already is. A written
view that another view of the same plane replaced had its results
dropped at store-back; that throws now.

Update the debt entry to what is supported and what still throws.
2026-10-13 15:00:36 +13:00
Dean 2a55cfe1e8
Merge pull request #2491 from oneandonlydean/up639/depth-plane-unchanged-copy-on-425
perf(agc): skip the depth plane copy when no slice changed
2026-10-13 14:49:05 +13:00
Dean c27687313c
Merge pull request #4859 from EagleBearerYS/fix/libkernel-flexible-map-flag-8000
fix(libkernel): accept flag 0x8000 in sceKernelMapFlexibleMemory
2026-10-13 14:48:21 +13:00