Commit Graph

174 Commits

Author SHA1 Message Date
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
Dean 2707b3a3c8
Merge pull request #736 from adriadam10/feat/libc-wcsrtombs-s
feat(libc): implement wcsrtombs_s
2026-10-06 09:31:24 +13:00
Dean 681f83e51e
Merge pull request #713 from adriadam10/feat/savedata-ps4-transfer
feat(savedata): implement the PS4 transfer mount and directory search
2026-10-06 08:14:26 +13:00
Dean a2da600645
Merge pull request #712 from adriadam10/feat/share-capture-screenshot-extended
feat(libSceShare): sceShareCaptureScreenshotExtended
2026-10-06 08:13:44 +13:00
Dean d66925cd5f
Merge pull request #708 from adriadam10/feat/http-inflate-gzip
feat(http): name sceHttpSetInflateGZIPEnabled and sceHttpSetRequestStatusCallback
2026-10-06 08:12:50 +13:00
Dean 949de6665b
Merge pull request #707 from adriadam10/feat/ulobjmgr-register
feat(ulobjmgr): register and unregister object
2026-10-06 08:12:08 +13:00
Dean 74dda5d30a
Merge pull request #703 from adriadam10/feat/nptrophy2-unregister-unlock-callback
feat(libs): implement sceNpTrophy2UnregisterUnlockCallback
2026-10-06 08:11:26 +13:00
Dean 170ef4a28f
Merge pull request #649 from Celegans12/feat/audioout2-3d-latency
feat(audioout): implement sceAudioOut2Set3DLatency and accept sceAudioOut2MasteringInit(0)
2026-10-06 08:09:17 +13:00
Dean fa9b2ed0ba
Merge pull request #643 from Celegans12/feat/msgdialog-native-close
feat(msgdialog): implement sceMsgDialogClose in libSceMsgDialog.native
2026-10-06 08:07:51 +13:00
Dean 4b0c38f0e4
Merge pull request #642 from Celegans12/feat/http-parse-status-line
feat(http): implement sceHttpParseStatusLine
2026-10-06 08:07:07 +13:00
Dean 20be619dce
Merge pull request #640 from Celegans12/feat/systemservice-param-get-string
feat(systemservice): implement sceSystemServiceParamGetString
2026-10-06 08:06:55 +13:00
Dean de82e335a3
Merge pull request #634 from Celegans12/feat/np-commerce-icon-layout
feat(npcommerce): implement sceNpCommerceSetPsStoreIconLayout
2026-10-06 08:06:01 +13:00
Dean 3e5558dd43
Merge pull request #632 from Celegans12/feat/razorcpu-markers
feat(razor): implement sceRazorCpuPushMarkerStatic and sceRazorCpuPopMarker
2026-10-06 08:05:19 +13:00
Dean 974c3fa1b5
Merge pull request #652 from Celegans12/fix/guest-arena-app-map-area
fix(libc): reach the application map area end with the guest arena
2026-10-06 08:04:36 +13:00
Dean 25c4a9460d
Merge pull request #650 from Celegans12/fix/windows-direct-memory-commit
fix(libkernel): state the size of a direct memory backing Windows cannot create
2026-10-06 08:03:53 +13:00
Dean e8893dfc64
Merge pull request #633 from Celegans12/feat/kernel-sync-on-address-wait-sized
feat(libkernel): implement sceKernelSyncOnAddressWait32 and sceKernelSyncOnAddressWait64
2026-10-06 08:02:29 +13:00
Dean cd79926080
Merge pull request #671 from NahuelGenchi/docs/fma-legacy-fused-assumption
docs: record the fused assumption of v_fma_legacy_f32 in TechnicalDebt
2026-10-06 07:56:35 +13:00
Dean eabf1418de
Merge pull request #647 from Celegans12/feat/videoout-strict-colorimetry
feat(videoout): accept the STRICT_COLORIMETRY buffer option
2026-10-06 07:54:15 +13:00
Dean 7df0923570
Merge pull request #659 from Celegans12/feat/agc-image-atomics-32bit-formats
feat(agc): implement image atomics on 32_SINT and 32_FLOAT surfaces
2026-10-06 07:52:39 +13:00
Dean 18f1548703
Merge pull request #678 from Celegans12/feat/agc-clip-cntl-dx-linear-attr
feat(agc): accept linear attribute clipping in PA_CL_CLIP_CNTL
2026-10-06 07:50:16 +13:00
Dean 0a081cbe8c
Merge pull request #673 from Celegans12/feat/agc-pm4-cond-exec
feat(agc): implement COND_EXEC
2026-10-06 07:49:33 +13:00
Dean 75aa7f2197
Merge pull request #651 from Celegans12/feat/agc-interpolant-mapping-f16-high
feat(agc): implement the interpolant mapping variant for high-half f16 inputs
2026-10-06 07:48:08 +13:00
Dean d9162684ee
Merge pull request #646 from Celegans12/fix/agc-get-is-trinity-mode
fix(agc): store sceAgcGetIsTrinityMode's flag through its out pointer
2026-10-06 07:47:55 +13:00
Adrià Franch 55f548d6bc feat(libc): implement wcsrtombs_s
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 20:29:18 +02:00
Adrià Franch e923bea317 feat(savedata): implement the PS4 transfer mount and directory search
Rename the two unknown libSceSaveData.native stubs to
sceSaveDataTransferringMountPs4 (RjMlsR8EXrw) and
sceSaveDataDirNameSearchPs4 (X4MYzukPc3g). There is no PS4 save area:
the mount returns NOT_FOUND like sceSaveDataTransferringMount, and the
search reports zero hits.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:41:59 +02:00
Adrià Franch 9b9194e543 feat(libSceShare): sceShareCaptureScreenshotExtended
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:35:25 +02:00
Adrià Franch 7bcdc6f578 feat(http): name sceHttpSetInflateGZIPEnabled and sceHttpSetRequestStatusCallback
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:29:54 +02:00
Adrià Franch 4136a04ba7 feat(ulobjmgr): register and unregister object
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:25:46 +02:00
Adrià Franch f3e783b6cb feat(libs): implement sceNpTrophy2UnregisterUnlockCallback
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-05 19:14:49 +02:00
Merijn 67d2c3c0a3 feat(userservice): implement sceUserServiceGetAgeLevel
Report age level 0 for the initial user and reject other users and a null
output like the other user queries. The meaning of the value is unknown and
recorded in the technical debt; PPSA12544 only stores it for its user
profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:05:50 +02:00
Celegans12 d3e2e53a7c feat(videoout): accept the STRICT_COLORIMETRY buffer option
sceVideoOutRegisterBuffers2 and sceVideoOutSubmitChangeBufferAttribute2
threw for every buffer attribute option other than 0. PPSA26344 builds
its display buffers with option 8 through the libSceAgc helper linked
into it, so its first registration failed.

