Commit Graph
14017 Commits
Author SHA1 Message Date
Dean 3403c80595 Merge pull request #543 from adriadam10/test/lds-ops
test(shader): execute the untested LDS reads, writes and integer atomics against values measured on RDNA
2026-10-05 10:23:33 +13:00
Dean c4162e306c Merge pull request #540 from DotDebian/feat/agc-acb-dma-data-size
feat(agc): implement sceAgcAcbDmaDataGetSize
2026-10-05 10:23:18 +13:00
Dean c457e756a5 Merge pull request #538 from DotDebian/feat/ampr-command-buffer-markers
feat(ampr): implement the command buffer markers
2026-10-05 10:23:03 +13:00
Dean 6a705bc4bd Merge pull request #536 from DotDebian/feat/font-get-resolution-dpi
feat(font): implement sceFontGetResolutionDpi
2026-10-05 10:22:47 +13:00
Dean 0f15a6c515 Merge pull request #539 from adriadam10/test/vopc-compare-table
test(shader): execute every non-f64 VOPC compare against values measured on RDNA
2026-10-05 10:21:52 +13:00
Dean 58911bf169 Merge pull request #517 from Pouare514/fix/tlou-sessionsignaling
fix(libs): TLOU runtime funcs for SessionSignaling
2026-10-05 10:21:30 +13:00
Phi1ow 1cd34c232d feat(pad): implement scePadSetAngularVelocityDeadbandState
scePadSetAngularVelocityDeadbandState was the last throwing stub in libScePad. It toggles a
dead-band filter on the controller's angular-velocity (gyro) readings; the reading path does
not apply that optional filter, so the call succeeds and does nothing, as it does in shadPS4.

Extends the existing guest_pad test with the two enable/disable calls. It fails on main (the
stub throws) and passes with the change.
2026-10-04 23:19:37 +02:00
Dean 55e915abdb Merge pull request #527 from DotDebian/test/vop3-carry-out-add-sub
test(shader): cover the VOP3 carry-out add and subtracts and count v_sub_co_u32 as decoded
2026-10-05 10:15:36 +13:00
Dean 23f20ebc40 Merge pull request #156 from Pacuka/fix/pthread-mutex-types
fix(libkernel): default mutexes to error checking and add the adaptive type
2026-10-05 10:15:22 +13:00
Phi1ow ce6b26fadb feat(razor): implement the libSceRazorCpu CPU profiler stubs
libSceRazorCpu is the CPU-side instrumentation for the Razor capture tool. AnyPS5 does not host
that tool, so the instrumentation does nothing and succeeds, which is also what shadPS4 does:

- sceRazorCpuIsCapturing -> 0 (no capture is in progress, so titles skip their profiling paths)
- sceRazorCpuJobManagerDispatch / sceRazorCpuJobManagerJob / sceRazorCpuJobManagerSequence -> 0

These only feed the profiler; they do not affect execution. Adds a CMakeLists.txt so the library
can carry its guest test.

