Commit Graph
14017 Commits
Author SHA1 Message Date
Dean 74fefcaae3 Merge pull request #741 from alpinevm/feat/libc-strnlen-s
feat(libc): implement strnlen_s
2026-10-06 12:14:04 +13:00
Dean 1438d99560 Merge pull request #752 from Celegans12/feat/agc-conservative-z-export
feat(agc): accept conservative Z export in DB_SHADER_CONTROL
2026-10-06 12:13:21 +13:00
Dean d3e4edf15b Merge pull request #750 from Celegans12/feat/shader-flat-saddr-vcc
feat(shader): accept vcc as the scalar base address of global instructions
2026-10-06 12:12:39 +13:00
Dean 8379f09c79 Merge pull request #754 from Celegans12/feat/shader-swappc-null-setpc
feat(shader): implement s_swappc_b64 null, long branches and dword jump tables
2026-10-06 12:11:57 +13:00
Dean 82d1b129fa Merge pull request #648 from Celegans12/feat/videoout-dcc-presentation
feat(agc): present DCC display buffers whose keys are uncompressed or fast-cleared
2026-10-06 12:11:15 +13:00
Dean 7072c9049b Merge pull request #682 from Raghav314/feat/ajm-batch-cancel
feat(ajm): implement sceAjmBatchCancel
2026-10-06 12:10:33 +13:00
Dean 11c3e3e9f0 Merge pull request #680 from NumberGuan/codex/implement-http-response-header
feat(http): implement response header parsing
2026-10-06 12:09:48 +13:00
Dean 2474eee54e Merge pull request #746 from CnRJay/feat/ampr-counter-04-00
feat(libs): implement the AMPR 04_00 counter commands and the construct helpers
2026-10-06 12:09:04 +13:00
Adrià FranchandClaude 3a81905dd3 feat(libkernel): implement _is_signal_return
Guest signal handlers are called from a host dispatcher, so no guest PC is
a signal trampoline: return 0 for every address, as KytyPS5 and prosper do.

Co-Authored-By: Claude <[email protected]>
2026-10-06 01:09:00 +02:00
Dean f5b548a876 Merge pull request #580 from CnRJay/feat/ampr-nop-04-writes
feat(libs): implement the AMPR nops and the 04_00 completion writes
2026-10-06 12:08:21 +13:00
raghav314andClaude Opus 5.5 ce6d94793c feat(libkernel): implement sceKernelSyncOnAddressWait8 and sceKernelSyncOnAddressWait16
Wait8 and Wait16 compare the 1- or 2-byte value at the address with the
comparand and share the waiter queue of the other sizes.
sceKernelSyncOnAddressWake accepts any non-null address: libc's
__std_atomic_notify_one/all pass the atomic's own address, which for 8- and
16-bit atomics need not be 4-byte aligned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 04:30:12 +05:30
Adrià FranchandClaude 8232a4c071 feat(agc): implement sceAgcDcbContextStateOpGetSize
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:58:50 +02:00
Nahuel Genchi 5fab03e4e5 fix(relinker): keep host prx references out of guest modules on Linux
On Linux every module resolves its references through one global scope,
and the guest modules are listed ahead of the host prx. When a title
bundles its own libc.prx, the host libc and the other host prx bound
their references to their own NIDs to the guest libc, so the host libc
built its standard streams on top of the guest _Stdout.

The exports of guest modules, and the guest and executable imports that
a guest module satisfies, now carry a #guest suffix. The title's imports
still reach the guest modules first, and a host prx only sees host
definitions, as on Windows. sceKernelDlsym also looks for the suffixed
name.
2026-10-05 19:58:39 -03:00
Adrià FranchandClaude 9322634817 feat(agc): implement sceAgcGetDataPacketPayloadRange
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:54:31 +02:00
Adrià FranchandClaude 40c191029d feat(agc): implement sceAgcGetPacketSize
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:50:27 +02:00
Adrià FranchandClaude 5f68999836 feat(agc): implement sceAgcCondExecPatchSetCommandAddress and sceAgcCondExecPatchSetEnd
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:44:59 +02:00
Celegans12 adee347c14 feat(recompiler): structurize loops whose exits reach different program ends
A loop whose exits have no common post-dominator, such as a normal exit
to one s_endpgm tail beside an early-out to a kill tail, got no merge
block, and Structurize threw "loop at block N has no structured
merge/continue". With three or more exits, detectNaturalLoops threw
first, on a lookup of InvalidControlFlowId.

