Commit Graph

1659 Commits

Author SHA1 Message Date
Dean 8eee5cfad5
Merge pull request #4118 from Mouad-Scriptz-0/feat/npauth-authorized-app-dialog
feat(libSceNpAuthAuthorizedAppDialog): add the dialog, with NpAuth and SaveData imports of Minecraft
2026-10-12 23:54:30 +13:00
Dean 5f3b94cb19
Merge pull request #3840 from ahir061/feat/libkernel-fcntl-files
feat(libkernel): support fcntl and ioctl on non-socket descriptors
2026-10-12 23:53:24 +13:00
Dean c390d81552
Merge pull request #4326 from winstrex/feat/libkernel-sceKernelEnableDmemAliasing
feat(libkernel): implement sceKernelEnableDmemAliasing
2026-10-12 23:50:39 +13:00
Dean 98341494df
Merge pull request #4308 from utkuhalis/pr/agc-acb-rendering-wait
feat(libSceAgc): implement sceAgcAcbWaitUntilSafeForRendering
2026-10-12 23:50:06 +13:00
Dean 7cb5238d53
Merge pull request #4281 from eljackjoestar-cmd/codex/reserve-direct-memory
perf(libkernel): commit Windows direct backing when mapped
2026-10-12 23:49:42 +13:00
Dean e9d35d6491
Merge pull request #3636 from JAB-dev/feat/agc-color-target-1-5-5-5
feat(agc): render 1_5_5_5 UNORM color targets
2026-10-12 23:48:42 +13:00
Dean 31839d413c
Merge pull request #4316 from gravelas/fix/agc-far-out-of-range-indices
fix(agc-driver): move indices far past every vertex fetch’s records to the first zero vertex
2026-10-12 23:48:23 +13:00
Dean eee8541dae
Merge pull request #2904 from Scramblrrrr/codex/depth-storage-reuse
fix(graphics): allow storage textures in reused depth memory
2026-10-12 23:46:54 +13:00
gookie ce0915e834 feat(libSceHttp2): implement sceHttp2DeleteCookieBox
PPSA35943 (Graveyard Keeper 2) imports sceHttp2DeleteCookieBox, which no
library exported. On current main the loader stops the title there:

  ./eboot.elf: symbol lookup error: ./eboot.elf: undefined symbol:
  O9ync3F-JVI

sceHttp2DeleteCookieBox(cookieBoxId) erases the box from the handle
registry sceHttp2CreateCookieBox adds it to and returns 0, or the
library's invalid-id error (0x817B1100) for an id that is not a live
cookie box. The signature follows SharpProspero and the behaviour
prosper's sceHttp2DeleteCookieBox; the error code is listed in
TechnicalDebt as not measured on a console.

guest_http2 deletes a box twice, a context id, a box whose context was
terminated, and the two boxes it uses before sceHttp2Term.

With this change the title loads and runs into its asset loading.
2026-10-12 12:24:57 +02:00
eljackjoestar-cmd b3587f9528 fix(shader): preserve ancillary proofs across relative VGPR accesses 2026-10-12 13:36:30 +04:00
Jake Wang 09c0fa5daf fix(shader): release bundled optimizer traversal maps 2026-10-12 05:29:36 -04:00
Mouad-Scriptz-0 295e6b501d feat(libSceNpAuthAuthorizedAppDialog): add the dialog, with NpAuth and SaveData imports of Minecraft
Minecraft (PPSA17221) fails to load on nine absent imports. The authorized-app
dialog runs the common-dialog state machine without UI and reports the user
as having cancelled, like the login and VR setup dialogs. The other two,
sceNpAuthGetAuthorizedAppCode and the unnamed libSceSaveData.native NID
RvID8BVeg+g, are declared as throwing stubs with unknown signatures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 08:53:30 +00:00
screamm 5f3fb3dddd feat(libc): implement asinl
RetroArch 1.0.0-beta.1 (PPSA99169) stops on main 0f863c10 at

    FAIL: unresolved ELF import Nx-F5v0-qU8 from libSceLibcInternal.prx

Nx-F5v0-qU8 is asinl (tools/nid_names.py, aerolib).

The implementation follows the asinl of the libc.prx bundled with
PPSA28319, read from its disassembly: FreeBSD msun's e_asinl.c with
the ld80 invtrig.c coefficients (9f043204), which the binary holds as
the same 80-bit constants, computed in the x87 long double the guest
uses. +-1 returns +-pi/2 rounded to 64 bits and +-0 keeps its sign.
For |x| > 1, the infinities and NaN, Sony's error helper raises
FE_INVALID and sets errno to EDOM before returning (x - x) / (x - x),
so a NaN argument sets EDOM too.

20 million random arguments in (-1, 1) plus the branch edges give the
same bits as that code from the title's libc.prx run on a Windows
host. guest_math pins a set of those bits and checks the domain
errors' errno and FE_INVALID, and that errno is untouched otherwise.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 10:51:59 +02:00
screamm 2c6e3f53ff feat(libc): implement sinhf
Ruffle Flash 1.2.0 (PPSA68091) stops on main 0f863c10 at

    FAIL: unresolved ELF import 1t1-JoZ0sZQ from libSceLibcInternal.prx

1t1-JoZ0sZQ is sinhf (tools/nid_names.py, aerolib). RetroArch
1.0.0-beta.1 (PPSA99169) imports it as well.

The implementation follows the sinhf of the libc.prx bundled with
PPSA28319, read from its disassembly: FreeBSD msun's e_sinhf.c as of
5aa554c7 (before __ldexp_expf, so expf(|x| / 2) is squared between
logf(FLT_MAX) and the overflow threshold), calling msun stable/9
expm1f and expf (59bc2f09), whose paths for the arguments sinhf passes
are inlined. Past the threshold Sony's error helper sets errno to
ERANGE before returning x * 1e37; NaN and the infinities return x + x
and leave errno alone.

Running that code from the title's libc.prx on a Windows host gives
the same bits as this implementation for every finite argument up to
the threshold, both signs (2,238,032,378 inputs). guest_math pins a
set of those bits, the overflow errno and FE_OVERFLOW, and checks that
errno is untouched otherwise.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 10:51:00 +02:00
Dean 9fdddc8747
Merge pull request #4160 from hugodearaujo/fix/join-self-create-attr
fix(libkernel): join the calling thread and create from an unset attribute as the console does
2026-10-12 21:42:14 +13:00
Dean 82fc98f5e5
Merge pull request #4158 from hugodearaujo/fix/mutex-errors
fix(libkernel): return the console's errors from the SCE mutex calls
2026-10-12 21:41:52 +13:00
Dean 5ccf78e4e3
Merge pull request #4153 from hugodearaujo/fix/pthread-attr-errors
fix(libkernel): return the console's errors from the scePthreadAttr calls
2026-10-12 21:41:31 +13:00
Dean b2cc2df954
Merge pull request #4119 from hugodearaujo/fix/accessibility-defaults
fix(libSceUserService): report the console's default accessibility settings
2026-10-12 21:41:16 +13:00
Dean 7ea2022227
Merge pull request #4104 from hugodearaujo/fix/username-console
fix(libSceUserService): answer sceUserServiceGetUserName as the console does
2026-10-12 21:40:46 +13:00
Dean 69f7411ec9
Merge pull request #4096 from hugodearaujo/fix/solosched-values
fix(libkernel): accept only the solo scheduling values the console accepts
2026-10-12 21:40:24 +13:00
Dean 49b6b6a5c8
Merge pull request #4092 from yunusshaikh7/fix/libscenet-datagram-receive-timeout
fix(libSceNet): report EAGAIN when a datagram receive times out on Windows
2026-10-12 21:39:40 +13:00
Dean 9b152c43d0
Merge pull request #4090 from yunusshaikh7/fix/libc-fopen-delete-sharing-windows
fix(libc): open fopen streams with delete sharing on Windows
2026-10-12 21:39:18 +13:00
Dean 10aff1c663
Merge pull request #4077 from hugodearaujo/fix/sched-priority-range
fix(libkernel): report the console's scheduling priority range
2026-10-12 21:38:56 +13:00
milescoviello 89bc9d1082 fix(libc): read %i without the C23 binary prefix in the scanf family on Linux
On Linux sscanf, vsscanf, fscanf and sscanf_s hand their conversions to
glibc. Since glibc 2.38, code built as GNU C++ calls the C23 entry
points (__isoc23_vsscanf, __isoc23_vfscanf, __isoc23_sscanf), whose %i
reads a 0b/0B binary prefix. On main,
sscanf("0b101 x", "%i%n%7s", &value, &end, rest) stores value 5 and
end 5 and leaves "x" for the %s; " -0B11" gives -3. TechnicalDebt
records this.