New test core/libs/tests/GuestRazorCpu.cpp checks the four return values; it fails on main (the
functions throw) and passes with the change.
2026-10-04 23:12:52 +02:00
Dean 76c34275b4 Merge pull request #347 from Pouare514/fix/kernel-nooverwrite-win
fix(libkernel): support NoOverwrite mappings on Windows
2026-10-05 10:11:34 +13:00
Dean ef3906eeeb Merge pull request #302 from Pouare514/fix/tlou-runtime-funcs
fix(libs): TLOU runtime funcs for Net (getpeername, htonll/ntohll)
2026-10-05 10:11:21 +13:00
Dean 9506815f98 Merge pull request #468 from Pacuka/feat/ajm-opus
feat(ajm): decode Opus (codec 24) through FFmpeg
2026-10-05 10:11:08 +13:00
Dean 61cb722a25 Merge pull request #502 from adriadam10/fix/vop3p-pk-mad-clamp
fix(shader): VOP3P integer clamp on v_pk_mad/add/sub_{i16,u16}
2026-10-05 10:10:54 +13:00
Dean 6842123d01 Merge pull request #530 from DotDebian/feat/global-load-dword-addtid
feat(shader): implement global_load_dword_addtid
2026-10-05 10:10:42 +13:00
Dean 03243c7e12 Merge pull request #529 from DotDebian/fix/shader-decode-past-endpgm
fix(shader): keep decoding past an s_endpgm while a branch targets later code
2026-10-05 10:10:29 +13:00
Dean 8b9ba8c510 Merge pull request #520 from DotDebian/test/vop2-fused-multiply-add
test(shader): cover v_fmac_f32, v_fmamk_f32 and v_fmaak_f32 and count them as decoded
2026-10-05 10:10:16 +13:00
Dean 412665dfdb Merge pull request #512 from QDarkRex/fix/relinker-tls-diagnostics
fix(relinker): identify unsupported Windows TLS instructions
2026-10-05 10:10:03 +13:00
Adrià FranchandClaude d1f77107bc feat(shader): implement image_atomic_fmin, fmax and fcmpswap
The three MIMG float atomics threw as unknown opcodes. They now run as a
compare-and-swap loop on the 32-bit texel with the bit-level rules the
float buffer atomics already use (NaN, signed zero and sNaN quieting as
measured on RDNA2), so no float atomic feature is needed from the driver.

Co-Authored-By: Claude <[email protected]>
2026-10-04 23:01:27 +02:00
Adrià FranchandClaude e9cdd9b0f3 feat(shader): implement the float and 64-bit inc/dec buffer atomics
buffer_atomic_fcmpswap, fcmpswap_x2, fmin_x2, fmax_x2, inc_x2 and
dec_x2 are compare-and-swap loops on the dword or qword. fcmpswap
compares as floats (-0 equals +0, NaN equals nothing) and fmin/fmax are
IEEE minNum/maxNum with -0 < +0, a quieted result for a signalling NaN
and the other operand for a quiet one, all with integer ops so the
driver's float controls do not matter. The existing 32-bit fmin/fmax
kept the old value whenever a NaN or two zeros were involved; it now
uses the same rule.

Co-Authored-By: Claude <[email protected]>
2026-10-04 22:56:09 +02:00
Adrià FranchandClaude e8e75a8bc5 feat(shader): implement buffer_atomic_inc/dec and the 64-bit integer buffer atomics
buffer_atomic_inc, buffer_atomic_dec, buffer_atomic_cmpswap_x2 and
buffer_atomic_{add,sub,smin,umin,smax,umax,and,xor}_x2 threw in the decoder.
The 64-bit ones use native 64-bit SPIR-V atomics like the existing
swap_x2/or_x2; inc and dec wrap at the data operand through the existing
compare-exchange helpers.

Co-Authored-By: Claude <[email protected]>
2026-10-04 22:56:09 +02:00
Adrià FranchandClaude 6dd5a61541 feat(shader): accept the dlc cache bit on MIMG
Co-Authored-By: Claude <[email protected]>
2026-10-04 22:54:05 +02:00
Adrià FranchandClaude ef84d7bfa7 feat(shader): implement image_store_pck and image_store_mip_pck
Write the raw texel bits: dmask bit i selects texel dword i, taken from the
next data register, and every other dword of the texel is written as 0; the
descriptor swizzle is ignored (measured on RDNA2 hardware). Only formats whose
bits go through the storage view unchanged are accepted (unsigned integer
components, raw 32-bit signed integer and 32-bit float); normalized, 16-bit
float, narrow signed and 96-bit formats throw.