Option 8, VIDEO_OUT_BUFFER_ATTRIBUTE_OPTION_STRICT_COLORIMETRY (name
and value from KytyPS5), is now accepted and presented as option 0;
every other option still throws. What the console changes for it is
unknown and recorded in TechnicalDebt. The rejection now names the
tiling mode, pitch, aspect ratio and option it was given.

video_out_flip_tests decode checks that option 8 describes the same
buffer as option 0 and that options 1, 32 and 40 are rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:53:26 +02:00
Celegans12 e30336c815 feat(razor): implement sceRazorCpuPushMarkerStatic and sceRazorCpuPopMarker
Ghost of Yotei (PPSA26344) imports both functions, so its import
resolution failed at startup. Markers only feed an attached Razor
capture. AnyPS5 hosts none and sceRazorCpuIsCapturing reports 0, so,
like the other libSceRazorCpu exports, both do nothing and return 0.

The push signature comes from the title's calls (a string literal,
0x80ffffff, 2). TechnicalDebt lists both functions with the assumed
signatures. guest_razor_cpu covers nested and unbalanced markers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:53:15 +02:00
boykopovar a4c290f50b
Merge pull request #644 from Celegans12/feat/psml-mfsr-unavailable
feat(psml): implement the MFSR 1100 calls for hardware without PSSR
2026-10-05 19:52:11 +03:00
Celegans12 62c70fb1d5 fix(libkernel): state the size of a direct memory backing Windows cannot create
On Windows each direct memory allocation is backed by a page-file
section that CreateFileMappingW commits in full. When the system commit
limit cannot cover it, the title stopped with "create direct memory
backing: Insufficient system resources exist to complete the requested
service", which did not say how much was requested.