FreeBSD's %i knows only the 0 and 0x prefixes. FreeBSD 11.4
lib/libc/stdio/vfscanf.c, parseint, lines 345-353 and 371-380:

	case '0':
		if (base == 0) {
			base = 8;
			flags |= PFXOK;
		}
	...
	/* letters ok iff hex */
	case 'A': case 'B': case 'C':
	case 'D': case 'E': case 'F':
	case 'a': case 'b': case 'c':
	case 'd': case 'e': case 'f':
		/* no need to fix base here */
		if (base <= 10)
			break;	/* not legal here */

so "0b101" stores 0, consumes the "0" and leaves "b101", as C17 does
and as the strtol family here already does.

With glibc the scanf family now calls __isoc99_vsscanf and
__isoc99_vfscanf, the entry points GNU C++ used before glibc 2.38
(exported since 2.7), which read %i without the binary prefix. Other
hosts keep std::vsscanf and std::vfscanf. The TechnicalDebt entry is
removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 08:38:06 +00:00
Dean 32e62f2f70
Merge pull request #4039 from ee6aba54/fix/ngs2-sampler-empty-state
fix(libSceNgs2): report EMPTY for a streaming sampler that played its queue
2026-10-12 21:37:52 +13:00
Dean 0511e86de9
Merge pull request #3984 from zmeizy/claude/scanf-wide-linux
fix(libc): throw for 16-bit wide scanf conversions on Linux
2026-10-12 21:37:08 +13:00
Dean 773f8de7b9
Merge pull request #3824 from xXPBSXx/fix/ces-cp1251-profile
feat(libSceCesCs): add sceCesRefersUcsProfileCp1251 and sceCesMbcsUcsContextInit
2026-10-12 21:36:23 +13:00
Dean 732fc01aaf
Merge pull request #3814 from xXPBSXx/fix/export-ppsa30601-imports
fix(exports): export the calls PPSA30601 imports
2026-10-12 21:36:02 +13:00
Dean 7b03a42185
Merge pull request #3659 from MarcZX100/carry/win-getdents-name-limit-3327
fix(libkernel): reject oversized Windows directory entry names
2026-10-12 21:35:24 +13:00
Adrià 2979ae37a3
Merge pull request #4152 from adriadam10/feat/phase-b
perf(agc): build shader pipeline libraries when shaders are registered
2026-10-12 10:31:42 +02:00
Dean 9bc3623517
Merge pull request #4355 from oneandonlydean/up4/fix-4276-stencil-ref-export
fix(agc): export the stencil reference from pixel shaders with VK_EXT_shader_stencil_export
2026-10-12 21:22:09 +13:00
Dean 3f80d529da
Merge pull request #4309 from oneandonlydean/up4/fix-2776-msaa-enable-single-sample
fix(agc): accept MSAA_ENABLE on a single-sample target sampled at the pixel center
2026-10-12 21:21:26 +13:00
Dean Galvin d37463e76f fix(shader): prove masked lanes unread for every select in one backward pass
MaskedSelectEliminator walked forward from each select to see whether the
lanes its mask excludes are read. Since fda4aa90 the walks pass explicit-LOD
gathers, size queries and guarded image writes, so in a large pixel shader
most of them cover the rest of the program, and the cost grows with the
square of its size (#3504).

The pass now computes, for every value, the set of masks under which it is
unread, from its uses backwards: a use guarded by a condition contributes the
masks that condition implies, a lane-local use adds what its result is unread
under, and any other use contributes nothing. A select is dropped when its
mask is in its own set. Loops are solved as strongly connected components.
The rules for guards, lane-local uses, loops, whole quad masks, selected
execs, rebuilt mask words and guarded first-lane reads are the ones the walk
applied. A first-lane read passes the masks its read mask implies when its
own result is unread outside that read mask, which is solved once per read in
the same way. The walk's step limit, its 64-level implication depth and its
first-lane nesting depth are gone, so a proof no longer depends on the order
of the questions.
2026-10-12 21:16:29 +13:00
Dean 4e6ef9077a
Merge pull request #3648 from hamb3r/fix/unity-libc-stubs
fix(libc): add missing Unity engine static imports
2026-10-12 20:53:14 +13:00
Adrià Franch 60151b66b7 perf(recompiler): keep the format word specialized for buffers accessed with the descriptor's format
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 09:50:41 +02:00
Adrià Franch 68164aee2a docs: note that compute shaders keep the specialized form
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 09:50:41 +02:00
Adrià Franch acc0a0487d docs: describe shader modules and pipeline libraries built at registration
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 09:50:41 +02:00
Tyler Westerberg a3cba2d1ff fix(agc-driver): move indices far past every vertex fetch's records to the first zero vertex
Goat Simulator 3 draws a triangle list whose indices are all 0xffffffff
with primitive restart off. Each fetch past a descriptor's records reads
zeros (out-of-bounds select 0 or 1), but the zero-padded vertex copies
were sized to the highest index: 160 GiB, which vkAllocateMemory refused.
When the highest index is at least 64Ki vertices past the largest
per-vertex record count, the draw now uses a copy of its indices with
every index past that count moved to it. Each attribute reads zeros
there as at the original index; only the vertex index the shader sees
changes, so indices closer to the records are left as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:42:49 -04:00
Dean 98c07d8e77
Merge pull request #4111 from jdmagic/fix/kernel-close-net-sockets
fix(libkernel): close() and setsockopt() reach libSceNet sockets
2026-10-12 20:28:00 +13:00
Dean 4b07baa2f2
Merge pull request #4314 from gravelas/feat/libscevoiceqos-set-connection-attribute
feat(libSceVoiceQoS): export sceVoiceQoSSetConnectionAttribute
2026-10-12 20:27:08 +13:00
Dean aa2f05a285
Merge pull request #4266 from ducloc080202/fix/libkernel-apr-write-commands
fix(libkernel): record AmmModifyMtypeProtect and AmmRemapIntoPrt commands
2026-10-12 20:26:26 +13:00
Dean 5240dd46a5
Merge pull request #4255 from overlordxrz-source/feat/rudp-get-max-segment-size
feat(libSceRudp): implement sceRudpGetMaxSegmentSize
2026-10-12 20:26:05 +13:00
Dean 84377033a5
Merge pull request #3831 from eljackjoestar-cmd/codex/opus-surround
feat(ajm): decode Opus surround mapping family
2026-10-12 20:24:32 +13:00
Dean 2ca6198e9a
Merge pull request #3606 from Lorkydey/feat/libkernel-getlogin-r
feat(libkernel): implement getlogin_r using the host account name
2026-10-12 20:01:56 +13:00
Dean 9231a08b00
Merge pull request #3737 from MarcZX100/codex/json2-init-parameter2-3348
feat(libSceJson2): implement InitParameter2 constructors
2026-10-12 20:01:34 +13:00
Dean de24bd616d
Merge pull request #4044 from xXPBSXx/fix/export-ppsa07411-vr2-imports
fix(exports): export the PS VR2 calls PPSA07411 imports that no library has
2026-10-12 20:01:13 +13:00
screamm 01b7bb3e2f feat(libkernel): support ioctl on non-socket descriptors
ioctl and _ioctl answered EBADF for every descriptor outside the
libSceNet socket table. Decoded call sites: PS5MC (PPSA99420, FIONBIO x3,
FIONREAD x2, TIOCGWINSZ x3), ProsperoTV (PPSA99003, FIONBIO on a pipe
once poll on pipes is in), XPSemu (PPSA97358, 21 sites).

Following FreeBSD 11.4 kern_ioctl (sys/kern/sys_generic.c:758),
vn_ioctl (sys/kern/vfs_vnops.c:1488), pipe_ioctl (sys/kern/sys_pipe.c:1346)
and randomdev_ioctl (sys/dev/random/randomdev.c:301), release/11.4.0
8c639945: FIONBIO sets or clears O_NONBLOCK through the same status
flags as fcntl F_SETFL (EFAULT for a null argument before EBADF);
FIONREAD reports the size past the offset of a file, the queued bytes of
a pipe's read end, 0 on its write end, ENOTTY on the random device, and
throws on a directory or another character device; termios requests
(group 't', TIOCGWINSZ included) fail with ENOTTY, as tcgetattr already
takes these descriptors as not a terminal; any other request throws
naming the request and descriptor kind. Sockets keep their path
unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 12:17:26 +05:30
screamm 591e8ddadc feat(libkernel): support fcntl on non-socket descriptors
fcntl and sceKernelFcntl answered EBADF (sceKernelFcntl threw) for
every descriptor outside the libSceNet socket table, so files, pipes,
directories and descriptors 0 to 2 could not be queried or changed.

Observed: Yamagi Quake II (PPSA99007) stops with
"Sys_Error: change stdin to blocking Bad file descriptor", from
fcntl(fileno(stdin), F_SETFL, fcntl(0, F_GETFL, 0) & ~FNDELAY)
(yquake2 src/backends/unix/system.c:81-86).

Predicted from the titles' sources and decoded call sites: XPSemu
(PPSA97358, 97 fcntl sites: F_GETFD 12, F_SETFD 20, F_GETFL 8,
F_SETFL 9, F_DUPFD 1, F_DUPFD_CLOEXEC 7, F_GETLK 9) fails in
qemu_init_main_loop, where its pipe2 (pipe plus F_SETFD FD_CLOEXEC) and
glib's g_unix_set_fd_nonblocking (F_GETFL, F_SETFL) build the event
notifier (util/event_notifier-posix.c:44-67); VLC (PPSA85300, 43 sites,
F_RDAHEAD on every file it opens), RetroArch (PPSA99169, 17),
Porpoise (PPSA99764, 13) and Ruffle (9) call it on files and pipes.

The commands follow FreeBSD 11.4 kern_fcntl and kern_dup
(sys/kern/kern_descrip.c:479-799, 812, release/11.4.0 8c639945):
F_GETFD/F_SETFD keep the close-on-exec flag per descriptor, F_GETFL
reports the host access mode with the status flags, F_SETFL changes
only O_NONBLOCK, O_APPEND, O_ASYNC, O_FSYNC, O_DIRECT and FRDAHEAD,
F_DUPFD/F_DUPFD_CLOEXEC give the lowest free descriptor at or above the
start through dup (EINVAL for a negative start), F_DUP2FD goes through
dup2, F_RDAHEAD/F_READAHEAD set FRDAHEAD on files (EBADF on pipes,
ENOTTY elsewhere), and unknown commands fail with EINVAL. Status flags
live in a guest table shared by dup, dup2 and F_DUPFD like an open file
description. O_NONBLOCK switches a pipe (PIPE_NOWAIT on Windows, where an
empty read and a full write now report EAGAIN; the host flag on Linux).
Record locks use the host POSIX locks on Linux and throw on Windows.
Changes the host cannot model throw naming the flag and descriptor kind.
Sockets keep their path unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 12:17:25 +05:30
Dean Galvin 22d662eda7 fix(agc): export the stencil reference from pixel shaders with VK_EXT_shader_stencil_export 2026-10-12 19:44:41 +13:00
pushkarreddyy 2781077ace feat(libkernel): answer getrlimit for FreeBSD resources 2026-10-12 12:09:41 +05:30
Dean d06c065657
Merge pull request #3895 from CouchRiv/fix-shader-vcmpx-f32-family
fix(shader): keep f32 denormals in compares when denormals are kept
2026-10-12 19:39:34 +13:00
Dean 7f7f961bf8
Merge pull request #3739 from eljackjoestar-cmd/codex/masked-first-lane-proof
fix(shader): prove masked writes through guarded first-lane reads
2026-10-12 19:39:13 +13:00
pushkarreddyy d8b42473d7 feat(libkernel): support MIB 1.37 (kern.arandom) in sysctl 2026-10-12 12:07:45 +05:30
Dean Galvin fdfbeba8ad fix(agc): accept MSAA_ENABLE on a single-sample target sampled at the pixel center 2026-10-12 19:07:15 +13:00
Dean 2ccbd376f8
Merge pull request #2169 from authurtabo-byte/feat/agc-uniform-sample-locations
feat(agc): support uniform custom MSAA sample locations
2026-10-12 19:06:44 +13:00
JAB-dev deaa2e3ef6 test(agc): draw into a 1_5_5_5 target and read the 16 bits back
Draws 32_ABGR exports into a tiled and a linear format 17 target and compares every texel with
the layout X in bits 0-4, Y in 5-9, Z in 10-14, W in bit 15, including the X/Z-swapped pairs, rounding
edges and texels outside the scissor. Reverting the X/Z exchange fails it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 07:59:29 +02:00
winstrex 749541f653 feat(libkernel): implement sceKernelEnableDmemAliasing
Direct memory can already be mapped more than once, so there is no
aliasing to enable and the call returns 0. ProsperoEden (PPSA99008)
imports it and calls it before mapping the same direct memory again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 02:40:10 -03:00
Leonardo 216984afc6
feat(libkernel): implement sceKernelGetCpuTemperature 2026-10-12 07:37:44 +02:00
Utku Halis 661f8e1e7c feat(libSceAgc): implement sceAgcAcbWaitUntilSafeForRendering 2026-10-12 08:26:47 +03:00
Tyler Westerberg bad49ba2c4 feat(libSceVoiceQoS): export sceVoiceQoSSetConnectionAttribute
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 01:21:46 -04:00
fma-rc 9db923e907
fix(shader): clip primitives with an all-zero clip position 2026-10-12 06:46:34 +02:00
Dean 69138616c3
Merge pull request #3653 from QRMOE/fix-libc-strftime-literal-conversions
fix(libc): preserve strftime literal conversions
2026-10-12 17:34:15 +13:00
Dean 2da042eee0
Merge pull request #3933 from fma-rc/fix/system-service-language-param
fix(libSceSystemService): answer parameter 400 with the console language
2026-10-12 17:31:24 +13:00
Dean eb91f4e860
Merge pull request #4049 from Mouhand-Kaddo/fix/demons-readonly-resummarize
fix(agc): handle Demon's Souls read-only depth resummarize
2026-10-12 17:30:54 +13:00
Dean 6d1cee6d3f
Merge pull request #3593 from ahir061/fix/recompiler-prime-shared-mutex
fix(shader): lock recompiler shared mutexes once when created
2026-10-12 17:30:28 +13:00
Dean 32cb3fea95
Merge pull request #3932 from CouchRiv/fix-shader-f16-denorm-flush-family
fix(shader): flush f16 denormals in unary, frexp and conversion ops per the float mode
2026-10-12 17:29:43 +13:00
Dean 18af217211
Merge pull request #3645 from alfalfa-star/fix/recompiler-mesh-grid-size-sgpr
fix(recompiler): read NumWorkgroups in every mesh shader so RADV sizes its user data
2026-10-12 17:27:54 +13:00
eljackjoestar-cmd 9873fae1ef perf(libkernel): commit Windows direct backing when mapped 2026-10-12 07:59:34 +04:00
codingreapermaps c6be0e95cc fix(libkernel_sys): read relative symbolic links on Windows
readlink threw for every Windows reparse point, including the links
symlink creates. Read the target of a relative symbolic link from its
reparse data and return it with forward slashes. Absolute targets,
junctions and other reparse points still throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 04:39:39 +01:00
Ondra97 8f33897275 fix(libs): allow socket receives into watched guest memory 2026-10-12 05:37:35 +02:00
authurtabo-byte c9e48e5ae2 feat(agc): support uniform custom MSAA sample locations 2026-10-11 20:36:04 -07:00
ducloc080202 2cf929db08 fix(libkernel): record AmmModifyMtypeProtect and AmmRemapIntoPrt commands 2026-10-12 10:33:45 +07:00
milescoviello 4ece6750b7 fix(libc): print the guest errno message for %m in the printf family
FreeBSD's printf formats %m as the message for the errno value at the
time of the call. On Linux a format with %m went to glibc, which looks
the number up in Linux's table, so guest errno values above 34 got
another error's text: with errno 35 (EAGAIN) "[%m]" printed
"[Resource deadlock avoided]" instead of "[Resource temporarily
unavailable]", and errno 63 (ENAMETOOLONG) printed "Out of streams
resources". On Windows, and on Linux when the format also had a wide
argument, the guest formatter threw on %m.

FreeBSD 11.4, lib/libc/stdio/vfprintf.c:

	saved_errno = errno;
	...
		case 'm':
			cp = strerror(saved_errno);
			size = (prec >= 0) ? strnlen(cp, prec) : strlen(cp);
			sign = '\0';
			break;

The guest formatter now saves errno when it starts and formats %m as a
string with the guest strerror_r text, so width, precision and the -
flag apply as FreeBSD's string path applies them. On Linux a format with
%m goes to the guest formatter like one with a wide argument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:12:27 +00:00
Dean eb189f65d6
Merge pull request #3944 from hugodearaujo/fix/operation-mode-console
fix(libkernel): report the operation mode the console reports
2026-10-12 16:10:44 +13:00
AlxcBTW a7ed14c74b Merge branch 'main' into fix/recompiler-flat-p10-provoking-v2-2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 05:09:22 +02:00
Dean f0674d3c08
Merge pull request #3968 from babyhuey/feat/libkernel_sys-openat
feat(libkernel_sys): implement openat
2026-10-12 16:08:11 +13:00
Dean f5ce5957c1
Merge pull request #3797 from YossiYad/carry/audioout-hdmi-monitor-info
feat(libSceAudioOut): implement sceAudioOutSysGetHdmiMonitorInfo
2026-10-12 16:07:06 +13:00
Dean 2263cefe25
Merge pull request #3601 from Scramblrrrr/codex/legacy-sse-reciprocals
fix(relinker): lower legacy packed reciprocal register instructions
2026-10-12 15:43:20 +13:00
overlordxrz-source 4b378a251f feat(libSceRudp): implement sceRudpGetMaxSegmentSize 2026-10-11 22:43:17 -04:00
Dean f49f95873c
Merge pull request #3969 from hugodearaujo/fix/user-age-level
fix(libSceUserService): report an unrestricted age level
2026-10-12 15:34:36 +13:00
Dean d1758a91c8
Merge pull request #3494 from babyhuey/carry/pthread-attr-scope-3377
feat(libkernel): implement pthread_attr_getscope, setscope, getinheritsched and getstackaddr
2026-10-12 15:33:56 +13:00
Dean c2fdb9c71c
Merge pull request #2902 from oneandonlydean/carry/libkernel-sysctl-sdk-version
feat(libkernel): support kern.sdk_version in sysctlbyname
2026-10-12 15:33:29 +13:00
MarcZX100 ce9fc689b7 docs(libkernel): record Windows directory name limit 2026-10-12 01:51:35 +00:00
pallp 4b125c0ca5 fix(savedata): fill the search infos of sceSaveDataDirNameSearch
SaveDataDirNameSearchResult.infos points at an array the title reads one
entry per returned directory name, but the search never wrote it, and
SaveDataSearchInfo was declared as 128 opaque bytes. A title that asks for
the infos read whatever its buffer held.

SaveDataSearchInfo is now the 48-byte record shadPS4 declares as
OrbisSaveDataSearchInfo (blocks, free blocks, 32 reserved bytes), and the
search fills one per returned name. Every native save reports
SAVE_DATA_BLOCKS_MAX blocks, as sceSaveDataGetMountInfo and the block sort
keys already assume, so both counts are SAVE_DATA_BLOCKS_MAX and the
reserved bytes are zero.

guest_savedata_search_tests checks the two records, their zero reserved
bytes and that the search writes nothing past them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VFVE5WbaUJ2vyj8NAW44CS
2026-10-12 02:18:33 +01:00
fma-rc b843b16a0a
fix(libSceSystemService): answer parameter 400 with the console language 2026-10-12 03:18:00 +02:00
winstrex 8f9efc25f2 fix(libs): take guest entropy from the host OS instead of std::random_device
std::random_device in libstdc++ reads RDSEED on x86 Linux. On an AMD
EPYC 9V45 (Zen 5) CI runner its 32-bit results repeat about 130 times
in 65536 draws, so guest_posix_random fails. libc now exports
HostEntropy_nid_no_patch, which uses getentropy (rand_s on Windows) and
throws when the OS cannot provide entropy. arc4random, arc4random_buf,
sceRandomGetRandomNumber, /dev/random and /dev/urandom reads,
std::_Random_device and sceKernelUuidCreate use it, and the arc4random
and random device TechnicalDebt entries say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 22:07:49 -03:00
Scramblrrrr ef218ef928 test(agc): distinguish GPU depth from reused storage bytes 2026-10-11 21:29:59 -03:00
hugodearaujo 0b7e4ddf9f fix(libkernel): join the calling thread and create from an unset attribute as the console does
On a PS5 (firmware 13.60) scePthreadJoin on the calling thread returns
EDEADLK and scePthreadCreate with a zeroed attribute creates a thread
with the default attributes. Here both threw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:09:08 -03:00
hugodearaujo b9b5bcc190 fix(libkernel): return the console's errors from the SCE mutex calls
On a PS5 (firmware 13.60) the SCE mutex attribute calls return EINVAL
for a null or uninitialized attribute, scePthreadMutexattrSetprotocol
accepts 0 to 2, scePthreadMutexInit takes an uninitialized attribute as
the default one, and destroying a destroyed mutex returns EINVAL. Here
these threw, including for the priority protection protocol.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:06:55 -03:00
hugodearaujo 2446a2648a fix(libkernel): return the console's errors from the scePthreadAttr calls
On a PS5 (firmware 13.60) the scePthreadAttr setters and getters return
EINVAL for a null or uninitialized attribute and for a null output,
ENOTSUP for a policy other than SCHED_FIFO and SCHED_RR, an inheritance
other than explicit and inherit, and a priority outside 256 to 767, and
EINVAL for an invalid detach state. Here they threw, or stored any
policy, inheritance and priority.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:59:17 -03:00
eljackjoestar-cmd fded8a7e7f fix(shader): prove masked writes through guarded first-lane reads 2026-10-12 03:57:04 +04:00
lorkydey f88be06af2 fix(libkernel): resolve getlogin_r from the effective host account 2026-10-12 01:39:07 +02:00
xXPBSXx 2a7b38ab75 fix(libSceAgc): write the KytyPS5 workload packets and return null for unregistered streams
sceAgcDcbSetWorkloadsActive writes an 18-dword IT_NOP packet (stream id, 64-bit workload mask) and sceAgcDcbSetWorkloadComplete a 12-dword one (stream id, workload id, 64-bit clear mask), following KytyPS5. Both return null for a null buffer, an unregistered or out-of-range stream, a workload id above 63, and for active a duplicate id or a count of 0 or above 63. sceAgcDriverRegisterWorkloadStream and sceAgcDriverUnregisterWorkloadStream now record the stream ids the DCB calls check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 01:37:56 +02:00
Claude c35d05395d
fix(libc): reject 16-bit wide conversions in sscanf_s and after the ' flag on Linux
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 23:37:17 +00:00
xXPBSXx 45fcf734ab fix(libSceAgc): emit NOP packets for the DCB workload calls
sceAgcDcbSetWorkloadsActive and sceAgcDcbSetWorkloadComplete threw. They now write a plain two-dword NOP and keep no workload state.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 01:36:51 +02:00
hugodearaujo 78abb2b46a fix(libSceUserService): report the console's default accessibility settings
On a PS5 (firmware 13.60) a user with every accessibility setting at
its default reads chat transcription 0, press-and-hold delay 0, trigger
effect 1, vibration 1, zoom 0 and zoom follow focus 1; all six read 0
here. A user who is not logged in returns 0x80960009 with or without an
output, as sceUserServiceGetAgeLevel does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:35:58 -03:00
jdmagic d5805fb3e4 fix(libkernel): setsockopt sets options of libSceNet sockets
A title creating a socket with sceNetSocket sets its options with the BSD
setsockopt, which looked the descriptor up only among libkernel's own
sockets and returned EBADF. libSceNet now registers an option setter with
libkernel, as it does for close and select, and accepts SO_REUSEADDR,
SO_BROADCAST, SO_SNDBUF and SO_RCVBUF like libkernel's own sockets.

