Skip to content

refactor(libSceCommonDialog): define the dialog status and error codes once - #1

Open
WardenPro wants to merge 1 commit into
mainfrom
refactor/libSceCommonDialog-shared-codes
Open

WardenPro wants to merge 1 commit into
mainfrom
refactor/libSceCommonDialog-shared-codes

Conversation

@WardenPro

@WardenPro WardenPro commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

What

Twenty-two dialog libraries each defined the common dialog status and error codes in an anonymous namespace of their own Export.cpp. They now live once in CommonDialog.hpp, which every one of those files already reaches, and the private copies are gone. The change is almost entirely deletions: 22 libraries, 38 insertions against 222 deletions.

It has to be all twenty-two at once. Adding a name to CommonDialog.hpp makes an unqualified reference to it ambiguous in any translation unit that still defines its own copy, because an anonymous-namespace name at namespace scope is visible through the enclosing namespace. A staged migration — the shared header plus a couple of libraries — does not compile, and the first run of this PR failed exactly that way on libSceNetCtlApDialog.

COMMON_DIALOG_ERROR_BUSY is 0x80B80008. Thirteen libraries returned 0x80B80007 for it, which shadPS4's commondialog.h lists as RESULT_NONE, so they most likely returned the result-none code where they meant busy. Three sources agree on 0x80B80008: that same shadPS4 header, libSceInvitationDialog which already returned it (boykopovar#11379), and firmware 13.42, which returns 0x80B80008 from Initialize while another common dialog is in use — the reading recorded in docs/dev/debt/libScePlayerInvitationDialog.md. What a busy Open returns is still not measured on a PS5, and docs/dev/debt/libSceCommonDialog.md says so.

Two other disagreements go with it. libSceWebBrowserDialog's COMMON_DIALOG_ERROR_PARAMETER is the same 0x80B8000A as COMMON_DIALOG_ERROR_INVALID_ARGUMENT and is folded into it; I kept the majority spelling rather than renaming eight libraries to shadPS4's PARAM_INVALID. libSceMsgDialog's private kErrBusy is renamed to the shared COMMON_DIALOG_ERROR_BUSY. libScePlayGoDialog still returns 0x80B80007 from scePlayGoDialogOpen under the unprefixed name ERROR_INVALID_STATE; it is a different name and outside this dedup, so it is recorded in the debt entry as the remaining busy spelling rather than changed here.

The two guest tests that pinned 0x80B80007 for busy move to 0x80B80008: GuestUsbStorageDialog.cpp and GuestMsgDialog.cpp. GuestInvitationDialog.cpp already pinned 0x80B80008 and is untouched. No other test asserts a dialog code.

Tested

macOS 27.2, Apple M4, AppleClang 21. Branch based on WardenPro/AnyPS5:main e509b2924.

  • python3 tools/check_conventions.py --base origin/main → All conventions checks passed.
  • Relinker-only build and tests — cmake -S . -B build-relinker -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON, cmake --build build-relinker --parallel 6, ctest --test-dir build-relinker --output-on-failure -j4 → 702 of 702 tests passed, 89.96 s. This build does not compile core/libs/prx, so it does not cover the change itself.
  • clang++ -std=c++20 -fsyntax-only -I core/libs -I core on every changed translation unit — all 24 .cpp files in the diff → exit 0, no errors, on each. This is not the project's build, but it is what catches the ambiguity above, and it is why the second revision passes locally.
  • python3 tools/pr_overlap.py --branch refactor/libSceCommonDialog-shared-codes --repo boykopovar/AnyPS5 → five open pull requests share a file with this branch; they are named under Depends on below.

CI on this revision: conventions passed, library-portability (Emscripten, which compiles every library) passed in 1 m 28 s, and report passed. The windows job did not fail — it was cancelled by its own timeout-minutes: 45 after 45 m 17 s, still inside "Build and run changed guest core/libs tests". That is a budget limit, not a defect: touching CommonDialog.hpp rebuilds every dialog library and its test executables, this fork had never run CI before so no ccache exists to warm, and the runner builds with --parallel 3. The full build is not available on a pull request at all: build.yml sets full = manual && ..., so linux, relinker, relinker-asan, register-context, write-watch and edge-watch are skipped on every PR run by design.

The previous revision, which took the staged shape, ran conventions green and failed windows on the ambiguity described above.

Not run: the guest library tests under Linux x86-64, and the full build.

Checklist

…s once

Twenty-two dialog libraries each defined the common dialog status and
error codes in an anonymous namespace of their own Export.cpp. They
disagreed on one value and spelled a second one two ways. The codes now
live once in CommonDialog.hpp, which every dialog library already
reaches, and the private copies are gone.

COMMON_DIALOG_ERROR_BUSY is 0x80B80008. Thirteen libraries returned
0x80B80007 for it, which shadPS4's commondialog.h lists as RESULT_NONE;
libSceInvitationDialog already returned 0x80B80008 (boykopovar#11379), and
firmware 13.42 returns 0x80B80008 from Initialize while another common
dialog is in use, the reading recorded in
docs/dev/debt/libScePlayerInvitationDialog.md. What a busy Open returns
is still not measured on a PS5. libSceMsgDialog's private kErrBusy took
the same value and is renamed to the shared name.

COMMON_DIALOG_ERROR_PARAMETER in libSceWebBrowserDialog is the same
0x80B8000A as COMMON_DIALOG_ERROR_INVALID_ARGUMENT and is folded into
it. libScePlayGoDialog's unprefixed ERROR_INVALID_STATE keeps 0x80B80007
and is recorded as the remaining busy spelling in
docs/dev/debt/libSceCommonDialog.md.

The two guest tests that pinned 0x80B80007 for busy move to 0x80B80008.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@WardenPro
WardenPro force-pushed the refactor/libSceCommonDialog-shared-codes branch from 280a2fa to 79ce982 Compare November 6, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Common dialogs: 21 libraries redefine the status and error codes, and 14 return 0x80B80007 for BUSY

1 participant