Skip to content

fix(libSceRudp): match the console's init and status checks - #3200

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
hugodearaujo:feat/rudp-status-console
Oct 11, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
hugodearaujo:feat/rudp-status-console

Conversation

@hugodearaujo

Copy link
Copy Markdown
Contributor

What

sceRudpInit and sceRudpGetStatus now follow what a PS5 (firmware 13.60) returns, measured with a payload that calls the system's libSceRudp. PPSA01521 calls sceRudpGetStatus with 0xF8 bytes (TechnicalDebt).

sceRudpInit(pool, size)

  • When the library is already initialized, it returns ALREADY_INITIALIZED first, even for a null pool.
  • A null pool, or a size of 0 or less, returns INVALID_ARGUMENT (0x80770004).
  • A pool under 0xC58 bytes, or one that is not 8-byte aligned, returns MEMORY (0x80770007). 0xC57 fails and 0xC58 succeeds. Offsets +1, +2 and +4 fail; +8 succeeds.
  • main accepted any pool, including (nullptr, 0).

sceRudpGetStatus(status, size)

  • Before sceRudpInit, every call returns NOT_INITIALIZED, whatever the arguments.
  • After it, a null pointer, a size of 0 or a size above 0xF8 returns INVALID_ARGUMENT. main returned 0.
  • The status is 0xF8 bytes. Measured values match SceRudpStatus in Vita3K:
    • currentContexts at 0x64: 0, then 1 and 2 after sceRudpCreateContext, then 1 after closing one;
    • allocs, frees, memCurrent and memPeak at 0xC8 to 0xD4;
    • with that layout, the struct ends at exactly 0xF8.
  • The function now reports currentContexts. The traffic and allocator counters stay 0; TechnicalDebt lists this, and the fact that the console also writes some fields past a smaller byte count.

Error names follow the Rudp numbering in RPCS3.

Tested

  • PS5, firmware 13.60: every value above was measured with the console's own libSceRudp.sprx.
  • Linux: ctest 753/753; check_conventions.py and check_test_registration.py pass. The new guest_rudp_status test aborts with main's Export.cpp and passes with this change. guest_offline_imports changes only the two lines that expected Init(nullptr, 0) and GetStatus(nullptr, 0) to succeed.
  • Windows (MinGW, CI flags): ctest 760/760, including guest_rudp_status and guest_offline_imports.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

Measured on a PS5 (firmware 13.60):
- sceRudpInit rejects a null pool or a size of 0 or less with
  INVALID_ARGUMENT, and a pool under 0xC58 bytes or not 8-byte aligned
  with MEMORY (0x80770007).
- sceRudpGetStatus rejects a null pointer or a byte count of 0 or above
  0xF8 with INVALID_ARGUMENT and reports the live context count at 0x64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2852 docs/dev/TechnicalDebt.md L56-57
#2853 docs/dev/TechnicalDebt.md L56-57

@oneandonlydean
oneandonlydean merged commit b722287 into boykopovar:main Oct 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants