feat(errordialog): implement the libSceErrorDialog state machine #558

Merged
Phi1ow merged 2 commits from upstream-pr/558 into main 2026-10-04 23:48:20 +00:00
Phi1ow commented 2026-10-04 20:34:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T20:34:47Z.


What

The six libSceErrorDialog exports were throwing stubs. They now implement the dialog's
NONE -> INITIALIZED -> RUNNING -> FINISHED state machine without a visible window, so a title
that opens an error dialog and waits for it never blocks:

  • sceErrorDialogInitialize — NONE -> INITIALIZED; 0x80ED0002 if already initialized.
  • sceErrorDialogOpen(param) — requires INITIALIZED or FINISHED (else 0x80ED0005),
    checks the 16-byte parameter and its size field (else 0x80ED0003), then RUNNING.
  • sceErrorDialogUpdateStatus — turns RUNNING into FINISHED and returns the status.
  • sceErrorDialogGetStatus — returns the status.
  • sceErrorDialogClose — RUNNING -> FINISHED; 0x80ED0005 when nothing is running.
  • sceErrorDialogTerminate — -> NONE; 0x80ED0001 when not initialized.

Re-opening is allowed once a previous dialog has finished. The status values and error codes
are the documented SCE error-dialog ones; the structure mirrors the existing libSceMsgDialog.
Adds a CMakeLists.txt so the library can carry its guest test.

Tested

New test core/libs/tests/GuestErrorDialog.cpp (registered as guest_error_dialog) drives
the whole machine: the not-initialized and already-initialized errors, the state and parameter
checks of open, open/update/close, and re-open after finish.

Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; ctest -R guest_error_dialog
passes. On main the six functions throw not implemented, so the test aborts without the
change.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4737417734 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/558). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T20:34:47Z. --- ### What The six `libSceErrorDialog` exports were throwing stubs. They now implement the dialog's `NONE -> INITIALIZED -> RUNNING -> FINISHED` state machine without a visible window, so a title that opens an error dialog and waits for it never blocks: - `sceErrorDialogInitialize` — `NONE -> INITIALIZED`; `0x80ED0002` if already initialized. - `sceErrorDialogOpen(param)` — requires `INITIALIZED` or `FINISHED` (else `0x80ED0005`), checks the 16-byte parameter and its `size` field (else `0x80ED0003`), then `RUNNING`. - `sceErrorDialogUpdateStatus` — turns `RUNNING` into `FINISHED` and returns the status. - `sceErrorDialogGetStatus` — returns the status. - `sceErrorDialogClose` — `RUNNING -> FINISHED`; `0x80ED0005` when nothing is running. - `sceErrorDialogTerminate` — `-> NONE`; `0x80ED0001` when not initialized. Re-opening is allowed once a previous dialog has finished. The status values and error codes are the documented SCE error-dialog ones; the structure mirrors the existing `libSceMsgDialog`. Adds a `CMakeLists.txt` so the library can carry its guest test. ### Tested New test `core/libs/tests/GuestErrorDialog.cpp` (registered as `guest_error_dialog`) drives the whole machine: the not-initialized and already-initialized errors, the state and parameter checks of `open`, `open`/`update`/`close`, and re-open after finish. Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; `ctest -R guest_error_dialog` passes. On `main` the six functions throw `not implemented`, so the test aborts without the change. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-04 21:19:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:19:42Z.


Thanks. The status values, the 0x80ED0001/2/3/5 error codes and the 16-byte parameter (size, error code, user id, reserved) match the SDK definitions, and the state machine is consistent with libSceMsgDialog.

Two things before it goes in:

  1. The dialog now finishes without showing anything, which CONTRIBUTING counts as a silent stub. Could you add it to the "Silent stubs" list in docs/dev/TechnicalDebt.md? The checklist says it's there, but the PR doesn't change that file.
  2. Optional, but useful: the error code in the parameter (offset 4) is what the dialog would have shown the player, and right now it disappears. A log line with it in sceErrorDialogOpen (like libSceMsgDialog logs its text) would make these errors visible when a title hits one.

