Commit Graph

58 Commits

Author SHA1 Message Date
Dean d5cf8a0add
Merge pull request #558 from Phi1ow/implement-error-dialog
feat(errordialog): implement the libSceErrorDialog state machine
2026-10-05 12:48:20 +13:00
Dean 221ea3c0bd
Merge pull request #535 from DotDebian/feat/audioout-set-mix-level-pad-spk
feat(libSceAudioOut): implement sceAudioOutSetMixLevelPadSpk
2026-10-05 12:47:38 +13:00
Dean f83ee125ce
Merge pull request #516 from Pouare514/fix/tlou-rtc
fix(libs): TLOU sceRtcParseDateTime ISO 8601 subset parser
2026-10-05 12:46:14 +13:00
Pouare514 e67d50cb2f fix(libs): route DateTime zone suffix through RFC3339 path, throw on unverified shapes 2026-10-05 01:10:25 +02:00
DotDebian 9a652bf82c docs(libSceAudioOut): record the pad speaker mix level as an assumed gain
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 00:55:11 +02:00
Dean 1bc945c1e5
Merge pull request #489 from oneandonlydean/feat/audiopropagation-source-render
feat(libSceAudioPropagation): render silence for propagated sources
2026-10-05 11:44:05 +13:00
Dean d1b8565d74
Merge pull request #482 from ThisIsAkill/feat/audiopropagation-no-propagation
feat(libSceAudioPropagation): implement the no-acoustic-propagation path with recovered signatures
2026-10-05 11:43:24 +13:00
Dean b44b308c53
Merge pull request #333 from adriadam10/feat/sopk-misc
feat(shader): implement s_cmovk_i32, s_version and s_setreg_imm32_b32
2026-10-05 11:41:47 +13:00
Phi1ow 6571ace5bd feat(errordialog): log the error code and record the silent stub
Adds the dialog to the silent-stubs list in docs/dev/TechnicalDebt.md, since it finishes without
showing anything. sceErrorDialogOpen now logs the error code and user id from the parameter
(offsets 4 and 8), like libSceMsgDialog logs its message, so an error a title would have shown
the player stays visible instead of disappearing.
2026-10-05 00:32:13 +02: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
DotDebian 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 <noreply@anthropic.com>
2026-10-04 18:10:16 +02:00
DotDebian 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 <noreply@anthropic.com>
2026-10-04 17:51:25 +02:00
Pouare514 af20824af4 fix(libs): TLOU sceRtcParseDateTime ISO 8601 subset parser 2026-10-04 16:30:14 +02:00
Pacuka 3e5648dcf7 fix(ajm): refuse Opus rates other than 48 kHz and record the parameter layout as unknown
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 14:28:19 +02:00
Adrià Franch 6ea9750bf3 refactor(shader): read f64 operands through readF64Bits and record the v_fma_f64 subnormal gap
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:52:14 +02:00
Adrià Franch eff7af93d4 fix(shader): translate s_setreg_imm32_b32 only for round to nearest even in MODE
Any other field or value throws. The existing s_setreg_b32 no-op is
recorded under Functional technical debt instead of silent stubs.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:28:52 +02:00
Adrià Franch f994cc6ab7 feat(shader): implement s_cmovk_i32, s_version and s_setreg_imm32_b32
s_cmovk_i32 writes the sign-extended 16-bit immediate when SCC is set.
s_version is a no-op marker. s_setreg_imm32_b32 takes its value from a
literal dword and is ignored like s_setreg_b32; both are now listed as
silent stubs in TechnicalDebt.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:26:58 +02:00
Dean Galvin be3f06bfe8 feat(libSceAudioPropagation): render silence for propagated sources
sceAudioPropagationSourceRender takes the system, an array of RenderInfo
descriptors and their count: PPSA21564 and PPSA21567 pass one RenderInfo
{0x010107d6, 0x30} per call, with the source handle at +0x10, its output
buffer at +0x18, the buffer size in bytes at +0x20 and the word 2 at
+0x28, once per audio grain for each propagated source.