The error now states the requested size in bytes and MiB, and the
runtime layout notes in USAGE.md describe the commit requirement and
the page file. Allocation behaviour is unchanged: committing at
allocation matches the console, where allocated direct memory is
always backed by physical memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:52:04 +02:00
Celegans12 15b191ef6a feat(systemservice): implement sceSystemServiceParamGetString
The export threw, and titles query the system name during startup.
Parameter 6 (the system name) now writes the fixed name "PS5" into a
buffer of at least SYSTEM_SERVICE_MAX_SYSTEM_NAME_LENGTH (65) bytes.
A null buffer or a zero size returns SYSTEM_SERVICE_ERROR_PARAMETER,
as in KytyPS5. Other parameter ids and buffers of 1 to 64 bytes still
throw, because no PS5 source gives their result. guest_system_service
covers the error rows, both throws and the returned name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:52 +02:00
Celegans12 776ecd3b35 feat(psml): implement the MFSR 1100 calls for hardware without PSSR
scePsmlMfsrGetContextBufferRequirement1100, scePsmlMfsrCreateContext1100
and scePsmlMfsrGetDispatchMfsrPacket1100 were not exported, so a title
importing them failed to load.

In Sony's libScePsml all three return 0x8A810001 (not initialized)
without writing their outputs until scePsmlMfsrInit has succeeded.
AnyPS5's scePsmlMfsrInit throws, so that is the only state a title can
reach, and the three calls now return that error.

The existing stubs for scePsmlMfsrInit, scePsmlMfsrReleaseContext and
scePsmlMfsrGetDispatchMfsrPacketSizeInDwords get their real names and
still throw. libScePsml_debug gets a CMakeLists.txt for the new
guest_psml test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:47 +02:00
Celegans12 05dc3e8982 feat(npcommerce): implement sceNpCommerceSetPsStoreIconLayout
Titles set the PS Store icon layout before they show the icon, and a
title that imports the call stops at startup on the unresolved import.
No PS Store icon is drawn, so like the show and hide calls it accepts
every layout and returns 0 without effect. The signature follows
shadPS4 (a PS4 reference), which also returns OK for every layout.

The libSceNpCommerce entry under "Silent stubs" in TechnicalDebt now
names the function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:41 +02:00
Celegans12 09218ee68a feat(msgdialog): implement sceMsgDialogClose in libSceMsgDialog.native
A title that loads libSceMsgDialog.native without libSceMsgDialog
imports sceMsgDialogClose from it, so without the export it stops at
startup on an unresolved import.

Close turns a running dialog into a finished one and returns
NOT_RUNNING in every other state, as libSceMsgDialog's Close does.
The module keeps its own dialog status, so it cannot reuse that
export. Open in this module finishes the dialog at once, so Close
after Open returns NOT_RUNNING and leaves the result unchanged.

