feat(libSceMsgDialog): export sceMsgDialogGetResult for PS4 titles #18207
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18207"
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 puridanish284 on 2026-11-10T21:05:04Z.
What
PS4 titles import
sceMsgDialogGetResult(NIDLr8ovHH9l6A) from the libSceMsgDialog module, where a PS4 exports it: shadPS4 registers it under library and modulelibSceMsgDialog(msgdialog.cppL154). Onmainonly libSceMsgDialog.native exports it. Grand Theft Auto V (CUSA00419) stops at start on that import: with #18087 its unresolved imports are down to two,sceGnmDrawInitDefaultHardwareState(the gap of #17581) and this one (blocker 4 in #18084).libSceMsgDialog already kept the button a player picks, or that a dialog without UI picks, "but not returned, as
sceMsgDialogGetResultis exported by libSceMsgDialog.native". It now returns it:duplicate-exportcheck requires: it moves unchanged from libSceMsgDialog.native'sExport.cpptolibSceMsgDialog.native/Result.cpp, which both modules'Export.cppinclude at their end. It reads its dialog throughMsgDialogResultStatus, which eachExport.cppdefines over its own state, so each module answers for the dialogs it opened.MsgDialogResultStatuspolls the dialog first, as itssceMsgDialogGetResultdid;guest_msg_dialog_nativepasses unchanged.YES_NO_FOCUS_NOand 1 otherwise without UI), result 0 and mode 0, as libSceMsgDialog.native returns and as shadPS4 fills it (modeis aFixedValue<u32, 0>there,msgdialog_ui.hL101-L106). Its errors and their order are libSceMsgDialog.native's:NOT_INITIALIZEDbefore any dialog or after terminate,ARG_NULLfor a null or unwritable pointer,NOT_FINISHEDwhile a dialog runs.GuestCopyOut_nid_no_patch, as libSceMsgDialog.native does sinceeb18c24509, and its Windows test path gains libc's directory.libSceMsgDialog.native.hppto theApi.hppthat header includes, sopublic_headersstill finds exactly one.The progress counts do not change: the definition stays in libSceMsgDialog.native's directory, which keeps its 10 functions, and libSceMsgDialog keeps 9.
Debt: libSceMsgDialog's entry that the button "is kept but not returned" becomes an entry for
sceMsgDialogGetResultsaying what it returns and what is not measured on a console (the result and button of a dialog the title closed, the order of the errors, the answer for an unwritable pointer). libSceMsgDialog.native's entry now linksResult.cpp.Overlap:
tools/pr_overlap.py --branch claude/ps4-msgdialog-get-resultagainstmainand the 2009 open pull requests reports three that conflict, none in a function this branch changes, and a merge keeps both sides: #17706 (host message boxes for libSceMsgDialog) changes the sametarget_link_librariesline and adds a debt entry next to the one this branch rewrites; #17729 (host message boxes for libSceMsgDialog.native) adds a debt entry next to thesceMsgDialogGetResultone; #16362 (shared common dialog codes) replaces the constants of libSceMsgDialog.native'sExport.cpp, two of which this branch removes with the function. #17706 and #17729 setg_buttonIdfrom the host box's answer, whichsceMsgDialogGetResultthen returns. #14212, which puts a blank line between all debt entries, conflicts withmainand was not compared.Tested
Windows 11 (10.0.26200.9711) with WSL2 Ubuntu 24.04.5 LTS (kernel 6.18.54.1-microsoft-standard-WSL2), gcc 13.3.0,
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON, test targets only, onmain865323b2a9;maind66e6aac01changes none of the files involved and merges cleanly. No title or console.ctest -R 'msg_dialog|^public_headers$': 6 of 6 pass (msg_dialog_param,msg_dialog_text,msg_dialog_request,guest_msg_dialog,guest_msg_dialog_native,public_headers), andpublic_headers_compile_0to_63pass.guest_msg_dialog's newResultscase:NOT_INITIALIZEDbefore initialize and after terminate,NOT_FINISHEDbefore any dialog and while one runs,ARG_NULLfor null and for0x10; three reads while a dialog without UI runs leave it running at the next status poll; thatYES_NO_FOCUS_NOdialog then returns button 2 with result 0, mode 0 and its 32 reserved bytes cleared over a buffer filled with0x5a; a shown YES/NO dialog returns 2 after Next and Confirm, and 1 after Confirm.MsgDialogResultStatusfailsguest_msg_dialogata result of a running dialog.nm -Dof the builtlibSceMsgDialog.prxandlibSceMsgDialog.native.prxlistssceMsgDialogGetResultin both; its NID bytools/nid_names.py'scompute_nidformula isLr8ovHH9l6A, as shadPS4 registers it.python3 tools/check_conventions.py --base upstream/main: all conventions checks passed.sceGnmDrawInitDefaultHardwareStateto start.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)sceMsgDialogGetResultimport of blocker 4 (not run on the title, which also needs #18087 andsceGnmDrawInitDefaultHardwareState)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-10T21:21:00Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b305987375:tools/check_conventions.pypassed;git diff --checkclean.windows.guest_msg_dialog_testsbuilt cleanly.guest_msg_dialog,guest_msg_dialog_native):Generated withfooter from the description; the AI-assisted checkbox can stay.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-10T21:36:35Z.
Review: DISMISSED
Reviewed — changes requested
The hosted Windows job fails its source-registration audit because the new shared implementation is included by path but the audit does not resolve that include path.
What I ran
Reviewed head
b3059873759d8e6e547ee0898906773025e18bccagainst base87e33ddae62b078c4ef2d3f4deb10f738e226800; the exact head merged cleanly in the local merge preview. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0, CMake 3.25.1. I read all nine changed files and inspected the Windows job log and the source-registration audit.I did not build or run CTest. A later PR comment reports
guest_msg_dialogpassed three Windows runs; I did not reproduce that run.Results
check_test_registrationreports the new shared source as never built.Precheck table and selected unedited output
Conventions stdout:
Windows job log:
The source-registration audit recognizes textual
.cppincludes, but resolves them relative to the including file. Its current regex and resolution are intools/check_test_registration.pyat the base SHA below. The PR includesResult.cppfrom bothExport.cppfiles using aprx/...include-root path, so that check does not find the included file.Negative control
No mutation was made and no exact-head test binary was built, so no negative control was run.
Findings
Blocking
Result.cppis textually included in both libraryExport.cppfiles, so it is compiled as part of those translation units, but the audit resolves the include relative to each source directory and does not find it. Use includes the audit can resolve (for example, a localResult.cppinclude in the native module and a relative../libSceMsgDialog.native/Result.cppinclude in the other module), or update the audit to resolve include directories. Then rerun the Windows job.Non-blocking
None found in the changed implementation after reading all changed files.
Sources
Not verified
guest_msg_dialog. Those are not my runs.To get this to a good state
Adjust the include paths or the audit so the Windows source-registration check recognizes this shared implementation, then rerun that job. I will rerun the same no-build precheck and review the new head.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T02:24:46Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
cb0d599e0b:tools/check_conventions.pypassed;git diff --checkclean.guest_msg_dialog_testsbuilt cleanly.guest_msg_dialog,guest_msg_dialog_native):Generated withfooter from the description; the AI-assisted checkbox can stay.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T18:44:50Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
cb0d599e0b:tools/check_conventions.pypassed;git diff --checkclean.guest_msg_dialog_testsbuilt cleanly.guest_msg_dialog,guest_msg_dialog_native):core/libs/prx/libSceMsgDialog.native/Export.cpp,core/libs/prx/libSceMsgDialog.native/libSceMsgDialog.native.hpp,core/libs/prx/libSceMsgDialog/Export.cpp,core/libs/prx/libSceMsgDialog/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T23:17:24Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
c21e54e802:tools/check_conventions.pypassed;git diff --checkclean.guest_msg_dialog_testsbuilt cleanly.guest_msg_dialog,guest_msg_dialog_native):core/libs/prx/libSceMsgDialog.native/Export.cpp,core/libs/prx/libSceMsgDialog.native/libSceMsgDialog.native.hpp,core/libs/prx/libSceMsgDialog/Export.cpp,core/libs/prx/libSceMsgDialog/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me