feat(libSceCompanionHttpd): keep the server state with no companion device #8112
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8112"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T22:08:37Z.
What
libSceCompanionHttpdonmainis an empty placeholder. A PS4 title that imports it does not load. Monopoly Plus from CUSA03312 (Hasbro Family Fun Pack) sets up the companion-app server while it starts, and gives up on a failed setup only as far as its own companion feature goes.The library now keeps the server's state, with no companion device ever connecting:
sceCompanionHttpdOptParamInitializezeroes the 0x60-byte option block. Titles fill work memory at +0x08 and +0x10 and a temporary data mount point at +0x58 after this call. The console's defaults for the other fields are unknown, and nothing reads them.InitializeandTerminate,RegisterRequestCallbackandUnregisterRequestCallback, andStartandStoptrack the state and return the library's errors:INVALID_PARAMfor null arguments;ALREADY_INITIALIZEDandNOT_INITIALIZED;ALREADY_REGISTERED;ALREADY_STARTEDandNOT_STARTED.GetEventreturnsNO_EVENTwithout writing the event, and the request callback is never called. No HTTP server listens, so no device can connect.AddHeader,SetStatusandSetBody, which are only reachable from a request, and the six the title does not import. With them, the file has all 17 of the library's exports.The error values are shadPS4's
companion_error.h.ALREADY_REGISTEREDis written there as 0x80E4000, one digit short; this uses 0x80E4000C, the value betweenNOT_STARTEDandNOT_CONNECTED. The debt file records each choice.#7840 declares the same 17 exports as placeholders. This PR implements eight of them and declares the rest, so #7840's
libSceCompanionHttpdpart is no longer needed once this lands.Tested
Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release.
guest_companion_httpd(new) passes. It covers:NO_EVENTbefore and after the start, with the event untouched;OptParamInitialize,InitializeandRegisterRequestCallback, pollsGetEventwithout a device, and reaches its loading screen at 60 fps.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pylists #7840 as above.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T22:09:22Z.
Progress report (
56b299c→ 346cafd)📈 System libraries: 64.42% (+0.09%, +6 implemented functions)
✅ 6 implemented
sceCompanionHttpdGetEventsceCompanionHttpdInitializesceCompanionHttpdOptParamInitializesceCompanionHttpdRegisterRequestCallbacksceCompanionHttpdStartsceCompanionHttpdStopImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-20T07:44:09Z.
Rebase handoff — rebased onto current
main(3fd1cc393, authorship unchanged).main's parameter-lessNotImplementedstubs for this library conflicted with your rework at ten points; resolved throughout in favour of your implementation (the result is byte-identical to your ownExport.cpp), and your split debt entries replacemain's single stub-list entry.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds;guest_companion_httpdpasses; 1672/1675 — green apart from the three knownmainfailures (#7584 BDA, #7784 guest-memory, and the tessellation segfault — #5444's Mesa 26.2.6 fix isn't in my 26.2.4), none from this PR; conventions pass.To pick it up:
Head is
346cafdb8.Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-20T12:21:06Z.
@blawesom thank you for the rebase and the Linux run. I took your branch as it is: the head is now
346cafdb8. Before pushing I checked it against my previous head8674754b6:main's list, so the conflict resolution drops none of them.main(56b299c3a), andtools/check_conventions.py --base origin/mainpasses.I did not rebuild it on Windows; your Linux result (
guest_companion_httpdpasses, 1672/1675 with onlymain's known failures) covers this head.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T23:43:43Z.
Review: APPROVED
The implementation keeps the described no-device state machine internally consistent: initialization clears the callback on termination, repeated state transitions return explicit errors,
GetEventleaves the output untouched, and request callbacks cannot run without a connected device. The 0x60-byte option layout has a size assertion, and the tests cover its bounds plus the state/error paths and throwing exports. TheALREADY_REGISTEREDvalue is correctly corrected to0x80E4000C; the cited shadPS4 header contains the one-digit-short value0x80E4000. The title discussion link inUnblocksresolves to the CUSA03312 Game bring-up thread. The former #7840 overlap is now merged into main; currenttools/pr_overlap.pyreports no overlap with open PRs. Eligibility, conventions, labels and report pass; hosted build jobs are skipped, and the reported Linux/Windows title/library runs remain author-reported. No blocking issue found; approved.