Such a loop now leaves through one new merge block that dispatches on
route variables. They are cleared before the header and set on each
exit edge to a target other than the latch's exit. Inner loops are
routed first; a routing that would change the natural loops throws.

A loop-exit tail branch whose in-body target is the continue block no
longer merges there, which spirv-val rejects ("Header block ... is
contained in the loop construct ..., but its merge block ... is not").
2026-10-06 00:35:47 +02:00
Celegans12 4a67b140fc feat(agc): accept conservative Z export in DB_SHADER_CONTROL
DecodeState, the draw precheck and DecodePixelStageInfo rejected every
nonzero CONSERVATIVE_Z_EXPORT (DB_SHADER_CONTROL bits 13-14).
EXPORT_LESS_THAN_Z (1) and EXPORT_GREATER_THAN_Z (2) promise that the
exported Z stays on one side of the interpolated Z. The value now
reaches the recompiler as a pixel stage field, and a pixel shader that
writes FragDepth declares DepthLess or DepthGreater next to
DepthReplacing, the SPIR-V modes RADV maps to these values. Vulkan lets
those modes only add a depth test of the interpolated Z before shading,
so a shader that keeps the promise renders the same. The reserved value
3 still throws.

The field is part of the recompile cache key, the draw key and the
serialized request (version 7), and ValidateShaders accepts both modes.
2026-10-06 00:35:43 +02:00
Celegans12 23c8985273 feat(shader): accept vcc as the scalar base address of global instructions
The FLAT decoder took a scalar base address (SADDR) only from a
numbered SGPR pair, so global loads, stores and atomics and
global_load/store_dword_addtid with SADDR = vcc (106) threw "FLAT
scalar address register range overflow". LLVM's GFX10 global saddr
operand accepts s, vcc, ttmp, null and off.

A two-register base may now be VCC. The address translation already
reads it as VCC_LO:VCC_HI through offsetOperand. The same helper
serves the scratch SADDR, where vcc_lo becomes the 32-bit offset.
VCC_HI, M0, EXEC and the trap temporaries still throw.
2026-10-06 00:35:37 +02:00
Adrià FranchandClaude 58263b5075 feat(libSceIme): implement keyboard info and mode queries
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:30:16 +02:00
Adrià FranchandClaude 23c8558c70 fix(contentexport): name the AOWqIYsgVHs stub sceContentExportFromData
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:30:00 +02:00
Adrià FranchandClaude aed4f3a25c feat(systemservice): implement PowerTick and ReportAbnormalTermination
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:29:42 +02:00
Adrià FranchandClaude f4b5b1ba50 feat(libSceShare): capture, open menu and current status calls
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:29:19 +02:00
Adrià FranchandClaude 948d3cd047 feat(libc): implement std::_Execute_once
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:28:52 +02:00
Adrià Franch 42869efbfa fix(audio3d): wait until the slot frees in blocking push 2026-10-06 00:28:19 +02:00
Adrià FranchandClaude 06d2ae5f05 feat(audio3d): implement the port queue
Initialize, PortOpen/Close, PortSetAttribute, PortGetQueueLevel,
PortAdvance and PortPush. One port, validation order and error codes from
the PS5 module as read by prosper; blocking push paced at granularity
samples per frame at 48 kHz like KytyPS5.

Co-Authored-By: Claude <[email protected]>
2026-10-06 00:28:19 +02:00
Adrià FranchandClaude fc96f96ac5 feat(ajm): parse the original file length in sceAjmDecMp3ParseFrame
Co-Authored-By: Claude <[email protected]>
2026-10-06 00:26:19 +02:00
husari.orozco abdf673b1e feat(relinker): support Windows guest TLS reads by ALU instructions
Recognize the read-direction ALU forms (add, or, adc, sbb, and, sub, xor,
cmp) that read a qword from fs:[disp32], such as the stack canary check
`xor rbx, fs:[0x28]` emitted by stack-protected functions. They were
rejected as unsupported, which blocked titles relinked on Windows.

The stub loads the TLS value and applies the operation in place, keeping
the final operation as the last flag-setting instruction and preserving
the accumulator and counter. A destination of rax uses rdx as the value
scratch so the original accumulator survives.

Refs #217
2026-10-05 16:16:46 -06:00
raghav314andClaude Opus 5.5 c0c34cc83c feat(ajm): implement sceAjmBatchCancel
sceAjmBatchStart processes every job before it returns the batch id, so a
batch that has not been waited on is never pending: cancelling it returns 0.
A batch that was never issued or was already waited on returns INVALID_BATCH,
and a context id that was never issued returns INVALID_CONTEXT, as in shadPS4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 03:45:33 +05:30
Kikoarl e2974fc4db feat(shader): implement S_SCRATCH_LOAD_DWORD, S_SCRATCH_LOAD_DWORDX2 and S_SCRATCH_LOAD_DWORDX4 2026-10-06 00:12:39 +02:00
Krzysztof Hasiński 09e41584ca fix(shader): apply f32 abs and neg source modifiers on the sign bit
F32 operands applied |x| and -x as FAbs and OpFNegate. The NVIDIA driver
returns its canonical NaN 0x7fffffff from FAbs of a NaN with a payload,
so an instruction that passes a NaN operand through on the bits, such as
v_div_fixup_f32 with |v5| = 0x7ff00000, loses the payload. RADV and
lavapipe keep it.

Clear or flip the sign bit instead, as readOperand already does for U32
operands. IEEE 754 defines abs and negate as sign-bit operations, so this
is exact for every input.
2026-10-06 00:04:14 +02:00
Celegans12 3a48a57dc7 feat(agc): encode the DCC clear codes of A2R10G10B10 color targets
LayoutFor had no case for VK_FORMAT_A2R10G10B10_UNORM_PACK32, the format
of a COLOR_2_10_10_10 color target with the alternate component swap, so
FillDccClear could not encode its 0001, 1110 and 1111 clear codes. The
format now takes the A2B10G10R10 layout: the codes set the three color
channels alike, so both packings give the same words.

A draw into a copied target under these keys now starts from the clear
value instead of the stored texels, and clearTexel (the CB metadata pass
and storeClearTexels) returns the texel instead of throwing. Textures
and resident targets, stored as A2B10G10R10, and DccAlphaOnMsb are
unchanged. Split out of #648.
2026-10-05 23:45:16 +02:00
Celegans12 241faf881e feat(agc): present DCC display buffers whose keys are uncompressed or fast-cleared
sceVideoOutRegisterBuffers2 threw "DCC presentation is not implemented"
for category 1 (DCC-compressed) buffers, which PPSA26344 registers. Such
a buffer now needs DCC metadata and the tiled layout, and dcc_control may
only use the CB_DCC_CONTROL block layout bits 0x10026c.

At a flip the keys are read behind their recorded writers, one byte per
256 bytes as in the driver's DCC model. Uncompressed keys present the
stored texels as before; a uniform clear code presents its color with a
GPU clear of the scaler's source image; a pending storage image is used
when it serves the keys. Mixed or unreadable keys, clear codes the
display format has no DCC encoding for, register-clear keys over a
pending image and a clear color wider than 32 bits throw. Buffers
without DCC take the old path.
2026-10-05 23:45:15 +02:00
Dean bc24783e5b Merge pull request #733 from alfalfa-star/fix/relinker-duplicate-guest-exports
fix(relinker): allow duplicate Linux guest exports that no module imports
2026-10-06 10:34:07 +13:00
Tomás Ortellado 669c7a40fa feat(http): implement response header parsing 2026-10-05 18:32:47 -03:00
Dean f00750e7bd Merge pull request #461 from oneandonlydean/feat/font-system-font-sets
feat(font): open system font sets from a font directory
2026-10-06 10:30:44 +13:00
Dean Galvin 9d4e6d2f28 feat(font): open system font sets from a font directory
sceFontOpenFontSet failed for every set type, so PPSA21564 drew no text
in system fonts (the title screen copyright line, credits, button
guides). It now loads the set's primary font file from
ANYPS5_SYSTEM_FONTS, or anyps5-fonts beside the executable: console
files under their own names first, then openly licensed substitutes
(Noto Sans, Noto Sans Mono, Noto Sans Thai, Noto Sans CJK). The
PS5-only JG2 set types are accepted.

System font handles use the system font context. Their faces are
loaded by FreeType in host memory: about 1 MiB per CJK face does not
fit the font memory the title sizes for the console's fonts, and
sceFontCreateRenderer then failed with ALLOCATION_FAILED. Handles of
the same font file share one copy of its bytes.
2026-10-06 10:27:09 +13:00
Merijn aaefea9626 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into feat/userservice-age-level
# Conflicts:
#	docs/dev/TechnicalDebt.md
2026-10-05 23:24:52 +02:00
MerijnandClaude Opus 5.5 dd2890c1c5 feat(libkernel): deliver sceKernelRaiseException on Windows
Run the SIGUSR1 handler recorded by sceKernelInstallExceptionHandler on the
target thread with a PS5 ucontext (uc_mcontext at 0x40, FreeBSD amd64
layout) of its interrupted state:

- on the calling thread, directly;
- on a thread in a libkernel wait, from an APC: the TimedWait waits are
  alertable and count themselves in a per-thread wait state, so the
  handler runs inside the wait, which then continues;
- on a running thread, by suspending it and redirecting it to an entry
  that calls the handler and restores the possibly modified context.

Other signals return EINVAL, as in shadPS4; raising without a handler
throws. Linux still throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 23:19:38 +02:00
MerijnandClaude Opus 5.5 d82bae0934 feat(libs): add exports imported by PPSA12544's Unity plugins
PPSA12544's Media/Plugins modules (CommonDialog, PSN, Share) import
libSceVrSetupDialog, which no library provided, and Share, NpTrophy2,
WebBrowserDialog and NpEntitlementAccess functions that were not
exported. Add libSceVrSetupDialog and the missing functions as
unimplemented exports, except
sceNpEntitlementAccessRequestConsumeServiceEntitlement, which reports
SCE_NP_ERROR_SIGNED_OUT like
sceNpEntitlementAccessRequestConsumeUnifiedEntitlement. Their other
imports are covered by #734 and #369, and two by #407.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 23:18:46 +02:00
MerijnandClaude Opus 5.5 6ffc81a969 feat(msgdialog): add progress bar calls to libSceMsgDialog.native
PPSA12544's Unity plugins (CommonDialog, PSN) import
sceMsgDialogProgressBarInc, sceMsgDialogProgressBarSetMsg and
sceMsgDialogProgressBarSetValue from libSceMsgDialog.native, which did
not export them. As in libSceMsgDialog, they succeed while a dialog is
running and return COMMON_DIALOG_ERROR_NOT_RUNNING otherwise; the native
dialog finishes in sceMsgDialogOpen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 23:15:28 +02:00
MerijnandClaude Opus 5.5 fd37c58391 fix(libkernel): report the stack of adopted threads
scePthreadAttrGet reported a null stack address and a zero size for an
adopted thread (the main thread), and for every guest thread on Linux,
where the stack range was never recorded. A garbage collector that scans
thread stacks through scePthreadAttrGetstackaddr and
scePthreadAttrGetstacksize (Unity IL2CPP in PPSA12544) then skipped the
main thread's stack and freed objects it still referenced. The range now
comes from the host thread: GetCurrentThreadStackLimits on Windows,
pthread_getattr_np on Linux.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 23:00:41 +02:00
Chad 4d10fd1796 Merge branch 'feat/amm-remap-protect' into feat/amm-prt 2026-10-05 16:00:02 -05:00
Chad e15c039ef8 Merge branch 'feat/amm-core' into feat/amm-remap-protect 2026-10-05 16:00:01 -05:00
ChadandClaude Opus 5.5 710369f3d3 test(libs): access aliased AMM mappings through volatile references
The AMM test writes through one mapping of a physical page and reads it
through another. The two addresses are distinct to the compiler, so GCC
13 at -O2 moved the read ahead of the write and the Linux CI check saw
the old value. The test's At helper now returns a volatile reference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 15:59:59 -05:00
Chad 453874d1d8 Merge branch 'feat/amm-remap-protect' into feat/amm-prt 2026-10-05 15:56:51 -05:00
Chad 11e9f6e0ab Merge branch 'feat/amm-core' into feat/amm-remap-protect 2026-10-05 15:56:49 -05:00
ChadandClaude Opus 5.5 164fcf7a05 test(libs): report the failing line of the AMPR tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 15:56:48 -05:00
MerijnandClaude Opus 5.5 73a0bc5eb4 feat(libkernel): record exception handlers
sceKernelInstallExceptionHandler and sceKernelRemoveExceptionHandler threw.
They now keep one handler per allowed signal (SIGHUP, SIGILL, SIGFPE,
SIGBUS, SIGSEGV, SIGUSR1, as in shadPS4): another signal or a null handler
returns EINVAL, a second handler for a signal returns EAGAIN, and removing
clears it. Delivery is not implemented and is recorded in the technical
debt; sceKernelRaiseException still throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 22:50:24 +02:00
MerijnandClaude Opus 5.5 9489b851ae fix(libkernel): read defaultLanguage from localizedParameters
A PS5 param.json keeps defaultLanguage inside localizedParameters, next to
the language entries. The parser looked for it at the root only, then fell
back to en-US and to the first member, which is the defaultLanguage string
when no en-US entry exists (PPSA12544 has only en-GB), and threw
"expected JSON object". defaultLanguage is now read from
localizedParameters first, and the fallback takes the first language
object.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 22:48:06 +02:00