Commit Graph

455 Commits

Author SHA1 Message Date
boykopovar 2e9761753d
Merge pull request #86 from OverkillLabs/feat/misc-prx-additions
feat(prx): ConvertKeycode, VoiceChat stubs, PlayGo chunk-id fix
2026-09-29 17:30:06 +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
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 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
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 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 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 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 b01e0bbf52 fix(build): use portable save paths and validate all PRX libraries in CI 2026-09-29 02:24:56 +03:00
boykopovar cc41e847c8
Merge pull request #105 from SamG-Coder/codex/quake-native-imports
fix(relinker,libs): decode EMMS and add native string and thread APIs
2026-09-29 01:59:28 +03:00
boykopovar 9e3df3331c
Merge pull request #107 from asimplestray/feat/libc-mspace-reallocalign
feat(libc): implement sceLibcMspaceReallocalign
2026-09-29 01:46:19 +03:00
boykopovar c4c34ea3be
Merge pull request #80 from OverkillLabs/feat/avplayer-native-state-machine
feat(libSceAvPlayer): implement full AvPlayer state machine
2026-09-29 01:35:13 +03:00
boykopovar a5e7d1fb32
Merge pull request #79 from OverkillLabs/feat/net-rudp-offline-stack
feat(net): offline socket/epoll/resolver stack with FreeBSD errno mapping
2026-09-29 01:31:33 +03:00
boykopovar 23dad6b4d7
Merge pull request #78 from OverkillLabs/fix/msgdialog-state-machine
fix(libSceMsgDialog): real dialog state machine, auto-answer without UI
2026-09-29 01:27:31 +03:00
boykopovar 0d70866817
Merge pull request #77 from OverkillLabs/feat/savedata-core
feat(savedata): general mount/directory/memory-slot save-data core
2026-09-29 01:24:12 +03:00
asimplestray 02b431eb6d feat(libc): implement sceLibcMspaceReallocalign 2026-09-28 22:15:25 +00:00
boykopovar 4c2b052e35
Merge pull request #58 from oneandonlydean/feat/font-freetype
feat(font): port shadPS4's sceFont and sceFontFt on FreeType
2026-09-29 01:07:30 +03:00
SamG-Coder 5e708c1608 feat(kernel): add native pthread barriers and thread helpers 2026-09-29 07:39:01 +10:00
SamG-Coder 96b622c6ac feat(libc): add allocating strings and C locale wide conversion 2026-09-29 07:39:01 +10:00
boykopovar 64066b6e9a
Merge pull request #103 from boykopovar/feat/provide-release
Feat/provide release
Added a release workflow for v* tags: build Windows and Linux, run tests, and publish only if both platforms are successful. The release contains PRX archives, relinker executables, and documentation from docs/user. The build cache is reused.

- `prx-windows-v0.1.0.zip`
- `prx-windows-v0.1.0.tar.gz`
- `prx-linux-v0.1.0.zip`
- `prx-linux-v0.1.0.tar.gz`
- `relinker-v0.1.0.exe`
- `relinker-v0.1.0`
- `COMPATIBILITY.md`
- `INPUT_MAPPING.md`
2026-09-29 00:25:39 +03:00
asimplestray c25c543f1c feat(kernel): implement Aio request lifecycle 2026-09-28 20:39:33 +00:00
boykopovar 46382612cb fix(libcohtml): fix build libcohtml with target libs o linux 2026-09-28 23:15:22 +03:00
boykopovar 00261033fa refactor(docs): separated user and dev in docs + compatibility file 2026-09-28 22:58:17 +03:00
SamG-Coder d70d7ca268 feat(kernel): deliver plain-text notification requests to host output 2026-09-29 05:14:56 +10:00
boykopovar dee7ecb3d8
Merge pull request #27 from QDarkRex/refactor/kernel-error-header
refactor(kernel): share SCE kernel error codes through KernelErrors.hpp
2026-09-28 22:07:32 +03:00
boykopovar 829e8c14ae fix(tests): align agc flip waits and memory synchronization checks 2026-09-28 19:32:43 +03:00
boykopovar 1f595d883a fix(agc): propagate dispatch worker failures to waiting threads 2026-09-28 19:29:49 +03:00
boykopovar 39fd90b050 fix(kernel): orderly shutdown when closing the display window 2026-09-28 18:30:34 +03:00
boykopovar 143aec54c2 fix(agc): preserve inputs for deferred buffer copies 2026-09-28 18:08:09 +03:00
boykopovar 8e78ea0c28 fix(nid): always static linking for nid patcher 2026-09-28 16:28:11 +03:00
boykopovar 64732a64b6 fix(build): link json and fiber tests with libc 2026-09-28 14:18:35 +03:00
boykopovar d65a8ee633
Merge pull request #74 from SamG-Coder/main
fix(shader): support byte permutation and fix compiler lifetime bugs
Adds `V_PERM_B32` byte selection and fixes two existing bugs exposed while testing it: IR equality could merge buffer reads with different metadata, and concurrent shader compilation could crash during Windows thread-local destruction.

- Include instruction flags when comparing IR values so selections between different buffer offsets survive constant folding.
- Decode RDNA2 opcode `0x344` and translate all byte selectors through existing integer IR and the SPIR-V backend, including sign replication, zero/ones fill, and overlapping destinations.
- Reuse the existing `HostThreadLocal` helper for six destructible compiler scratch objects. Add async worker/destructor checks to the existing lifetime test. Scratch storage remains reusable.
2026-09-28 13:51:18 +03:00
boykopovar 0fe554943a
Merge pull request #73 from julienlgy/feat/lib-sce-mouse
feat(libSceMouse): implement stateful mouse API exports
Replace the libSceMouse stubs with an implementation that follows AnyPS5’s existing NID-based library integration. Mouse input comes from the host SDL event loop; this change does not add memory hooks or direct access to console HID devices.