Co-Authored-By: Claude <[email protected]>
2026-10-04 22:46:58 +02:00
Adrià FranchandClaude bb24017c45 test(shader): execute the untested LDS reads, writes and integer atomics against values measured on RDNA
Co-Authored-By: Claude <[email protected]>
2026-10-04 22:35:58 +02:00
Adrià FranchandClaude b02c80254e fix(shader): v_cvt_rpi/flr_i32_f32 NaN and exact round-half-up
Co-Authored-By: Claude <[email protected]>
2026-10-04 22:35:56 +02:00
Adrià FranchandClaude cebc1e8289 fix(shader): DPP16 operands of v_pk_fmac_f16 and the relative moves
v_pk_fmac_f16 read its accumulator through the permuted destination and
wrote without the DPP write mask. v_movrels/movrelsd/movrelsd_2 dropped
the source permute, and the relative writes dropped the DPP write mask.

Co-Authored-By: Claude <[email protected]>
2026-10-04 22:35:51 +02:00
Adrià FranchandClaude 03760d937b fix(shader): s_lshlN_add SCC and s_bfe_[iu]32 fields past bit 31
s_lshl1..4_add_u32 never wrote SCC; hardware sets it when the shifted-out
bits or the add carry are non-zero. s_bfe_i32/u32 went through
OpBitField{S,U}Extract, which RADV gets wrong when the width runs past
bit 31; build the field from shifts instead.

Adds an execution test for 38 SOP2 opcodes with hardware-captured results.

Co-Authored-By: Claude <[email protected]>
2026-10-04 22:35:45 +02:00
Adrià FranchandClaude 4939e5d105 fix(tools): count v_fma_mix_f32 as a decoded shader instruction
Co-Authored-By: Claude <[email protected]>
2026-10-04 22:35:39 +02:00
Phi1ow 7854fb6bff feat(errordialog): implement the libSceErrorDialog state machine
The six libSceErrorDialog exports were throwing stubs. They now implement the dialog's
NONE -> INITIALIZED -> RUNNING -> FINISHED state machine without a visible window, so a title
that opens an error dialog and waits for it never blocks:

- sceErrorDialogInitialize -> INITIALIZED, or 0x80ED0002 if already initialized
- sceErrorDialogOpen -> checks the state and the 16-byte parameter, then RUNNING
- sceErrorDialogUpdateStatus -> turns RUNNING into FINISHED and returns the status
- sceErrorDialogGetStatus -> returns the status
- sceErrorDialogClose -> FINISHED, or 0x80ED0005 when no dialog is running
- sceErrorDialogTerminate -> NONE, or 0x80ED0001 when not initialized

Re-opening is allowed once a previous dialog has finished. The status values and error codes
are the documented SCE error-dialog ones. Adds a CMakeLists.txt so the library can carry its
guest test.

New test core/libs/tests/GuestErrorDialog.cpp drives the whole state machine (the
not-initialized and already-initialized errors, the state and parameter checks of open,
open/update/close and re-open after finish). It fails on main (the stubs throw) and passes
with the change.
2026-10-04 22:33:43 +02:00
Adrià FranchandClaude e2ac1a6690 feat(shader): implement image_load_pck and image_load_mip_pck with signed variants
Return the raw texel bits: dmask bit i selects texel dword i, dwords past the
texel read 0 and the _sgn forms sign-extend texels narrower than 32 bits
(measured on RDNA2 hardware). Only formats whose bits are exactly recoverable
from the sampled view are accepted (unsigned/signed integer, unorm up to 16
bits, 32-bit float components), on a direct sampled image with identity
swizzle; anything else throws.

Co-Authored-By: Claude <[email protected]>
2026-10-04 22:32:13 +02:00
Phi1ow be59a9e7e9 feat(http): implement sceHttpCreateRequest2, sceHttpsEnableOption, sceHttpsLoadCert and sceHttpGetLastErrno
Four more libSceHttp exports, following the library's existing "no network emulated" model:

- sceHttpCreateRequest2 -> a new handle, like sceHttpCreateRequestWithURL2
- sceHttpsEnableOption -> 0, the counterpart of the existing sceHttpsDisableOption
- sceHttpsLoadCert -> 0 (certificates are accepted and ignored; no TLS is performed)
- sceHttpGetLastErrno -> 0 (no request reaches the network, so no errno is recorded); a
  null output pointer returns ERROR_INVALID_VALUE, like the other getters in this file