PPSA01289 (Sackboy: A Big Adventure) sets SO_BROADCAST on its UDP P2P
socket this way in UIpNetDriver::InitBase. The failure made every listen
fail, and the engine travelled back to its default map with ?closed,
reloading it about every two seconds behind the loading screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:23:24 -04:00
jdmagic 12b18af550 fix(libkernel): close() closes libSceNet sockets
A libSceNet socket is a kernel descriptor on the console, so titles close it
with close(). libSceNet keeps its sockets in its own table, and libkernel's
close passed their numbers to the CRT, which reported an invalid parameter
and left the socket open. libSceNet now registers a closer with libkernel,
as it registers its poller for select. PPSA01289 (Sackboy: A Big Adventure)
closes its P2P socket this way each time it tears its network session down,
leaking one open socket per attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:23:24 -04:00
xXPBSXx 35a6df818f Merge remote-tracking branch 'upstream/main' into fix/export-ppsa30601-imports
# Conflicts:
#	core/libs/prx/libSceJson2/Export.cpp
#	docs/dev/TechnicalDebt.md
2026-10-12 01:19:36 +02:00
xXPBSXx 50ca599251 Merge remote-tracking branch 'upstream/main' into fix/ces-cp1251-profile
# Conflicts:
#	docs/dev/TechnicalDebt.md
2026-10-12 01:17:20 +02:00