The CI run on this PR still needs approval; I'll check it once it has run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5984498235 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/558#issuecomment-5984498235). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T21:19:42Z. --- Thanks. The status values, the 0x80ED0001/2/3/5 error codes and the 16-byte parameter (size, error code, user id, reserved) match the SDK definitions, and the state machine is consistent with `libSceMsgDialog`. Two things before it goes in: 1. The dialog now finishes without showing anything, which CONTRIBUTING counts as a silent stub. Could you add it to the "Silent stubs" list in docs/dev/TechnicalDebt.md? The checklist says it's there, but the PR doesn't change that file. 2. Optional, but useful: the error code in the parameter (offset 4) is what the dialog would have shown the player, and right now it disappears. A log line with it in `sceErrorDialogOpen` (like `libSceMsgDialog` logs its text) would make these errors visible when a title hits one. The CI run on this PR still needs approval; I'll check it once it has run.
github-actions[bot] commented 2026-10-04 22:32:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T22:32:39Z.


Progress report (fc32593 → 6571ace)

📈 System libraries: 78.06% (+0.19%, +6 implemented functions)

✅ 6 implemented
Library Name
libSceErrorDialog sceErrorDialogClose
libSceErrorDialog sceErrorDialogGetStatus
libSceErrorDialog sceErrorDialogInitialize
libSceErrorDialog sceErrorDialogOpen
libSceErrorDialog sceErrorDialogTerminate
libSceErrorDialog sceErrorDialogUpdateStatus
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985177986 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/558#issuecomment-5985177986). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T22:32:39Z. --- <!-- progress-report --> ### Progress report (fc32593 → 6571ace) 📈 **System libraries**: 78.06% (+0.19%, +6 implemented functions) <details> <summary>✅ 6 implemented</summary> | Library | Name | | - | - | | libSceErrorDialog | `sceErrorDialogClose` | | libSceErrorDialog | `sceErrorDialogGetStatus` | | libSceErrorDialog | `sceErrorDialogInitialize` | | libSceErrorDialog | `sceErrorDialogOpen` | | libSceErrorDialog | `sceErrorDialogTerminate` | | libSceErrorDialog | `sceErrorDialogUpdateStatus` | </details>
Phi1ow commented 2026-10-04 22:34:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T22:34:22Z.


Done. Added libSceErrorDialog to the "Silent stubs" list, and sceErrorDialogOpen now logs the error code and user id from the parameter (offsets 4 and 8) via APS5_HIT, like libSceMsgDialog logs its message, so the error stays visible when a title hits one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985191413 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/558#issuecomment-5985191413). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T22:34:22Z. --- Done. Added libSceErrorDialog to the "Silent stubs" list, and `sceErrorDialogOpen` now logs the error code and user id from the parameter (offsets 4 and 8) via `APS5_HIT`, like libSceMsgDialog logs its message, so the error stays visible when a title hits one.
oneandonlydean commented 2026-10-04 23:43:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:43:52Z.


Thanks, both done: libSceErrorDialog is in the silent stubs list, and sceErrorDialogOpen logs the error code and user id with APS5_HIT like libSceMsgDialog, after the size check. guest_error_dialog passes here and CI is green. Ready to merge from my side.

#559 and #560 add their lines right next to this one in the silent stubs list, so the later ones need a one-line rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985701648 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/558#issuecomment-5985701648). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T23:43:52Z. --- Thanks, both done: libSceErrorDialog is in the silent stubs list, and `sceErrorDialogOpen` logs the error code and user id with `APS5_HIT` like libSceMsgDialog, after the size check. `guest_error_dialog` passes here and CI is green. Ready to merge from my side. #559 and #560 add their lines right next to this one in the silent stubs list, so the later ones need a one-line rebase.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!558
No description provided.