The module is now listed under silent stubs in TechnicalDebt, and a
CMakeLists.txt registers the guest_msg_dialog_native test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:38 +02:00
Celegans12 2dea7164e3 feat(libcinternal): run thread_local destructors at thread exit
A title's own libc.prx implements __cxa_thread_atexit and the
destructor pass of exit() through _sceLibcInternalThreadAtexit and
_sceLibcInternalThreadDtors. Its __cxa_finalize calls
_sceLibcInternalForceTlsDestructor.

Destructors are kept per thread and run newest first, including those
registered while they run, as FreeBSD's __cxa_thread_call_dtors does.
A null destructor or one outside every loaded image throws instead of
being skipped. The first registration installs the pass as the
libkernel thread exit hook, so it runs on every guest thread before
the thread can be joined. _sceLibcInternalForceTlsDestructor throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:35 +02:00
Celegans12 28b2a08fa7 feat(libkernel): implement sceKernelSyncOnAddressWait32 and sceKernelSyncOnAddressWait64
libc's __std_atomic_wait_direct_32 and __std_atomic_wait_direct_64
import these functions, so a libc.prx that contains the C++20 atomic
wait wrappers does not load without them. Wait32 compares a 4-byte
value and Wait64 the full 8-byte value. Both share the waiter queue
of sceKernelSyncOnAddressWait, so sceKernelSyncOnAddressWake releases
waiters of every size on the address. A null address, or one not
aligned to the value size, throws. The by-value comparand, the return
values and the 8-byte alignment of Wait64 are assumed and recorded in
TechnicalDebt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:32 +02:00
Celegans12 d926e7879c feat(http): implement sceHttpParseStatusLine
Titles import sceHttpParseStatusLine from libSceHttp to read the
status line of a response; without the export they fail at startup.
Parse the HTTP/x.y version, the three-digit code and the reason phrase
up to the line feed, and return the library's PARSE_HTTP error codes.
The seven-argument signature is the one SharpProspero declares; the
behaviour follows the shadPS4 reimplementation of the PS4 library,
except that no byte past lineLen is read. A consumed count above
INT32_MAX cannot be returned and throws. guest_http covers valid lines
and each error path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:29 +02:00
Celegans12 5085746fce fix(libc): reach the application map area end with the guest arena
On Windows the guest arena ended at 0x72_0000_0000: #231 kept its
448 GiB size after #153 had moved its start down to 0x2_0000_0000.
Titles map fixed addresses up to the application map area end,
0xFC_0000_0000 (SCE_KERNEL_APP_MAP_AREA_END_ADDR on the PS4), and a
direct memory mapping above the old end threw "shared mapping outside
the guest arena".

The arena is now reserved up to 0xFC_0000_0000. The out-of-arena
errors name the address and length, and a fixed mapping over a used
arena range says whether it hit a host region. guest_memory maps
direct memory at the last two pages below the end, reads it through
an alias and checks that a mapping at the end is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:26 +02:00
Celegans12 0404752111 feat(audioout): implement sceAudioOut2Set3DLatency and accept sceAudioOut2MasteringInit(0)
PPSA26344 calls sceAudioOut2Set3DLatency(0xFF, 2) right after
sceAudioOut2Initialize and fails its audio initialization on a negative
return; the export was missing, so the import did not resolve. Its
audio subsystem setup also calls sceAudioOut2MasteringInit(0), which
threw.

sceAudioOut2Set3DLatency accepts a latency of 2 for the system user
(0xFF) and throws for any other user or latency, as the unit and range
are unknown. sceAudioOut2MasteringInit accepts flags 0 and throws for
other flags. There is no 3D rendering or mastering stage, so neither
call changes the output; TechnicalDebt lists this under Functional and
the assumed signatures under Unknown function info.

The new audio_out2_latency test covers the accepted and thrown values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:23 +02:00
Celegans12 9df0de2990 feat(agc): implement COND_EXEC
Validate refused every COND_EXEC, so a submission that uses one was
rejected as a whole. The packet now reads the dword at its address once
the earlier packets of its queue and their GPU writes have completed,
and skips the exec_count dwords after it when the dword is zero.