Manage the mouse handle, button state, timestamps, and a thread-safe, 64-event history in src/mouse_impl.cpp. Reads are non-blocking.

Forward relative motion, supported buttons, vertical scrolling, and horizontal scrolling from libSceVideoOut’s SDL event loop.

Release pressed buttons when the window loses focus without reporting a hardware disconnection.
2026-09-28 13:45:13 +03:00
OverkillLabs 9673bce423 types: widen Ngs2WaveformBlock offset/size fields to 64-bit
PS5 grew Ngs2WaveformBlock's data_offset/data_size pair from 32-bit to
64-bit fields (40-byte record vs. the 32-byte PS4 layout). Standalone
correctness fix, unrelated to and non-conflicting with the pad work in
the preceding commits.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:43:40 +03:00
OverkillLabs 1d245cbeb2 videoout: bridge SDL sensor/haptics to pad output alongside existing input-mapping flow
Reconcile our SDL gamepad motion/haptics work with upstream's
configurable keyboard/mouse binding feature (PadInput now built around
Pad::LoadInputMapping() and a std::vector<Pad::InputBinding>). Upstream's
openFirstAvailableController()/openController(deviceIndex) flow and
HandleEvent/Update/publish logic for keyboard, mouse, and wheel
bindings are kept as-is (including APS5_NO_PAD_INPUT handling); the
sensor-enabling and host-haptics steps are grafted on as additional
work done once a controller is open:

- openController(deviceIndex) now also calls enableSensors() and
  marks a re-apply of the current guest output request pending.
- New sampleController()/applyOutput()/enableSensors() bring in real
  gamepad sampling, motion sensor reads, DualSense touchpad finger
  tracking, and pushing rumble/light bar/adaptive trigger state out via
  SDL_GameControllerRumble/SetLED/SendEffect. sampleController()'s
  button list and trigger/stick scaling are an exact copy of the
  button/trigger/stick reading that used to be inlined in publish()
  under the SDL_GameControllerGetAttached check (no deadzone added,
  no extra button remapped) -- only the motion, touchpad, and
  device-kind sampling on top of it are new.
- Update() now also samples the controller and applies pending output
  every tick, in addition to upstream's SDL_GameControllerUpdate() call
  and its keyboard/mouse/wheel timing logic.
- publish() seeds PadInputState from the sampled gamepad state first
  (buttons/sticks/analog triggers/motion/touch/device kind), then
  layers upstream's keyboard/mouse binding loop on top exactly as
  upstream had it, so a bound key still overrides the gamepad the same
  way it did before this merge. Upstream's L2/R2 button-flag derivation
  is preserved, just computed once at the end from whichever value
  (gamepad or a keyboard/mouse override) ends up in analogButtonsL2/R2.
- The background-events SDL hint is now set unconditionally (previously
  only inside the "not yet initialized" branch), since upstream's own
  VideoOutDriver already brings up SDL_INIT_GAMECONTROLLER before
  PadInput is constructed, which meant the hint would never run.

No changes were needed in VideoOutDriver.cpp: PadInput lazily
initializes SDL_INIT_GAMECONTROLLER itself in
openFirstAvailableController() (already a no-op if the subsystem is up),
and the class's public interface (default-constructible, HandleEvent/
Update) is unchanged, so upstream's existing `PadInput padInput;` /
HandleEvent / Update call sites keep working without modification.
VideoOutDriver.cpp's own independent flip-queue/vblank-telemetry rework
was left untouched as out of scope.

Confidence: high for the keyboard/mouse binding path (untouched) and
for the gamepad button/stick/trigger path (byte-for-byte copy of the
pre-existing mapping); the new motion/haptics/touchpad code is novel
and builds/links cleanly but has not been run against real hardware.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:43:27 +03:00
OverkillLabs 855176796b pad: real implementations for extended pad info/lightbar/trigger NIDs
Replace NotImplemented stubs with real implementations for
scePadGetInfo, scePadDeviceClassGetExtendedInformation/ParseData,
scePadGetExtControllerInformation, scePadSetLightBar,
scePadResetLightBar, scePadResetOrientation,
scePadSetMotionSensorState, scePadGetTriggerEffectState,
scePadSetProcessPrivilege, and scePadSetParticularMode, wiring them to
the new Pad:: output/orientation API. None of these NIDs are touched
by upstream's existing keyboard/mouse binding work, so this is a
clean additive change.

scePadSetVibration, scePadSetVibrationMode, and scePadSetTriggerEffect
are also given real implementations here, even though they were not
named in the audit's NID list: they are the only guest entry points
for the Pad::SetVibration/SetVibrationMode/SetTriggerCommand plumbing
added in the previous commit, so leaving them NotImplemented would
make the rumble/adaptive-trigger machinery unreachable from any title.

Every other previously-NotImplemented NID in this file (scePadGetHandle,
scePadSetAngularVelocityDeadbandState, scePadSetTiltCorrectionState,
scePadSetVibrationTriggerEffectWeakWhileEmbeddedMicInUse) is left
exactly as upstream had it; scePadOpen_nid_postfix, scePadRead_nid_postfix,
and scePadReadState are untouched (upstream's APS5_INVALID_ARG_EX
throw-based error handling is kept as-is, not replaced with plain
error-code returns).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:43:07 +03:00