Commit Graph

6138 Commits

Author SHA1 Message Date
Qznad aad41aa907 feat(jpegenc): encode images through the shared JPEG encoder 2026-09-29 15:17:27 +01:00
Qznad 94c7319202 feat(decoder): add shared JPEG encoder and decoder in core/Decoder/Jpeg 2026-09-29 15:17:27 +01:00
Qznad aa56049fbf feat(jpegenc): validate sceJpegEncEncode arguments 2026-09-29 15:17:27 +01:00
Qznad 2829cf92f4 build(jpegenc): add stb as a submodule 2026-09-29 15:17:27 +01:00
Qznad 98a5228cf7 feat(jpegenc): implement sceJpegEncCreate and sceJpegEncDelete 2026-09-29 15:17:27 +01:00
Qznad 16290424b9 feat(jpegenc): implement sceJpegEncQueryMemorySize 2026-09-29 15:17:27 +01:00
Qznad 442082612c feat(jpegenc): add parameter structs and real function signatures 2026-09-29 15:17:27 +01:00
boykopovar 2021fa6c02
Merge pull request #145 from adriadam10/ci-dependabot
ci: keep GitHub Actions up to date with Dependabot
2026-09-29 16:12:38 +03:00
OverkillLabs 020579d4fd refactor(prx): drop the PNG encoder from this PR
Per maintainer feedback: PNG encode/decode belongs together in a
future core/Decoder/Png shared by the relinker (icon loading) and
PRX layer, not a one-off libScePngEnc-only encoder. Reverts
libScePngEnc/Export.cpp to the upstream stub and removes the vendored
stb_image_write.h dependency, leaving ConvertKeycode, VoiceChat and
the PlayGo chunk-id fix.
2026-09-29 14:12:42 +03:00
boykopovar 563a1749dd
Merge pull request #111 from oneandonlydean/fix/s-getpc-absolute
fix(shader): make s_getpc_b64 return the shader's absolute address
2026-09-29 13:11:55 +03:00
boykopovar 9edb1f9a95
Merge pull request #110 from oneandonlydean/fix/device-replacement-race
fix(agc): don't let a queue worker record on a device the presenter is replacing
2026-09-29 13:06:30 +03:00
Adrià Franch 2c5a8e2037 ci: keep GitHub Actions up to date with Dependabot
Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-29 10:12:03 +02:00
boykopovar c0755b9ec8
Merge pull request #102 from asimplestray/feat/kernel-aio
feat(kernel): implement Aio request lifecycle
2026-09-29 11:07:10 +03:00
boykopovar 9d6ba601c9
Merge pull request #100 from Digote/feat/shader-s-clause
feat(shader): support S_CLAUSE scheduling hints
2026-09-29 10:58:40 +03:00
boykopovar d841b8420a
Merge pull request #97 from SamG-Coder/codex/kernel-notifications
feat(kernel): deliver plain-text notifications to host output
2026-09-29 10:51:52 +03:00
boykopovar 4ed3199171
Merge pull request #84 from OverkillLabs/feat/pad-gamepad-haptics
feat(pad): motion sensors, rumble, adaptive triggers and light bar over SDL
2026-09-29 10:47:52 +03:00
boykopovar d998717588
Merge pull request #83 from OverkillLabs/feat/agc-shader-improvements
feat(agc,shader): remaining PM4 command-buffer opcodes and shader recompiler hardening
2026-09-29 10:35:36 +03:00
boykopovar 983109fe16
Merge pull request #81 from OverkillLabs/feat/kernel-libc-fixes
feat(libc,kernel): wide-char formatting, sub-tick waits, memory-pool querying, module loader wiring
2026-09-29 10:03:00 +03:00
boykopovar b03e59b8eb
Merge pull request #55 from oneandonlydean/perf/mspace-ordered-allocator
perf(libc): replace the mspace block list with an ordered allocator
2026-09-29 09:57:44 +03:00
OverkillLabs 56d061a350 style(prx): apply CONVENTIONS.md to misc PRX additions
Strip inline explanatory comments (comments are restricted to
technical-debt markers, #endif, and namespace-close trailers) from
HitLog.hpp, libSceConvertKeycode, libSceVoiceChat, libScePngEnc, and
the new hunk in libScePlayGo; add the missing #endif trailer comment
to HitLog.hpp's include guard. Rename the local helpers/params that
didn't match the naming convention: log_soft -> logSoft and
Readable -> readable (private free functions, camelCase), and
snake_case arguments (user_id, request_id, memory_address,
memory_size, output_info) to camelCase. NID export functions and
pre-existing upstream code (libScePlayGo's existing snake_case
parameters, PngEnc's vendored stb_image_write.h) are left untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 04:24:39 +03:00
OverkillLabs e532b19cee refactor(pad): trim comments and apply naming conventions
Bring the pad-gamepad-haptics diff in line with docs/dev/CONVENTIONS.md:
strip explanatory/rationale comments (struct layouts, algorithm notes,
rewired-NID rationale) down to code only, and rename the anonymous-
namespace helpers in PadState.cpp (Normalize/Fuse/EncodeZones/MaxOf/
ScaleStrength) to camelCase to match upstream's free-function style.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 04:24:39 +03:00
OverkillLabs 22b53e3f25 prx: implement scePlayGoGetInstallChunkId for real
Was a NotImplemented stub that returned an empty/undefined result.
For a package where every declared chunk is already local, the
installed-chunk set is identical to the full chunk set already
computed by ValidateChunks()/ValidChunks(), so this simply delegates
to the existing scePlayGoGetChunkId(). Driven by the title's own
playgo-chunkdefs.xml, not any hardcoded per-title chunk count.
2026-09-29 04:24:35 +03:00
OverkillLabs dc6baf629f prx: implement real libScePngEnc PNG encoder
Replaces the 4-stub placeholder with a working create/delete/encode
path backed by stb_image_write. The encode parameter block layout is
inferred by analogy with the decoder's and validated strictly
(dimensions, pitch, buffer sizes, readability of both the source and
destination buffers) before any pixel is touched; anything that does
not fit is rejected rather than guessed at. Handles RGBA and BGRA
source pixel formats.
2026-09-29 04:24:30 +03:00
OverkillLabs 08bec63e1d 3rdparty: vendor stb_image_write.h (public domain / MIT)
Single-header PNG/BMP/TGA/JPG writer from nothings/stb, needed by the
real libScePngEnc encoder implementation added next. Public domain or
MIT licensed, used header-only.
2026-09-29 04:24:25 +03:00
OverkillLabs 556a7fcfdb prx: add libSceVoiceChat offline-safe HLE stub
Init/terminate/handler/event exports are real no-ops. Session and
channel request exports return SCE_VOICE_CHAT error SIGNED_OUT, since
voice chat sessions cannot be established without a network backend.
Matches the offline-stub pattern already used by other online-service
PRX modules in this project.
2026-09-29 04:24:20 +03:00
OverkillLabs 2982aa6a2e prx: add libSceConvertKeycode HLE module
sceConvertKeycodeGetImeKeyboardType is implemented for real (reports
keyboard type 0 for a valid user id). sceConvertKeycodeGetVirtualKeycode
has an unconfirmed ABI, so it only logs its raw arguments and reports
failure rather than guessing a pointer layout.
2026-09-29 04:24:16 +03:00
OverkillLabs 55ed2719d5 refactor: apply naming conventions and drop extern-C comment
Renames template parameters to the TKey-style the conventions doc
requires (TValue, TFunction), removes the extern "C" close comment
(not one of the two allowed structural exceptions), and replaces
the magic error/flag numbers left after the previous comment
cleanup with the existing SCE_KERNEL_ERROR_* constants and a named
RTLD_NOW constant so the code documents itself.
2026-09-29 04:20:28 +03:00
OverkillLabs a1814def3b style: strip explanatory comments per CONVENTIONS.md
Comments in this codebase may only mark technical debt (human-added
only), the end of #endif, and the end of a namespace, per
docs/dev/CONVENTIONS.md. Remove the inline rationale comments added in
the AGC PM4 opcode and shader recompiler robustness commits; the code
itself, the commit history, and the PR description now carry that
context instead.

Notably, Command::WriteMemSemaphore takes the corrected 4-argument
form (address, waitForMailbox, signalType, operation): an earlier
revision of this helper used a different, incompatible argument
order. sceAgc*MemSemaphore callers derive waitForMailbox/signalType
from the low two bits of clientCode, and operation from action
(0 = signal, 1 = wait). This ABI note previously lived as an inline
comment; it is recorded here instead per the no-comments convention.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 04:20:09 +03:00
OverkillLabs d9f8d87c27 refactor: strip explanatory comments to match repo conventions
Comments in this codebase may only mark technical debt (per
docs/dev/CONVENTIONS.md), plus the #endif and namespace-close
structural exceptions. Removes the descriptive comments added on
this branch across PreciseWait.hpp, FormattingWide.cpp, the
direct-memory pool query/free-run plumbing, and the module loader
wiring, keeping the two allowed structural markers intact.
2026-09-29 04:18:04 +03:00
OverkillLabs 7dedb2e607 style(relinker): drop inline rationale comment per CONVENTIONS.md
The project's coding conventions restrict inline comments to
technical-debt markers, #endif, and namespace-close trailers. Remove
the explanatory comment on writeGotStub's DIR64 write; the same
rationale (why the slot must hold the preferred-VA form, and why the
base-relocation pass was moved after lazy-stub writes) is already
captured in the fix(relinker) commit message and PR description.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 04:16:05 +03:00
OverkillLabs 5387aef3b7 Merge remote-tracking branch 'origin/main' into feat/kernel-libc-fixes
# Conflicts:
#	core/libs/prx/libkernel/DirectMemory/DirectMemory.hpp
2026-09-29 04:13:58 +03:00
Dean Galvin 6c98b6be58 feat(systemservice): report the SDR tone-map luminance
sceSystemServiceGetHdrToneMapLuminance was NotImplemented. Titles read
it at startup to set up their HDR tone mapping.

The presenter always outputs through a B8G8R8A8 sRGB-nonlinear swapchain,
so the display range the title has to map into is SDR: the maximum and
full-frame maximum luminance are the 100 cd/m2 SDR reference white and
the minimum is 0. A null output pointer returns
SYSTEM_SERVICE_ERROR_PARAMETER like the other getters here.
2026-09-29 13:56:45 +13:00
SamG-Coder e211a2fe6f fix(relinker): align Windows startup unwind metadata
(cherry picked from commit a720b85866bdf77f836bcb344f5be806a12d5106)
2026-09-29 10:46:10 +10:00
SamG-Coder 95bc3e6d73 fix(font): build PS5 module-named font libraries
(cherry picked from commit bfc08b5372b9b5e73dc0b277897799e0ee86c843)
2026-09-29 10:36:48 +10:00
Dean Galvin 962bc67952 test(agc): accept a bindless table entry captured across a page boundary
ShaderMemory captures guest memory per page, so a 32-byte table entry that straddles a page
boundary is held by two adjacent regions. The bindless test's coverage check required one region
to hold the whole entry, so it failed whenever the stack placed an entry at page offset 4080
(about one run in 75). The check now accepts adjacent regions that together cover the range.
2026-09-29 13:30:51 +13:00
Dean Galvin 2b0fa0bb74 fix(agc): drop pixel shader exports past the draw's attachments
An MRT export to a slot past the draw's color attachments (outside
CB_TARGET_MASK & CB_SHADER_MASK, e.g. MRT1 with only slot 0 enabled) is
dropped by the color backend. Vulkan discards a fragment output without
an attachment the same way, but validation rejected the draw ("fragment
shader must export float4 colors at locations below the attachment
count"). Such outputs are now left out of the written locations, and
only the exports that reach an attachment must be float4.
2026-09-29 13:26:41 +13:00
Dean Galvin 7447392f87 feat(videoout): accept a zeroed open param
sceVideoOutOpen threw for any non-null param. PS5 titles pass a 16-byte
open param whose first word is its size, so they could not open a port.

A param whose size word is 16 and whose other three words are zero
requests nothing beyond a null param and is accepted. Any other size,
or any non-zero option word, still throws.
2026-09-29 13:25:25 +13:00
Dean Galvin 70bbd700e2 feat(libkernel): accept priority-inheritance mutexes
scePthreadMutexattrSetprotocol threw for SCE_PTHREAD_PRIO_INHERIT, so a
title creating its mutexes with priority inheritance stopped at the
first one.

Guest thread priorities are recorded (scePthreadSetprio/Getprio) but
never applied to host scheduling, so there is no priority for a waiter
to lend to the owner: an inheriting mutex locks, unlocks and reports
errors exactly like a PRIO_NONE one here, and the protocol is accepted.
The POSIX pthread_mutexattr_setprotocol wrapper already accepts it.
Priority protection (PRIO_PROTECT, with its ceilings) and unknown
protocols still throw.
2026-09-29 13:22:21 +13:00
Dean Galvin 33d058fd35 feat(agc): register driver eq events and deliver end-of-pipe interrupts
sceAgcDriverAddEqEvent and sceAgcDriverDeleteEqEvent were NotImplemented,
so a title that waits on its equeue for the GPU to reach the end of a
command buffer could never be woken.

AddEqEvent now registers a graphics-core event (filter -14, ident = the
given id, EV_CLEAR, data counting the interrupts since the last wait) on
the kernel equeue and remembers the registration; DeleteEqEvent removes
both. An invalid equeue or deleting an event that is not registered
throws.

The driver delivers the interrupt when it executes a RELEASE_MEM whose
INT_SEL is non-zero. Such a packet is not deferred as a GPU label: the
recorded work before it is drained, its memory write (if any) is done,
and then the event registered with the id of the issuing queue is
triggered (0 for the graphics ring, the ACB queue id for compute), which
matches how titles derive their event ids from the ring they submit on.
2026-09-29 13:15:25 +13:00
Dean Galvin 8588b551a4 feat(agc): decode the packed 2_10_10_10 and 10_11_11 float vertex buffer formats
Vertex buffer formats 50-55 (2_10_10_10 UNORM, SNORM, USCALED, SSCALED, UINT, SINT: X in the low
10 bits, the 2-bit W on top) map to Vulkan's A2B10G10R10 packings, and format 36 (10_11_11_FLOAT:
X in the low 11 bits) to B10G11R11_UFLOAT, the same mapping TextureFormat uses for textures.
11_11_10_FLOAT (43), whose 10-bit X has no Vulkan packing, stays rejected.
2026-09-29 13:07:47 +13:00
Dean Galvin 8ada7510bd feat(agc): accept the dispatch tunnel hint
DISPATCH_INITIATOR bit 13 (TUNNEL_ENABLE) asks the SPI to launch the dispatch's waves ahead of
other work. It is a scheduling priority hint with no effect on the results, so direct and indirect
dispatches accept it like the other ignored modifier bits.
2026-09-29 13:05:49 +13:00
Dean Galvin 90855bbc18 fix(json2): referValue returns null for a missing member, getters return references
sce::Json::Value::getBoolean, getInteger, getUInteger and getReal return const references
(const bool&, const long&, const unsigned long&, const double&), so the guest reads the value
through the returned pointer. A value-returning implementation made callers dereference the value
itself. Cross-type conversions keep main's range rules and are stored on the node so the reference
stays valid.

Value::referValue(const String&) looks a member up without creating it: it returns null for a
missing key or a value that is not an object instead of inserting an entry or throwing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-29 13:02:54 +13:00
Dean Galvin 181457a0a6 feat(agc): primitive restart with an all-ones index for strips, and for lists with VK_EXT_primitive_topology_list_restart
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-29 13:00:42 +13:00
Dean Galvin 9735d82513 fix(agc): accept the core Sampled1D and Image1D SPIR-V capabilities
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-29 12:57:45 +13:00
Dean Galvin d9ac21c6c9 fix(shader): make s_getpc_b64 return the shader's absolute address
s_getpc_b64 produced the next instruction's offset from the start of the
shader, so code that addresses data stored behind itself built V#s at a
tiny address. Astro Bot's video-frame NV12->RGB pass draws its quad with
an NGG shader that fetches the four vertices from after its own code
(s_getpc_b64; s_add_u32 0x98; s_addc_u32) - the buffer resolved to 0xf0,
every vertex read as zero, the quad never rasterized and the PlayStation
Studios logo video stayed black.

The result is now GetShaderBase + offset. The resource walk already
evaluates GetShaderBase per request from the code address, so the V#
names the real data and the same code at another address still shares
its compiled variant.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-29 12:56:48 +13:00
Dean Galvin 7379830398 fix(agc): don't let a queue worker record on a device the presenter is replacing
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-29 12:55:36 +13:00
Dean Galvin 8f982168e2 perf(libc): replace the mspace block list with an ordered allocator
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-29 12:53:00 +13:00
boykopovar fe1935ef68
Merge pull request #109 from boykopovar/fix/linux-savedata-build
fix(build): use portable save paths and validate all PRX libraries in CI
2026-09-29 02:29:58 +03:00
boykopovar b01e0bbf52 fix(build): use portable save paths and validate all PRX libraries in CI 2026-09-29 02:24:56 +03:00
boykopovar 1ff73445b1
Merge pull request #108 from boykopovar/refactor/relinker-friendly-usage
fix(relinker): use app0 guest module layout and clarify output diagnostic
2026-09-29 02:18:17 +03:00