Signatures follow the public OpenOrbis SDK headers. GuestHttp is extended to cover the four
functions; the new assertions fail without the change (the symbols are undefined).
2026-10-04 22:04:13 +02:00
Phi1ow 75c2ea8548 feat(sysmodule): implement sceSysmoduleLoadModuleInternal and sceSysmoduleUnloadModuleInternal
Two exports were missing. System modules are linked statically, so load and unload are
reference counts over the known module table, exactly like the existing
sceSysmoduleLoadModuleInternalWithArg and sceSysmoduleUnloadModule:

- sceSysmoduleLoadModuleInternal(uint32_t) -> increments the module's load count, returns 0
- sceSysmoduleUnloadModuleInternal(uint32_t) -> decrements it, or 0x80A90003 when the module
  was not loaded

Unknown or zero ids throw, like the sibling internal loader. Adds a CMakeLists.txt so the
library can carry its guest test. Signatures follow the public OpenOrbis SDK headers.

New test core/libs/tests/GuestSysmodule.cpp loads a module twice, unloads it twice and checks
the not-loaded error on a third unload; it fails without the change (the symbols are
undefined) and passes with it.
2026-10-04 21:56:29 +02:00
Pouare514 89cd75e15f fix(libkernel): idempotent fixed virtual reservation over registered range 2026-10-04 21:02:15 +02:00
PacukaandClaude Opus 5.5 a48a9eabf7 fix(agc): keep the pixel register fallbacks to the null program and refuse its color writes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 20:57:01 +02:00
PacukaandClaude Opus 5.5 b90a913715 fix(agc): draw without a pixel program when SPI_SHADER_PGM_PS is unset
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 20:54:11 +02:00
Dean d7f0c49fdc Merge pull request #532 from adriadam10/fix/audio-in-pacing
fix(audioin): never return a no-device block before its deadline
2026-10-05 07:37:03 +13:00
Adrià FranchandClaude d4d045f73e test(shader): execute flat and global loads against hardware results
Co-Authored-By: Claude <[email protected]>
2026-10-04 19:09:54 +02:00
Adrià FranchandClaude bc12722698 fix(shader): convert unorm and snorm buffer format loads with correct rounding
Format loads divided by 2^b-1 with OpFDiv, which Vulkan only bounds to 2.5 ULP; RADV returns a
different f32 than the hardware for many 8- and 16-bit values. The quotient is now built on the
bits: v/(2^b-1) is v's b bits repeated, so the mantissa is the rotated value replicated and rounded
on the next bit (no ties). Adds an execution test of buffer_load_format_x..xyzw,
tbuffer_load_format_x/xy/xyz and buffer_store_format_x..xyzw against values measured on RDNA.

Co-Authored-By: Claude <[email protected]>
2026-10-04 18:49:49 +02:00
Adrià FranchandClaude e1a99077d1 test(shader): execute the untested buffer byte/short/dwordx2/x3 loads and stores and the 32-bit integer buffer atomics against values measured on RDNA
Co-Authored-By: Claude <[email protected]>
2026-10-04 18:37:45 +02:00
Pouare514 88320f1297 feat(tools): suggest real names for Unknown NID stubs from hash-verified DB 2026-10-04 18:23:08 +02:00
DotDebianandClaude Opus 5.5 d98bbcd5bb fix(libkernel): report invalid nanosleep requests through errno and the sce error codes
nanosleep and _nanosleep forwarded the result of sceKernelNanosleep, which
returned -1 for a rejected request: errno was never set, and the sce call
returned a value that is not an sce error. A request with negative seconds
was rejected as well, where FreeBSD's kern_nanosleep returns 0 without
sleeping.

