Commit Graph
14017 Commits
Author SHA1 Message Date
boykopovar 7831d57aed Merge pull request #277 from oneandonlydean/perf/agc-draw-input-reuse
perf(agc): reuse a draw's index and vertex copies while the guest bytes are unchanged
2026-10-02 22:33:32 +03:00
boykopovar f9e0b8ba69 Merge pull request #276 from oneandonlydean/perf/agc-draw-snapshot-reuse
perf(agc): reuse unchanged draw input snapshots across draws
2026-10-02 22:33:18 +03:00
boykopovar 55cea557ee Merge pull request #273 from RomainROCH/codex/fix-save-memory-growth
fix(savedata): preserve memory saves when growth reads fail
2026-10-02 22:32:56 +03:00
boykopovar 11814ad660 Merge pull request #349 from DotDebian/feat/sync-on-address
feat(libkernel): implement sceKernelSyncOnAddressWait and sceKernelSyncOnAddressWake
2026-10-02 22:31:45 +03:00
MichonandClaude Opus 5.5 df8c0f1a3a perf(agc): build the color target swizzle tables once per element size
ColorTargetLayout built its SW_64KB_R_X offset tables in every
constructor, and every draw constructs a layout per color target while
decoding and again while setting the target up. The tables depend only on
the element size; they are now built once per size under std::call_once
and the layout points into them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-02 21:27:43 +02:00
boykopovar 27edcac156 Merge pull request #261 from MichonGoddijn231849/fix/rect-list-per-vertex-parameters
fix(shader): rect lists take explicitly interpolated fragment parameters and refuse only custom ones
2026-10-02 22:23:14 +03:00
boykopovar 4503ec54af Merge pull request #260 from adriadam10/fix/vop3-compare-neg
fix(shader): accept neg on VOP3-encoded float compares
2026-10-02 22:22:18 +03:00
boykopovar 2af9dda269 Merge pull request #255 from adriadam10/feat/scalar-bit-count-ops
feat(shader): implement s_bcnt0_i32_b64, s_ff0_i32_b64, s_flbit_i32(_i64), s_quadmask_b32
2026-10-02 22:21:49 +03:00
boykopovar d399b4e04c Merge pull request #245 from RomainROCH/codex/fix-windows-directory-close
fix(libkernel): clear directory metadata on close
2026-10-02 22:21:30 +03:00
boykopovar 41cb304326 Merge pull request #244 from RomainROCH/codex/fix-save-replacement
fix(savedata): preserve existing saves on replace failure
2026-10-02 22:20:58 +03:00
boykopovar 74bdce6f04 Merge pull request #232 from MichonGoddijn231849/fix/guest-read-destination
fix(libkernel): read, pread, AIO and APR write into guest memory as host writes
2026-10-02 22:19:46 +03:00
boykopovar 7db340de2b Merge pull request #231 from MichonGoddijn231849/fix/guest-arena-reserve
fix(libc): reserve the guest arena at its fixed range around what Windows already placed in it
2026-10-02 22:15:26 +03:00
Dean Galvin b62d02c2af feat(avplayer): decode H.264 and AAC with FFmpeg
Replace the decoder-less AvPlayer with a player that demuxes MP4 sources
with FFmpeg (opened by path or through the title's file replacement),
decodes H.264 and AAC on their own threads, and hands out NV12 frames and
interleaved 16-bit PCM in buffers from the title's allocators, presented
on a media clock that audio drives when it is enabled.

Both libSceAvPlayer and libSceAvPlayer.native are built from the same
sources and link the shared ffmpeg target. The struct size checks stay,
next to the types in SceTypes.hpp. ChangeStream and GetStreamInfoEx are
implemented; Init without allocators, StartEx, SetAvailableBandwidth,
SetLogCallback and negative trick speeds succeed as before and are listed
in TechnicalDebt. HLS sources throw.

guest_avplayer plays an embedded 6 KB MP4 (H.264 plus two AAC tracks).
2026-10-03 08:10:55 +13:00
boykopovar 1cc9874ac1 Merge pull request #227 from adriadam10/feat/png-enc
feat(libScePngEnc): implement PNG encoding
2026-10-02 22:08:05 +03:00
boykopovar 4c7a9ea2b0 Merge pull request #226 from asimplestray/feat/shader-mimg-gather-sample
feat(shader): implement MIMG sample/gather flag variants
2026-10-02 22:07:36 +03:00
boykopovar 5572f6b143 Merge pull request #399 from boykopovar/fix/f16-nle-compare-lowering
fix(shader): lower f16 NLE comparisons through swapped unordered less…
2026-10-02 22:06:31 +03:00
boykopovar 0032decb6a ci(tests): run build tests three times 2026-10-02 22:02:20 +03:00
MichonandClaude Opus 5.5 85c8beea48 perf(agc): index the pending storage images by guest range
Every guest memory read checks the pending storage images for results it
must store first (FlushPending, overlappingPending and the overlap test of
shader resources), each by a scan of the whole registry, and each scan read
the thread-local `refreshing` once per image (an emutls call with MinGW).
The registry now keeps a sorted, merged index of the ranges its images
cover, rebuilt on the first query after a change: a query that overlaps
none of them returns without a scan. The scans read `refreshing` once.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-02 21:01:26 +02:00
boykopovar 329c007514 Merge pull request #402 from boykopovar/docs/build-and-manual-md
Docs/build and manual md
2026-10-02 21:59:32 +03:00
boykopovar 545b137097 docs(usage): add relinker usage md doc 2026-10-02 21:50:35 +03:00
Alberto RuizandClaude Opus 5.5 95c1b40e71 fix(savedata): reject invalid directory names in sceSaveDataDelete
sceSaveDataDelete appended the title's directory name to the save root
without any check and passed the result to std::filesystem::remove_all.
"../victim" removed a directory beside the save root, ".." the directory
holding the save root, and an empty name or "." every save. The name
now has to be terminated within its field, non-empty, not "." or "..",
and free of "/", "\" and ":", as sceSaveDataMount3 already requires;
otherwise the call returns SAVE_DATA_ERROR_PARAMETER and deletes nothing.

The native library gains its own CMakeLists.txt, with the same library
definition as the generic one, to register guest_savedata_delete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-02 20:41:43 +02:00
boykopovar ee6a4a00f4 docs(build): add prject build md instruction 2026-10-02 21:40:38 +03:00
MichonandClaude Opus 5.5 ccb6697109 perf(agc): keep the buffer pool's free slots by key and retain 4096
Take scanned every retained slot of its tier for one with the same size,
usage and memory properties, so the slot bound stayed at 512. With 512
slots GTA V's in-game builds overflowed the small tier: each draw evicted
and recreated buffers, and the submission thread spent most of its time
in the driver's allocation and free calls. The slots are now kept in
lists per key, oldest first: Take pops the newest of its key, eviction
takes the oldest front. The bound is 4096 slots per tier, held to a sixth
of maxMemoryAllocationCount.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-02 20:20:50 +02:00
boykopovar a80d1fd09b fix(shader): lower f16 NLE comparisons through swapped unordered less-than 2026-10-02 21:17:18 +03:00
DotDebianandClaude Opus 5.5 b4506a359c feat(shader): decode image_sample_d_cl_o
MIMG opcode 0x33 samples with explicit derivatives, an LOD clamp and a
texel offset. The three address flags already exist; only the opcode was
missing from the decoder table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 19:07:30 +02:00
DotDebianandClaude Opus 5.5 febf50447a fix(shader): let image samples clamp their LOD on devices with shaderResourceMinLod
The LOD clamp of an image sample looked for the MinLod capability in the
emitter's own requirement list, which nothing fills, so every sample with
a clamp failed to compile on every device. The check now reads the
capabilities of the target, and a sample that takes the MinLod operand
declares the capability in its module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 19:03:29 +02:00
DotDebianandClaude Opus 5.5 362ba8a1a6 feat(shader): implement the integer dot products
Decode and translate v_dot2_i32_i16, v_dot2_u32_u16, v_dot4_i32_i8,
v_dot4_u32_u8, v_dot8_i32_i4, v_dot8_u32_u4 (VOP3P 0x14-0x19) and
v_dot4c_i32_i8 (VOP2 0x0d).

Clamp, neg and the op_sel combinations whose behaviour is not
established throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 19:01:57 +02:00
DotDebianandClaude Opus 5.5 4a4a1eddc1 feat(shader): implement v_lerp_u8
Decode VOP3 0x14d and translate it as the per-byte average of S0 and S1,
rounded up where bit 0 of the matching S2 byte is set and truncated
otherwise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 18:57:06 +02:00
Nicolas Abosch 35b40b76c3 feat(audio3d): implement default open parameters 2026-10-02 13:54:01 -03:00
DotDebianandClaude Opus 5.5 92a378afc4 fix(tools): count the debug branches and s_ttracedata_imm as decoded shader instructions
SCbranchCdbg decodes SOPP 0x17-0x1a and STtracedata decodes 0x16 and 0x28,
so S_CBRANCH_CDBGSYS, S_CBRANCH_CDBGUSER, S_CBRANCH_CDBGSYS_OR_USER,
S_CBRANCH_CDBGSYS_AND_USER and S_TTRACEDATA_IMM were reported as missing
although the decoder handles them and existing tests cover them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 18:27:13 +02:00
DotDebianandClaude Opus 5.5 9f2319b46e feat(shader): implement v_sad_u8, v_sad_hi_u8, v_sad_u16 and v_msad_u8
Decode VOP3 0x15a, 0x15b, 0x15c and 0x171 and translate them as the
unsigned sum of absolute differences over the byte or word fields of
the first two sources, accumulated into the third. v_sad_hi_u8 shifts
the sum into the high half first, v_msad_u8 skips the fields whose
reference byte in the second source is zero.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 18:25:22 +02:00
DotDebianandClaude Opus 5.5 1817d83fec fix(libkernel): return -1 and set errno from the POSIX open, stat, unlink and rmdir
open, _open, stat, unlink and rmdir forwarded the result of their sceKernel
twin, so a failure returned 0x8002xxxx instead of -1 and errno was never set
to the guest error. They now return -1 with errno set to the code carried by
the sce error, and report a null pointer as EFAULT and an empty path as
ENOENT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 18:17:12 +02:00
DotDebianandClaude Opus 5.5 146795c9cb feat(shader): decode s_wakeup as a no-op
s_wakeup (SOPP 0x03) threw "unsupported SOPP opcode 3" in the decoder. It
pings the other waves of the thread group so they leave s_sleep early.
s_sleep already translates to nothing, so no wave is ever asleep and the
ping has nothing to wake: s_wakeup translates like s_sleep. It carries no
operand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 18:10:07 +02:00
DotDebianandClaude Opus 5.5 65eac4fdb6 feat(shader): implement s_get_waveid_in_workgroup
SMEM opcode 0x2a threw in the decoder. It carries only a scalar destination
and returns the index of the current wave in its workgroup. A compute
workgroup fills its waves in local invocation index order, the mapping the
compute prologue already uses for the tg_size wave id, so the result is the
local invocation index divided by the wave size. Other stages throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 18:08:46 +02:00
asimplestray 5d1a130902 test(shader): cover VOPC compare constants and ordered F16 2026-10-02 16:07:44 +00:00
asimplestray 20f12cc80e feat(shader): implement legacy float multiply-add ops 2026-10-02 16:04:44 +00:00
DotDebianandClaude Opus 5.5 f1be5b8ba5 fix(libkernel): report the thread's priority and affinity from scePthreadAttrGet
scePthreadAttrGet wrote priority 700 and left the affinity of the
destination untouched, whatever the thread was created with or set to
afterwards. It now reports the values the thread holds, as
pthread_attr_get_np already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 18:03:51 +02:00
asimplestray f6e689de2f feat(shader): implement MIMG sample/gather flag variants 2026-10-02 15:59:39 +00:00
MichonandClaude Opus 5.5 7b03d86bc5 fix(agc): a replaced device's unit shadows leave the registry
When the windowless device is replaced at the first present, its unit
shadows were published but stayed registered. Lookups take the shadow
whose import starts nearest below an address, so such a stale entry
could hide the live import's shadow. The write-back results it held then
looked absent, and an upload read the import's stale bytes instead.
The replaced device's shadows are now dropped once it is idle.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-02 17:57:04 +02:00
DotDebianandClaude Opus 5.5 d7d36193db test(shader): cover the operand-less decoding of v_nop, v_pipeflush and v_clrexcp
The VOP3 form of v_nop now decodes without operands, and no test looked at
it. agc_vop1_control_decode decodes the three instructions in VOP1 and VOP3
form and checks the opcode, the length, the null destination and the absence
of sources. agc_driver_vop1_control also runs v_nop in both forms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 17:50:53 +02:00
DotDebianandClaude Opus 5.5 de534fb927 feat(shader): implement the missing integer image atomics
Decode MIMG image_atomic_cmpswap, sub, smin, smax, inc and dec and
recompile them on the image texel pointer. sub, smin and smax map to
the SPIR-V atomic of the same name. cmpswap takes the new value from
VDATA[0] and the comparand from VDATA[1] (dmask 0x3) and returns the
previous value in VDATA[0]. inc and dec use the compare-exchange loop
of ds_inc/ds_dec, whose replacement helpers are now shared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 17:39:14 +02:00
DotDebianandClaude Opus 5.5 e8e5518c04 feat(shader): decode v_pipeflush and v_clrexcp as no-ops
v_pipeflush (VOP1 0x1b) and v_clrexcp (VOP1 0x41) threw in the decoder, as did
their VOP3 forms. SPIR-V has no ALU pipeline to flush, and the recompiler keeps
no exception flags for v_clrexcp to clear, so both translate like v_nop, which
emits nothing. Neither has operands: they decode with a null destination and no
sources. The VOP3 form of v_nop decoded a destination and a source it does not
have and now takes the same path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 17:23:09 +02:00
DotDebianandClaude Opus 5.5 bd75a89ef4 feat(shader): implement the VOPC f64 compares
Decode v_cmp_*_f64, v_cmpx_*_f64 and v_cmp(x)_class_f64 in their VOPC and VOP3 encodings and translate them as exact IEEE-754 compares on the 64-bit pattern with the existing 64-bit integer IR, so no Float64 capability is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 17:16:32 +02:00
DotDebianandClaude Opus 5.5 b279848c12 feat(libkernel): implement the pthread_barrierattr functions
pthread_barrier_init threw for any non-null attributes object, and no
function could create one. Add pthread_barrierattr_init, _destroy,
_getpshared and _setpshared after FreeBSD libthr, and let
pthread_barrier_init take the object.

PTHREAD_PROCESS_SHARED still throws in pthread_barrierattr_setpshared:
FreeBSD 9.0 rejects it and 11.0 accepts it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 17:08:07 +02:00
DotDebianandClaude Opus 5.5 5046aebc29 fix(tools): count the tested s_cmpk variants
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 17:06:50 +02:00
DotDebianandClaude Opus 5.5 6e17a6be7f test(shader): cover the s_cmpk compares
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 17:06:50 +02:00
Nicolas Abosch 65e59966bc feat(libSceIme): implement parameter initialization and panel size queries 2026-10-02 12:03:34 -03:00
boykopovar 313de1c5a3 Merge pull request #289 from SP4C3B4R-8/feat/missing-exports
feat(libs): declare missing AudioPropagation, AudioIn, NpSessionSignaling and dialog exports
2026-10-02 16:51:14 +03:00
DotDebian ba512363b1 feat(libkernel): implement sceKernelSyncOnAddressWait and sceKernelSyncOnAddressWake
sceKernelSyncOnAddressWait parks the calling thread while the 32-bit word
at the address still holds the expected value, until
sceKernelSyncOnAddressWake releases it or the timeout expires.
sceKernelSyncOnAddressWake releases up to the requested number of threads
parked on the address, in arrival order.

The libc.prx bundled with SDK 9 titles imports both for its once
primitive, so those titles stopped at load with an unresolved import.

# Conflicts:
#	docs/dev/TechnicalDebt.md
2026-10-02 16:49:44 +03:00
boykopovar a4157bbeee Merge pull request #355 from DotDebian/feat/map-named-flexible-memory-internal
feat(libkernel): implement sceKernelMapNamedFlexibleMemoryInternal
2026-10-02 16:45:58 +03:00