feat(libSceMsgDialog): show user message dialogs as host message boxes with ANYPS5_MSG_DIALOG_HOST #17706

Merged
MarcZX10 merged 26 commits from upstream-pr/17706 into main 2026-11-19 07:40:19 +00:00
MarcZX10 commented 2026-11-09 11:15:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-09T11:15:00Z.


What

Adds ANYPS5_MSG_DIALOG_HOST=1. With it, each user message dialog that sceMsgDialogOpen opens (a text and a button type) is shown as a native host message box through SDL_ShowMessageBox, instead of the in-game dialog. The call waits until a button is pressed, then reports that button; sceMsgDialogGetStatus reports the dialog as finished at once. This follows the host confirmation that libSceSystemService already uses, which also calls SDL_ShowMessageBox on the calling thread.

Decisions taken here, without an owner's answer:

  • Off by default. Unset, empty or any value other than 1 keeps the in-game dialog.
  • Apple builds always keep the in-game dialog, since SDL must show message boxes on the main thread there.
  • Synchronous on the calling thread, as the libSceSystemService confirmation does. No worker thread, so no second path to answer the dialog.
  • The gamepad does not answer while the box is open, because the game thread is blocked in the call.
  • If SDL cannot show the box, the in-game dialog is used. A closed box with no choice answers the cancel button, or the first button.

Not covered: progress bars, system messages and user messages with other button types keep the in-game dialog. Limits are in the debt entry of libSceMsgDialog.

Commits: the tests (which fail before the module exists), the pure switch, labels and button mapping, the SDL call, the wiring into sceMsgDialogOpen, the environment row, the debt entry, and a CMake path fix.

Tested

Linux, built with msg_dialog_host_box_tests (new), guest_msg_dialog and msg_dialog_request, and the libSceMsgDialog library; ctest passes 3/3.

  • The new test covers the switch (unset, 1, 0, other values, Apple), the ASCII labels, and the button mapping (in range, out of range, closed with no choice).
  • Negative control: with the button mapping forced to button 0, msg_dialog_host_box_tests fails with the second button is not index 1. Restored, it passes.
  • Not tested: the box itself. No display was used, so no real message box was shown and no button was pressed. The sceMsgDialogOpen wiring is checked only by the existing guest test, which runs with the switch unset.

GPUs tested: n/a, no graphics code.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a, no AGC or shader change
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5222966211 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17706). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-09T11:15:00Z. --- ### What Adds `ANYPS5_MSG_DIALOG_HOST=1`. With it, each user message dialog that `sceMsgDialogOpen` opens (a text and a button type) is shown as a native host message box through `SDL_ShowMessageBox`, instead of the in-game dialog. The call waits until a button is pressed, then reports that button; `sceMsgDialogGetStatus` reports the dialog as finished at once. This follows the host confirmation that libSceSystemService already uses, which also calls `SDL_ShowMessageBox` on the calling thread. Decisions taken here, without an owner's answer: - Off by default. Unset, empty or any value other than `1` keeps the in-game dialog. - Apple builds always keep the in-game dialog, since SDL must show message boxes on the main thread there. - Synchronous on the calling thread, as the libSceSystemService confirmation does. No worker thread, so no second path to answer the dialog. - The gamepad does not answer while the box is open, because the game thread is blocked in the call. - If SDL cannot show the box, the in-game dialog is used. A closed box with no choice answers the cancel button, or the first button. Not covered: progress bars, system messages and user messages with other button types keep the in-game dialog. Limits are in the debt entry of libSceMsgDialog. Commits: the tests (which fail before the module exists), the pure switch, labels and button mapping, the SDL call, the wiring into `sceMsgDialogOpen`, the environment row, the debt entry, and a CMake path fix. ### Tested Linux, built with `msg_dialog_host_box_tests` (new), `guest_msg_dialog` and `msg_dialog_request`, and the `libSceMsgDialog` library; ctest passes 3/3. - The new test covers the switch (unset, `1`, `0`, other values, Apple), the ASCII labels, and the button mapping (in range, out of range, closed with no choice). - Negative control: with the button mapping forced to button 0, `msg_dialog_host_box_tests` fails with `the second button is not index 1`. Restored, it passes. - Not tested: the box itself. No display was used, so no real message box was shown and no button was pressed. The `sceMsgDialogOpen` wiring is checked only by the existing guest test, which runs with the switch unset. GPUs tested: n/a, no graphics code. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a, no AGC or shader change - [x] AI-assisted: yes
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!17706
No description provided.