Commit Graph
6138 Commits
Author SHA1 Message Date
Dean a57ccfb426 Merge pull request #1275 from KSWORK2001/fix/libscertc-dostime-range
fix(libSceRtc): answer out-of-range years in sceRtcGetDosTime
2026-10-08 19:35:43 +13:00
Dean 08766c4e71 Merge pull request #1251 from MGXAe/arena/a135bd3b-anyps5
fix(nid): reject libraries that define symbol versions
2026-10-08 19:35:39 +13:00
Dean bbead6f34b Merge pull request #1420 from Amirtheshwaran/fix/check-conventions-windows-encoding
fix(tools): read and write UTF-8 in check_conventions regardless of the Windows code page
2026-10-08 19:35:36 +13:00
Adrià 56f3da20e8 Merge pull request #1072 from alfalfa-star/feat/agc-cmask-fast-clear
feat(agc): render into CMASK fast-clear color targets
2026-10-08 08:32:04 +02:00
Adrià FranchandClaude 25000541ad test: give fixed temp files a random suffix so parallel runs don't collide
Co-Authored-By: Claude <[email protected]>
2026-10-08 08:31:16 +02:00
gookie de651c6283 fix(agc): read indirect register lists when the command buffer is submitted
The driver copies a submission's packets when it is submitted, but
SET_SH_REG_INDIRECT, SET_UCONFIG_REG_INDIRECT and SET_CONTEXT_REG_INDIRECT
read their (offset, value) lists from guest memory only when the queue
worker reaches the packet. A title that reuses its per-frame memory once
it expects the GPU to be done with it can rewrite a list in between, and
the worker then throws on the data it finds there ("extended register
semantics are not implemented (offset dword 0x3a888889)").

The lists are now read with the packets, after validation, in Submit and
for a rewind tail, and the worker writes the registers from that copy.
Pm4::Execute keeps reading the list itself for direct callers.

PPSA21402 (Balatro) keeps three frame slots and does not wait for the GPU
before reusing one: its slot labels start at 0xffffffff and the GPU only
ever writes 0xffffffff to them, so the poll before a slot is reused never
blocks. When the worker falls more than two frames behind, the title
writes per-draw constants over a SET_CONTEXT_REG_INDIRECT list the worker
has not read yet.

The console's PFP reads the list when it reaches the packet; the
difference is recorded in TechnicalDebt.md.
2026-10-08 08:30:22 +02:00
tototomate123 0b0526c4d1 fix(prx): add missing offline HFW imports 2026-10-08 08:27:31 +02:00
Adrià FranchandClaude 53a31b512e test(guest_memory): pin mprotect on an unmapped and a wrapping range
Both return -1/EINVAL: FreeBSD kern_mprotect (sys/vm/vm_mmap.c) maps only
PROTECTION_FAILURE, RESOURCE_SHORTAGE and OUT_OF_BOUNDS to their own errno, so
KERN_INVALID_ADDRESS falls to EINVAL.

Co-Authored-By: Claude <[email protected]>
2026-10-08 08:24:12 +02:00
kjhqandClaude Opus 5.5 35ae8742a9 feat(libkernel): implement POSIX mprotect
mprotect changes the protection of guest memory through the same path
as sceKernelMprotect and reports failures through errno: EINVAL for a
null or overflowing range or a range the allocation tracker rejects,
ENOMEM when allocation fails. A zero length succeeds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 08:24:06 +02:00
kjhq 329c825fe1 docs(libkernel): record how PPSA17221 reads sceKernelWriteThrottlingStatus 2026-10-08 08:21:30 +02:00
kjhq 295780ab20 feat(libkernel): report no write throttling in sceKernelWriteThrottlingStatus
The host has no SSD write budget, so the status reports the largest budget in its first qword and zeroes the rest.
2026-10-08 08:21:23 +02:00
Raj faad75d655 refactor(libc): remove the unused register save area vararg helpers
The VA_ARGS parameter list and VarArgsAbi.hpp (RegSaveArea, FillRegSaveArea,
BuildVaList and the Xmm alias in SimdTypes.hpp) were only used by the four
Linux exports that now take their arguments with va_start.
2026-10-08 11:46:56 +05:30
Raj 18113907c8 test(libc): run guest_formatting on Linux
guest_formatting_tests was built on Linux but registered with ctest on
Windows only, so the Linux printf and scanf exports had no coverage: on main
the test fails there at its first vsnprintf check and then crashes in
snprintf with eight integers.

It is registered on every platform now. The %ls checks stay Windows-only,
as glibc reads %ls as 32-bit wchar_t; that gap is recorded in TechnicalDebt.
2026-10-08 11:46:56 +05:30
Raj cbc7498b12 fix(libc): format from a copy of the guest va_list on Linux
The Linux vprintf, vsprintf, vsnprintf, vsprintf_s, vfprintf, vasprintf and
vsscanf handed the guest's va_list to the host function, which advanced the
guest's gp_offset, fp_offset and overflow_arg_area. A caller that formats
the same list twice, first to size the output and then to write it, got its
second call's arguments from past the end.

The Windows path reads its arguments from a copy (LibcDetail::FormatArguments)
and guest_formatting checks that vsnprintf leaves the list unchanged. Linux
now does the same with va_copy.
2026-10-08 11:46:56 +05:30
Raj 887a258152 fix(libc): read every variadic argument of the Linux snprintf, sprintf, sscanf and libc_printf
On Linux these four exports took the guest's registers as named parameters
and rebuilt a va_list from them. The register save area held only the
argument registers after the fixed ones, followed by zeros, with gp_offset 0,
so va_arg read the zeros for the remaining integer slots before moving to the
overflow area. overflow_arg_area was the seventh integer parameter, which is
the value of the first stack argument, not its address.

snprintf(buffer, size, "%d %d %d %d", 1, 2, 3, 4) produced "1 2 3 0",
"%s/%s/%s/%s" with four strings produced "a/b/c/(null)", and eight integers
dereferenced the value 4 and crashed. sprintf and sscanf lost their fifth
and sixth arguments, libc_printf its sixth.

They are now variadic functions that use va_start, like printf, sprintf_s,
snprintf_s and printf_s on Linux already do.
2026-10-08 11:46:56 +05:30
Adrià 7a178e2276 Merge pull request #1089 from AaravMehta-07/fix/relinker-registry-json
fix(relinker): escape control characters in call registry JSON
2026-10-08 08:10:07 +02:00
TibixDev ce280a19ca perf(agc): handle uniform pattern-fill kernels as clears
Recognize the exact typed pattern-fill kernel and route aligned, nonaliased uniform ranges through existing fill/coherence handling. Preserve control and descriptor bounds, partial dispatch counts, queued labels, and shader fallback for other cases.

Semantics checked on Radeon RX 6600: native RDNA wave32/wave64 typed R32_UINT loads/stores, execution masks, and descriptor bounds (16 cases). Real PM4 tests cover HLE and shader paths, imports and copies, indirect/partial dispatch and GPU-to-label ordering under Vulkan validation. Graphics and PM4 tests pass; Skyrim Helgen save visually checked. 64 MiB copied-buffer fill median reduced from 67.5 ms to 3.8 ms.

Written with AI assistance.
2026-10-08 09:08:38 +03:00
Adrià dcbf089d28 Merge pull request #995 from CnRJay/fix/appcontent-user-defined-params
fix(libSceAppContent): read user defined app params from param.json
2026-10-08 08:07:21 +02:00
Adrià 57b62cedf1 Merge pull request #1088 from kjhq/fix/libkernel-sockaddr-len
fix(libkernel): accept guest socket addresses whatever their sa_len
2026-10-08 08:07:17 +02:00
Adrià e9fecced17 Merge pull request #1086 from Celegans12/fix/agc-depth-bias-clamp-default
fix(agc): include PA_SU_POLY_OFFSET_CLAMP in the initial context state
2026-10-08 08:06:30 +02:00
Adrià 30e500f781 Merge pull request #917 from TidalImpact/fix/rela-bounds-check
fix(relinker): overflow-safe RELA entry bounds check
2026-10-08 08:03:28 +02:00
Adrià 57669661c5 Merge pull request #1038 from gjonn/feat/ngs2-pcm-streaming
feat(libSceNgs2.native): stream 16-bit PCM waveforms through appended waveform blocks
2026-10-08 08:01:17 +02:00
Adrià 1b309e7e0f Merge pull request #1031 from Dextroid17/ci/build-with-spirv-tools
ci: build with SPIRV-Tools so the shader tests validate their output
2026-10-08 07:59:07 +02:00
alfalfa-starandClaude Opus 5.5 b5be685912 feat(agc): accept CMASK fast-clear DCC targets whose CMASK is expanded
A color target with both DCC and CB_COLOR_INFO.FAST_CLEAR keeps its fast
clear in the DCC keys and fills its CMASK with 0xF (expanded), as radv
does (radv_get_cmask_fast_clear_value) and as PPSA21567 does
(CB_COLOR_INFO 0x10042730, reported on #419). Such targets now decode;
their clear is materialized by the existing DCC path. A DCC target's
CMASK that is not all expanded throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 07:58:40 +02:00
alfalfa-starandClaude Opus 5.5 61a61016d8 feat(agc): render into CMASK fast-clear color targets
Draws into a color target with CB_COLOR_INFO FAST_CLEAR (bit 13) were
rejected. The CMASK keeps one nibble per 8x8 tile: 0 means the tile is
fast-cleared and reads as CB_COLOR_CLEAR_WORD, 0xF means expanded (the
texels hold the color). The texture units and display scanout do not read
it, so a title runs a fast-clear eliminate pass before sampling or
flipping such a target.

DecodeColorBuffer now takes the CMASK address (CB_COLOR0_CMASK and
CB_COLOR0_CMASK_BASE_EXT) and the bytes one nibble per 8x8 tile spans.
Before a draw renders into the target, and in a fast-clear eliminate
pass, a CMASK whose nibbles are all 0 is materialized: the target is
filled with the clear texel (FillClear on its resident image, else
guest memory on the CPU) and the CMASK bytes are stored as expanded,
through the same GPU-ordered store as the DCC "uncompressed" keys
(0xFF either way). The result equals the draw followed by the eliminate
pass. An all-expanded CMASK changes nothing; a mixed one throws, as do
fast clears of DCC, mipmapped, 3D and array targets.

PPSA14632 (LEGO Horizon Adventures) fast-clears its two 3840x2160
display buffers through CMASK, so its final composite draw was dropped
on every frame and only black was presented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 07:58:31 +02:00
Adrià e98466797f Merge pull request #1082 from MuhammadUmair1019/fix/oracle-explicit-float-modes
fix(oracle)!: require explicit float modes
2026-10-08 07:56:13 +02:00
Adrià 058dead176 Merge pull request #1058 from Celegans12/feat/agc-r8-srgb-color-target
feat(agc): implement 8 srgb color targets through rgba8 srgb proxies
2026-10-08 07:52:45 +02:00
4e69584edf test(relinker): pin RELA bounds check with malformed-ELF cases
Co-authored-by: Dextroid17 <[email protected]>
Co-Authored-By: Claude <[email protected]>
2026-10-08 07:52:32 +02:00
Fynn Jannis Schulz 9ff9d4325c fix(relinker): share RELA entry bounds check with extractRelative 2026-10-08 07:52:23 +02:00
Fynn Jannis Schulz cfba9c09d2 fix(relinker): overflow-safe RELA entry bounds check 2026-10-08 07:52:23 +02:00
Adrià 1f7109c2b4 Merge pull request #1071 from LeandroLP23/fix/agc-address-space-cache-exit
fix(agc): release the current address space with the image mirrors
2026-10-08 07:50:27 +02:00
Adrià a9c66ebfd6 Merge pull request #1065 from alfalfa-star/fix/radv-descriptor-pool-tail
fix(agc): keep RADV's descriptor pool overrun inside the pool's pages
2026-10-08 07:49:38 +02:00
Adrià FranchandClaude 1b9a1243dc test(libSceAppContent): pin sceAppContentAppParamGetInt ids 0..5
Co-Authored-By: Claude <[email protected]>
2026-10-08 07:49:22 +02:00
ChadandClaude Opus 5.5 3b6183a208 fix(libSceAppContent): read user defined app params from param.json
sceAppContentAppParamGetInt numbers the SKU flag 0 and
USER_DEFINED_PARAM_1..4 as 1..4 (fpPS4 ps4_libsceappcontent). Id 1
returned the SKU flag and 2..5 returned zero. UFC 6 (PPSA23566) checks
that param 1 is its title number, userDefinedParam1 in param.json, and
crashes otherwise. Absent params read as zero.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 07:49:16 +02:00
MathiasDevelopesandClaude Opus 5.5 77ef75c1da feat(libkernel): implement sceKernelGetModuleInfoFromAddr on Windows
Read the module layout from the PE image that holds the address. A
relinked image reports its .elf sections as segments and the
eh_frame_hdr recorded in .ehmeta; any other image reports its sections
with memory access and its .ehfram section. The eh_frame_hdr and
eh_frame helpers are shared with the Linux path, and the guest module
info test now also runs on Windows.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-08 05:46:48 +00:00
Adrià 311c0493bd Merge pull request #957 from JAB-dev/feat/kernel-flexible-internal-hint
feat(libkernel): accept flag 0x8000 in sceKernelMapNamedFlexibleMemoryInternal
2026-10-08 07:42:56 +02:00
Adrià Franch ac61a95378 ci: enable SPIRV-Tools on the linux job only 2026-10-08 07:41:12 +02:00
Dextroid17 d386818579 ci: build with SPIRV-Tools so the shader tests validate their output
CI configures without ANYPS5_ENABLE_SPIRV_TOOLS, so the shader recompiler never validates or
optimizes the SPIR-V it emits - Recompiler.cpp guards the ValidateAndOptimizeSpirv call on that
macro - and the shader tests lose the blocks that exercise it:

- ShaderMemory.cpp guards five blocks on the macro, including three expectFailure cases that are
  the only coverage for rejecting invalid SPIR-V and for rejecting an unsupported Vulkan or SPIR-V
  target.
- SpirvOptimizer.cpp includes the SPIRV-Tools headers, so the file is not built at all.
- README.md gives the Spirv-Tools validation as how the recompiler is known to produce valid
  SPIR-V, and no job exercises it.

Add the flag to CONFIGURE. Verified with the CI command and the CI device (lavapipe, subgroup 8,
ANYPS5_REQUIRE_VULKAN=1, GALLIUM_OVERRIDE_CPU_CAPS=avx): the full suite passes 371/371 with the
flag on, with the same 20 skips, and agc_shader_memory passes.

SPIRV-Tools is a submodule built from source, so this adds build time to the job. I have not
measured how much; if it is too much, the flag can go on one job instead of the shared CONFIGURE.
2026-10-08 07:41:05 +02:00
Gjon Gojcevic 88e77da57b feat(libSceNgs2.native): stream 16-bit PCM waveforms through appended waveform blocks
A 16-bit PCM block whose num_samples exceed its data starts a stream, and waveform blocks with flag 0x2 append more data to it. The voice outputs silence while it has played all appended data and CONTINUE is set, and ends at num_samples or when CONTINUE is cleared.
2026-10-08 07:35:59 +02:00
Dean c8a2f06325 Merge pull request #1248 from eliasbruno124-dev/fix/net-ipv6-any-current
fix(net): provide IPv6 unspecified address object
2026-10-08 18:29:31 +13:00
Dean 78cac62f30 Merge pull request #1137 from Sanjaysrinivas/fix/progress-shared-sources
fix(progress): report shared-source libraries
2026-10-08 18:29:17 +13:00
Dean 0ce1e45091 Merge pull request #1083 from ctz23/docs/linux-x11-build-requirements-20261007
docs(build): list Linux X11 development dependencies
2026-10-08 18:29:03 +13:00
Dean baf2ee3399 Merge pull request #1254 from popcoder565/fix/conventions-windows-paths
fix(tools): resolve documentation links as repository paths on Windows
2026-10-08 18:28:48 +13:00
Dean d548449654 Merge pull request #1229 from hashaam1217/fix/pr-overlap-older-git
fix(tools): run pr_overlap on git older than 2.45
2026-10-08 18:28:28 +13:00
Dean a7715e671f Merge pull request #1109 from Sanjaysrinivas/fix/savedata-memory-write-preservation
fix(savedata): preserve memory on write failure
2026-10-08 18:28:14 +13:00
Dean 4a435af58a Merge pull request #1103 from ctz23/test/windows-icon-distinct-output-20261007
test(relinker): use distinct executables in Windows icon tests
2026-10-08 18:28:01 +13:00
Dean 7753fb0165 Merge pull request #1407 from hugodearaujo/fix/voiceqos-init-error-codes
fix(voiceqos): return the console's sceVoiceQoSInit argument errors
2026-10-08 18:23:39 +13:00
TibixDev e6324faef6 fix(npmanager): track reachability callback registration
Validate registration and unregister state in the existing offline model. Add lifecycle and invalid-argument coverage.

Written with AI assistance.
2026-10-08 08:23:31 +03:00
Dean 6d58dc5a3e Merge pull request #1376 from kallmek3nny/docs/bundled-module-runtime
docs(user): clarify bundled module runtime paths
2026-10-08 18:23:25 +13:00
Dean 4f7c32a2df Merge pull request #1295 from TibixDev/pr/tls-destructor-test
test(libc): resolve the library address in the TLS destructor test
2026-10-08 18:23:12 +13:00