feat(overlay): show PS5 system dialogs as real PC dialogs #12379
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12379"
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 MarcZX10 on 2026-10-28T12:04:41Z.
What
Shows PS5 system dialogs as real PC dialogs in the host overlay, driven by the PC keyboard, mouse and pad, in the same spirit as the real-keyboard IME replacing the on-screen keyboard. Until now
sceMsgDialogOpenandsceErrorDialogOpenauto-answered silently.Generic part (commits in this order):
libSceIme: a modal dialog session (ModalDialogRequest: message, one to three buttons, focused and cancel button;ModalDialogView; Showing/Answered/Closed). It is kept in libSceIme because libSceVideoOut already links it and both message dialog libraries and the error dialog can call it without linking each other. Opening is refused while no presenter is registered or another dialog is showing, so callers keep today's auto-answer (headless fallback). An active IME keyboard/pad capture has priority: the dialog is hidden and gets no input until the IME releases it.libSceAgcDriver:LayOutDialog(word wrap to 36 columns and 8 lines, one to three buttons, accent border on the focused one, same scale rule as the keyboard), the system dialog slot,SystemOverlayLayout, and the present path inVulkanDevice.cppnow asks for the layout of whichever system panel is set.libSceVideoOut: the presenter registration and the per-flip hand-over,DialogInput(arrows/Tab/wheel move focus, Enter/Space/left click confirm, Escape/right click cancel), pad hand-off (D-pad/left stick, Cross confirm, Circle cancel, armed only after both were seen released), and the title no longer receives pad, key press, key release, mouse motion, wheel, button press or button release input while the dialog is shown (held keys/buttons are released once). One commit per input path.Per library:
libSceMsgDialogandlibSceMsgDialog.native: user message dialogs with button type 0, 1, 3 or 4 are shown and stay running until answered or closed;sceMsgDialogGetResultreturns the button the player chose. Progress bars, system messages, other button types and anything opened with no window or while another dialog is shown keep the old behaviour.SceMsgDialogParamparsing moved to a stateless typed header.libSceErrorDialog:sceErrorDialogOpenshows a one-button dialog with the error code.libSceSaveDataDialog(.native): deliberately not wired. The layouts of the user message, system message and error code parameters have no source in this repository or measurement, so it is recorded as debt instead of guessed.Each feature has its test commit right after it, and the debt docs are trimmed one statement per commit (
libSceMsgDialog,libSceMsgDialog.native,libSceErrorDialog,libSceVideoOut,libSceSaveDataDialog.native). TheSceMsgDialogParamlayout and the button-type enum stay unmeasured debt; button ids, labels, the look, the inputs and the Cross/Circle choice are listed as unmeasured too.Overlap with open PRs: none implements these dialogs. #11948 changes
libSceVideoOut/CMakeLists.txt, and several PRs touch the present region ofVulkanDevice.cpp(this one replaces two lines there); #11511 only documents thesceMsgDialogOpenlayout. No code was taken from other PRs.Tested
Linux x86-64, GCC 12, throwaway archive build (host CPU gate patched) of tip 7f1a74c62a on base
2227f1366(upstream/main has since moved by 14 commits that touch none of these libraries; a merge-tree simulation is clean).Passed on that tip:
guest_ime_modal_dialog,guest_msg_dialog,guest_msg_dialog_native,guest_error_dialog,error_dialog_request,msg_dialog_param,msg_dialog_text,msg_dialog_request,keyboard_input,keyboard_dialog,video_out_mouse,video_out_dialog_input,pad_sdl,agc_keyboard_overlay,guest_ime_pad_route,guest_ime_dialog.check_conventions.py --base upstream/main,git diff --checkand the public header audit are clean.Review fixes: a dialog that no flip draws is dropped after 3 seconds (a presenter flag alone no longer means the dialog can be seen), and a dialog belongs to the library that opened it, so another library's terminate, close or poll does not touch it.
Negative controls (same build tree; the non-test sources restored to an earlier version, tests kept; abort on the first failing check):
keyboard_dialogwithKeyboardInput.cpp/.hppfrommain: FAILS at "a key press or release reached the title while a dialog was shown". With only the key-press drop (no reset): FAILS at "a dialog that starts taking keys on a key press did not reset them". With the real change: passes.video_out_mousewithMouseInput.cpp/.hppfrommain: FAILS at "motion or wheel reached the title while a dialog was shown". With only motion, wheel and press dropping (no reset): FAILS at "a button press or release reached the title while a dialog was shown". With the real change: passes.pad_sdlwithPadInput.cppfrommain: FAILS at the first dialog check, the intercepted neutral state while a dialog is shown (PadSdl.cppline 96). With the real change: passes.guest_ime_modal_dialogFAILS at "an undrawn dialog still captures input after the timeout",guest_msg_dialogat "a dialog that was never drawn kept the title waiting",guest_msg_dialog_nativeandguest_error_dialogat the status call expected to be finished after the bound.guest_ime_modal_dialogFAILS at "another library sees the dialog",guest_msg_dialogat "terminating libSceMsgDialog ended another library's dialog",guest_msg_dialog_nativeandguest_error_dialogat the poll that expects the other library's dialog to still be showing after a terminate.mainfor the other new tests (layout, parse, request builders, UTF-8 decode,DialogInput, the hub session): they exercise code that does not exist there.Not run: Windows, macOS, a real Vulkan window or any hardware GPU (the dialog was never seen on screen; only the rectangle layout is tested), a console, any title, real SDL held-key and held-button reset,
video_out_flip_*(built, skipped on this host: no offscreen Vulkan). Each commit was not built on its own; the full branch was. Reasoned only: the dialog is drawn when the presentation thread has a flip, so a title that never flips gets the automatic answer after 3 seconds.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)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T12:15:43Z.
Review: CHANGES_REQUESTED
Thanks, the structure is clean (modal session in libSceIme, one commit per input path, debt trimmed). One blocking point and two smaller ones:
VideoOutDriver.cpp:768-771: the dialog view is only handed to the AGC driver insideif (current), i.e. when the title has a flip pending. Before this PRsceMsgDialogOpen/sceErrorDialogOpenauto-answered, so a title that opens a dialog and then pollsUpdateStatus/GetStatuswithout flipping continued. Now it staysRunninguntil a player answers a dialog that is never drawn, so it hangs with no way out.ModalDialogSetPresenter_nid_postfix(window.Handle() != nullptr)(line 758) says "a presenter exists" without knowing that frames are being presented. Please make "presenter registered" mean the dialog can actually be seen: for example only report a presenter while flips arrive, or fall back to the old auto-answer when no flip has been presented since the dialog opened (bounded wait), or redraw the last frame with the dialog while idle. Add a test for the no-flip case.libSceErrorDialog/Export.cpp(sceErrorDialogTerminate) andlibSceMsgDialog/Export.cpp(sceMsgDialogTerminate) callModalDialogReset_nid_postfix(), which resets the one shared session. Terminating one library while the other has a dialog showing finishes that dialog as "answered OK". Reset only if this library's own dialog is the one showing (e.g. track an owner id in the session), and cover it inGuestImeModalDialog.mainfor the input-suppression paths (KeyboardDialog,MouseInput,PadSdl).Not verified by us: how the dialog looks on screen and the held-key/button reset on real SDL events (no GPU/window here); the Windows job is still pending.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T13:01:49Z.
Review: COMMENTED
Follow-up on exact head 7f1a74c62a. The prior no-flip hang and cross-library reset/poll concerns are addressed in the diff: undrawn sessions expire after a bounded three seconds, an already-drawn dialog remains answerable, and message/error callers pass their owner when polling, closing or resetting. I rebuilt the six focused targets from this head (35 Ninja steps). Native CTest execution on this host aborts all six before test logic because the Xeon E5-1620 v2 lacks the required Zen 2 instruction set. I then ran each exact binary under qemu-x86_64 TCG with -cpu max; all six exited 0: guest_ime_modal_dialog, guest_msg_dialog, guest_msg_dialog_native, guest_error_dialog, video_out_mouse and video_out_dialog_input. The emulated run covers state/input logic, not a real Vulkan window, GPU, console or title. Current-main diff check, conventions and the 211-script registration audit pass. Hosted Windows and report jobs were still pending, so I have not approved.