The command copy that inlines INDIRECT_BUFFERs records where each range
ends, so a range over an INDIRECT_BUFFER skips the whole buffer.
Unaligned addresses, address bits 48 and up, and reserved control and
count bits throw; the cache policy is accepted on compute queues only,
as the MEC defines it. A flip inside a range, a range that ends inside
a packet or past its command buffer, and a chained INDIRECT_BUFFER or
REWIND inside a range throw.

agc_driver_pm4 and agc_driver_flip cover the skips and the rejections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:11 +02:00
Celegans12 5e851fbb26 feat(agc): implement the interpolant mapping variant for high-half f16 inputs
PPSA26344 imports libSceAgc NID dbOlWdppb4o, whose name is unknown,
and calls it with the (regs, gs, ps) arguments of
sceAgcCreateInterpolantMapping to fill the 32 SPI_PS_INPUT_CNTL
registers. It is exported as sceAgcUnknownCreateInterpolantMapping.
It differs from sceAgcCreateInterpolantMapping only for inputs that
carry the high f16 half alone (is_f16 2): these take the default bit
and DEFAULT_VAL from the high half, as KytyPS5 does.

Both exports share validation and the register loop. More than 32
pixel shader inputs now throw; before, they were written past the
32-register block. agc_interpolant_mapping covers both exports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:09 +02:00
Celegans12 73c68c04bd feat(agc): implement image atomics on 32_SINT and 32_FLOAT surfaces
The resource materializer refused every atomic image descriptor whose
format was not 32_UINT. RDNA2 image atomics act on the raw dword and
the numeric format only affects addressing, so 32_SINT and 32_FLOAT
surfaces are now accepted with the Uint numeric class and run through
the existing integer atomics and float compare-exchange loops. Other
formats still throw, and the message now names the format.

DescriptorBinding gains imageAtomic, carried through the shader disk
cache (format version 4) and the resource content key. The driver
binds those elements through a cached R32_UINT view of R32_SINT and
R32_SFLOAT storage images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:06 +02:00
Celegans12 51c98a3983 fix(agc): store sceAgcGetIsTrinityMode's flag through its out pointer
sceAgcGetIsTrinityMode takes a pointer to a one-byte flag; the only
known caller ignores the return value. The export took no argument and
never wrote the flag. That caller's flag is in zero-initialised .bss,
so this corrects the signature; it does not fix a visible failure.

The function now stores false, as sceKernelIsTrinityMode reports a base
PS5, returns 0 and throws on a null pointer, whose error code is
unknown. It moves from Unimplemented.cpp to Misc/src/Platform.cpp, and
the new agc_platform_tests ctest target covers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:03 +02:00
Celegans12 2eff3c8386 feat(agc): accept linear attribute clipping in PA_CL_CLIP_CNTL
DecodeState and the draw precheck rejected PA_CL_CLIP_CNTL bit 24
(DX_LINEAR_ATTR_CLIP_ENA), so every draw that sets it was skipped.
Vulkan requires clipped NoPerspective outputs to vary linearly in
framebuffer space, and RADV and radeonsi set this bit for every draw
they emit. With the bit set the console therefore clips the way the
host driver already does, and the pipeline needs no extra state.
Clip space, depth clamping and the viewport depth range decode as
with the bit clear. Every other unsupported bit still rejects the
draw, with or without bit 24.

TechnicalDebt records that a clear bit, which was already accepted,
gets the same clipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:50:57 +02:00
Nahuel Genchi 22dad020b0 docs: record the fused assumption of v_fma_legacy_f32 in TechnicalDebt 2026-10-05 10:34:45 -03:00
Dean af92452ff6
Merge pull request #631 from DotDebian/feat/npcppwebapi-intrusive-ptr
feat(libs): implement NpCppWebApi IntrusivePtr construction, copy, release and access
2026-10-06 02:33:43 +13:00