nanosleep and _nanosleep now return -1 with errno set to EINVAL when tv_nsec
is outside [0, 1000000000) and to EFAULT for a null request;
sceKernelNanosleep returns the matching SCE_KERNEL_ERROR code. A request
with valid nanoseconds and negative seconds returns 0 at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 18:19:53 +02:00
DotDebianandClaude Opus 5.5 12d77169ab feat(agc): implement sceAgcAcbDmaDataGetSize
sceAgcAcbDmaData emits the 7-dword DMA_DATA packet through
Agc::Command::WriteDma, the writer sceAgcDcbDmaData shares, so its size
query returns the same 28 bytes instead of throwing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 18:12:38 +02:00
Adrià FranchandClaude dc878c9c5c test(shader): execute every non-f64 VOPC compare against values measured on RDNA
Co-Authored-By: Claude <[email protected]>
2026-10-04 18:12:35 +02:00
DotDebianandClaude Opus 5.5 638d3802ad feat(ampr): implement the command buffer markers
sceAmprCommandBufferPushMarker, PushMarkerWithColor, PopMarker, SetMarker
and SetMarkerWithColor record a marker command, and the matching
sceAmprMeasureCommandSize functions return its size. The APR executor
skips markers, as it does a nop.

Signatures follow the ampr_emu reimplementation of libSceAmpr.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 18:10:16 +02:00
DotDebianandClaude Opus 5.5 cd6c20f783 feat(font): implement sceFontGetResolutionDpi
Report the horizontal and vertical resolution kept in the font handle's
style block, as set when the font is opened (72 dpi) or by
sceFontSetResolutionDpi. Error handling follows the other handle getters:
an invalid handle or two null outputs fail and clear the outputs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:59:31 +02:00
DotDebianandClaude Opus 5.5 2452ffcb3f feat(libSceAudioOut): implement sceAudioOutSetMixLevelPadSpk
The mix level is a linear gain on the pad speaker port, 32768 being 0 dB.
A pad speaker port opens at 11626 (-9 dB). An unknown handle, a port of
another type and a level above 0 dB return the AudioOut error codes; a
negative level throws, as its effect is unknown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:51:25 +02:00
DotDebianandClaude Opus 5.5 46b5d5d8b0 feat(agc): implement the sceAgcBranchPatch setters
sceAgcBranchPatchSetCompareAddress, sceAgcBranchPatchSetThenTarget and
sceAgcBranchPatchSetElseTarget rewrite the compare address and the two
buffer targets of the packet sceAgcCbBranch emits. The then target is
the first buffer and the else target the second, as in AMD's
COND_INDIRECT_BUFFER packet. The cache policy bits are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:48:12 +02:00
Adrià FranchandClaude a32a593762 fix(audioin): never return a no-device block before its deadline
Co-Authored-By: Claude <[email protected]>
2026-10-04 17:27:50 +02:00
DotDebianandClaude Opus 5.5 f9625f2581 feat(libkernel): implement the pthread_rwlock try and timed lock functions
The POSIX layer only exported init, destroy, rdlock, wrlock and unlock.
pthread_rwlock_tryrdlock, pthread_rwlock_trywrlock,
pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock now wrap the
existing scePthreadRwlock functions and accept the static initializer.

The timed variants take an absolute CLOCK_REALTIME deadline. Like
FreeBSD libthr they try the lock first and only validate abstime when
the lock is not free. A null abstime throws, as pthread_mutex_timedlock
does.

scePthreadRwlockTryrdlock and scePthreadRwlockTrywrlock return EBUSY
when the caller already holds the write lock instead of calling into
std::shared_timed_mutex, where that is undefined behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:13:36 +02:00
DotDebianandClaude Opus 5.5 e2dd34f360 test(shader): cover the SOPK s_waitcnt counters and count them as decoded
The decoder maps SOPK opcodes 0x17 to 0x1a to SWaitcnt, but no test encoded them and tools/progress.py only counted S_WAITCNT_VSCNT. The test runs the four waits with a null and a live register field and checks that SCC and the register are left unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:13:18 +02:00