Without acoustic propagation a source contributes nothing, so each
output buffer is zeroed for its size. Every RenderInfo is checked first
(descriptor, a live source of this system, a non-empty output), and a
count of 0 or a format word other than 2 throws, as neither has been
observed.
2026-10-04 19:26:06 +13:00
Adrià Franch d43a5487ca docs: SHA-256 memory operands now relink except RIP-relative ones
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-04 08:22:02 +02:00
QDarkRex 9642d1b3b0 fix(relinker): add icons to generated Windows executables 2026-10-04 10:29:20 +07:00
Dean Galvin 097566d547 fix(relinker): lower VRSQRTPS and VRCPPS to correctly rounded results for --to-intel
RSQRTPS and RCPPS are approximations whose low bits differ between Intel
and AMD. Intel returns 0x3F7FF000 for 1/sqrt(1.0), and two Newton-Raphson
steps on it settle on 0.99999994 instead of 1.0. PPSA21564 renormalises
its spring quaternions that way: an identity quaternion keeps w at
0.99999994 with a zero axis, its axis-angle conversion then normalises the
zero axis into NaNs, and the NaN bone poses reach keyframed physics bodies.
A NaN body later moves to an invalid broadphase cell and the game crashes
a few seconds into its hub level.

--to-intel now replaces the VEX.128 register forms with an out-of-line stub
that computes 1/sqrt(x) with SQRTPS and DIVPS (1/x with DIVPS), keeping
the upper half of the destination cleared and the scratch register intact.
A site with no room for the jump, including one followed by a branch
target or a RIP-relative instruction, keeps the native instruction and is
reported as kept instead of failing the relink.
2026-10-04 14:40:16 +13:00
Dean 40a9e455ea
Merge pull request #430 from adriadam10/feat/relinker-sha1-lowering
feat(relinker): lower SHA-1 instructions for --to-intel
2026-10-04 14:14:08 +13:00
Akhil Moola ac66e70882 feat(libSceAudioPropagation): implement the no-acoustic-propagation path with recovered signatures
The 22 exports used by PPSA21567 take the call shapes recovered from its
call sites (#481): destroys take the system and the object, attribute
setters take a count, SourceCreate takes only an output handle,
UnregisterMaterial only the material.

The system lives in the title's CPU memory (16-byte header, no GPU memory)
and its handle is that address; rooms, portals, sources and materials are
counter handles. Attributes are validated and have no effect; no rays are
requested and sources report no audio paths. Non-empty ray results, path
calculation and audio paths throw, SourceRender stays unimplemented, and
invalid input throws because no error code is known. Objects left when
their system is destroyed become unusable; their later destroy or
unregister is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:28:36 -06:00
Alexey e1bfb3973f
Merge pull request #364 from DotDebian/feat/pthread-barrierattr
feat(libkernel): implement the pthread_barrierattr functions
2026-10-03 11:01:01 +03:00
Alexey 29a8d01c83
Merge pull request #297 from oneandonlydean/fix/videoout-open-param-service-thread
fix(videoout): read the open param as the service thread's priority and affinity
2026-10-03 09:46:25 +03:00
Adrià Franch 71ca3ff4b8 feat(relinker): lower SHA-1 instructions for --to-intel
SHA1RNDS4, SHA1NEXTE, SHA1MSG1 and SHA1MSG2 passed through --to-intel
unchanged, so a relinked title that executes them faults on Intel CPUs
without SHA-NI. Their register forms are now lowered out of line with
SSE2 only through the shared stub builder; short sites share stubs via
MatchSequence. Memory forms fail the relink with the file offset, as for
SHA-256.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-03 07:40:41 +02:00
boykopovar d098840dbc
Merge pull request #307 from oneandonlydean/feat/avplayer-ffmpeg
feat(avplayer): decode H.264 and AAC with FFmpeg
2026-10-02 23:07:49 +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
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
DotDebian 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 <noreply@anthropic.com>
2026-10-02 17:08:07 +02: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
DotDebian 74fcea27f8 feat(libkernel): implement sceKernelMapNamedFlexibleMemoryInternal
libkernel did not export sceKernelMapNamedFlexibleMemoryInternal, which
the libc bundled with SDK 9 titles imports. It now forwards to
sceKernelMapNamedFlexibleMemory: the mapping counts against the flexible
budget, gets the range name and is released by sceKernelMunmap. Older
libc builds call the public function at the same sites with the same
arguments and result handling.

The known callers pass flag 0x8000, whose meaning is unknown. It is
still rejected as an unsupported mapping flag and is recorded in
TechnicalDebt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 14:08:58 +02:00
Dean Galvin 151fec7fd6 fix(videoout): read the open param as the service thread's priority and affinity
and throws for any non-zero word after it. Its layout matches shadPS4's
ServiceThreadParams instead: an unknown first word (16), a set-priority flag
and a priority (256..767), a set-affinity flag and a 64-bit CPU mask at
offset 16. PPSA21564 passes 16, 1, 0x100, 1 and 0x1FFF, so it stops at
startup on main.

sceVideoOutOpen now validates each field and reads the mask only when its
flag is set, so a 16-byte param with both flags clear still works. The
priority and affinity are not applied, since the present and vblank threads
are host threads; this and the unknown first word are listed in the
technical debt.
2026-10-02 21:05:25 +13:00
Adrià Franch 58f90eea9d feat(libScePngEnc): implement PNG encoding
scePngEncQueryMemorySize, scePngEncCreate, scePngEncEncode and
scePngEncDelete encode R8G8B8A8 and B8G8R8A8 images with a pitch into
RGB or RGBA PNGs using the shared encoder in core/Decoder/Png.
Decoder::Png::Encode takes optional compression level and filter
options so the encode parameters are honoured.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-02 10:00:32 +02:00
Adrià Franch 569c2ec56c feat(libSceAudiodec): decode MP3, M4AAC and ATRAC9
All six exports are implemented: MP3 and AAC (ADTS or raw blocks) are
decoded with the bundled FFmpeg and ATRAC9 with LibAtrac9, one unit per
call, into interleaved S16 or float PCM, with the libSceAudiodec
validation and error codes. libSceAudiodec.native is built from the same
sources.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-02 09:22:59 +02:00
SP4C3B4R-8 d56ce19531 docs: record unknown NIDs of the newly declared exports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 23:44:31 +02:00
Michon 04691c0797 feat(libs): offline services GTA V reaches in Story Mode
Sign-in, web browser and player dialogs finish cancelled; the message dialog finishes at once;
NpAuth, entitlement consumption, reachability, account age and the NpUtility bandwidth test
report signed out; sceKernelMtypeprotect changes the protection (the memory type has no host
equivalent); the APR ForEach resolvers resolve every path and report each failure in its own
result entry. vswprintf's stub is dropped in favor of the existing wide-formatter
implementation, which already covers it on every platform.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-01 23:21:54 +02:00
boykopovar e0f7866205
Merge pull request #223 from adriadam10/feat/http2-ssl-stubs
feat(libSceSsl): implement CA certificate queries and sceHttp2AbortRequest
2026-10-01 21:52:19 +03:00
boykopovar 0567aca352
Merge pull request #225 from adriadam10/feat/keyboard-key2char
feat(libSceKeyboard): implement the keyboard library
2026-10-01 21:50:25 +03:00
boykopovar 1ffaa66173
Merge pull request #215 from julienlgy/feat/lib-sce-hmd-stub
feat(libSceHmd): add a disconnected-headset HLE stub
2026-10-01 21:28:09 +03:00
Adrià Franch 63501b6d73 feat(libSceKeyboard): implement the keyboard library
Keyboard input follows libSceMouse: the video out event loop forwards SDL
key and focus events, whose scancodes are USB HID usages, and the library
keeps the pressed keys, modifiers and lock LEDs in a 16-entry history for
sceKeyboardRead and a snapshot for sceKeyboardReadState.
sceKeyboardGetKey2Char translates the 101-key arrangement; the 106-key
one throws and is listed as technical debt.

KeyboardData holds 16 key codes (96 bytes), not 6.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-01 19:00:23 +02:00
Adrià Franch c548cd25b7 feat(libSceSsl): implement CA certificate queries and sceHttp2AbortRequest
sceSslGetCaCerts reports that no CA certificates are available and
sceSslFreeCaCerts clears the structure, in line with the library's
no-network behaviour. sceHttp2AbortRequest succeeds like
sceHttpAbortRequest. sceSslClose and sceSslGetSerialNumber keep throwing
and are listed as unknown signatures.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-01 18:35:02 +02:00
julienlgy 0c4dace39e feat(libSceHmd): add a disconnected-headset HLE stub 2026-10-01 14:18:10 +02:00
ljkx d54dfb1595 fix(relinker): ignore a REX prefix that is followed by another prefix
In 64-bit mode a REX prefix only takes effect when it immediately
precedes the opcode; a REX followed by a legacy prefix or another REX is
ignored. The instruction decoder, the rewriter's reference classifier,
DecodedInstruction and the SSE4a, SHA-256 and CLZERO operand decoders
read legacy prefixes and then at most one REX. `48 F3 0F 2B 00`
(MOVNTSS) was therefore scanned as `[48 F3][0F 2B 00]` and kept, and
`48 67 0F 01 FC` lost its address-size prefix.

All of them now accept REX bytes among the prefixes and keep only one
that directly precedes the opcode. The converter's guard against
prefix-only fragments is removed, since the decoder no longer produces
them, and the TechnicalDebt entry describing the split is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 13:09:11 +02:00
ljkx 09cb86b076 feat(relinker): lower CLZERO for --to-intel
Lower CLZERO out of line instead of failing the relink: the 64-byte line
containing rAX (EAX with 67h) is cleared with four MOVNTDQ stores of
zero, the same non-temporal, weakly ordered store. The line address is
masked in xmm0 so RFLAGS stays untouched; xmm0 and rcx are spilled below
the red zone. Short sites share stubs through MatchSequence. CLZERO with
LOCK, an FS/GS override, a 66/F2/F3 prefix or longer than 15 bytes fails
the relink.

The decoder splits a REX followed by another prefix into a separate
instruction, which would hide a prefix that changes what CLZERO or the
next instruction does. The converter now fails the relink when such a
prefix-only fragment directly precedes an AMD-only instruction or would
be moved into a stub as a trailing instruction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 12:30:35 +02:00
ljkx f994b4f89f feat(relinker): lower MONITORX and MWAITX for --to-intel
Replace MONITORX with a NOP and MWAITX with PAUSE in place, padded with
NOPs to the original length, instead of failing the relink. MWAITX may
return before its timer or a store to the monitored line, and without an
armed monitor it does not wait, so callers already re-check their
condition; the replacement takes that path every time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 10:35:23 +02:00
ljkx e66b0b34d7 feat(relinker): lower SHA-256 instructions for --to-intel
Lower SHA256RNDS2, SHA256MSG1 and SHA256MSG2 (register forms) out of line
with legacy SSE2 instructions only, so relinked code no longer needs
SHA-NI. Consecutive short SHA-256 and SSE4a sites share one stub. The
SSE4a stub builder moves to StubBodyBuilder for reuse; IsShaNi now also
recognises SHA256RNDS2 (0F 38 CB). Memory operand forms fail the relink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 00:20:43 +02:00
boykopovar c71be475fc
Merge pull request #187 from MichonGoddijn231849/feat/demons-souls-exports
feat: export the AMPR command buffer waits and writes, sceAgcFuseShaderHalves, sceAgcSetSubmitMode, sceNpSessionSignalingCreateContext and sceNetEpollAbort
2026-09-30 22:03:54 +03:00