feat(xgameruntime): add the XLauncher and XGameUI HLE #42

Open
github-bot wants to merge 1 commit from github-bot/gh-42 into main AGit
Owner

@⁠wildheathen on GitHub · 2026-11-21 19:28 UTC · original
wildheathen:feat/xgameui-xlauncher → main · +917 −0 · 4 files · 1 commits · open

Summary

Adds the XLauncher and XGameUI functions (XLauncher.h, XGameUI.h) to xgameruntime as an offline HLE. Nothing is drawn: every system window completes its XAsyncBlock immediately, as if the player had dismissed it.

  • XLauncher: XLaunchUri validates the URI, logs it when SCARLETTX_TRACE is set and returns S_OK without opening anything.
  • Message and error dialogs: XGameUiShowMessageDialogAsync/Result completes with the default button; XGameUiShowErrorDialogAsync/Result.
  • System windows without a result: achievements, player profile card, send game invite, multiplayer activity game invite, state share (Async/Result pairs), and XGameUiSetNotificationPositionHint. They check the documented required arguments (async block, user, _In_z_ strings).
  • Player picker: XGameUiShowPlayerPickerAsync/ResultCount/Result returns the pre-selected players, capped at maxSelectionCount.
  • Text entry: XGameUiShowTextEntryAsync/ResultSize/Result returns defaultText truncated to maxTextLength (1024 when 0 or for a password scope), and the in-game virtual keyboard lifecycle (XGameUiTextEntryOpen/Close/GetState/GetExtents/UpdatePositionHint/UpdateVisibility). The HLE keyboard never receives input, so the text and the change type never move, and maxLength above 32K is E_INVALIDARG as documented.

Enums are exposed as uint32_t plus constants. Signatures and values come from the public reference pages (learn.microsoft.com, gdk-2610); I re-read the XGameUiTextEntry* struct and enum pages against the header before opening this.

Layout

New files, so the change does not overlap the open XUser / XGameSave / XMem work: src/shims/xgr_gameui.cpp (registered in CMakeLists.txt) and tests/test_xgameui.cpp (new test_xgameui target, which signs in the default user to get a real XUserHandle). The header gets one hunk, a new // XLauncher.h + // XGameUI.h section; xgameruntime_shim.cpp and test_xgameruntime_abi.cpp are untouched.

Verification

  • Built with MSVC + Ninja x64. Full suite: test_xgameui passes and everything else passes except the three tests that already fail on an unmodified origin/main (test_boot_hello_scarlett, test_boot_rt_showcase, test_d3d12_guest_texture; see #1 and #2).
**@⁠wildheathen** on GitHub · 2026-11-21 19:28 UTC · [original](https://github.com/Freminet/ScarlettX/pull/42) `wildheathen:feat/xgameui-xlauncher` → `main` · +917 −0 · 4 files · 1 commits · open ## Summary Adds the `XLauncher` and `XGameUI` functions (`XLauncher.h`, `XGameUI.h`) to `xgameruntime` as an offline HLE. Nothing is drawn: every system window completes its `XAsyncBlock` immediately, as if the player had dismissed it. - **XLauncher**: `XLaunchUri` validates the URI, logs it when `SCARLETTX_TRACE` is set and returns `S_OK` without opening anything. - **Message and error dialogs**: `XGameUiShowMessageDialogAsync/Result` completes with the default button; `XGameUiShowErrorDialogAsync/Result`. - **System windows without a result**: achievements, player profile card, send game invite, multiplayer activity game invite, state share (Async/Result pairs), and `XGameUiSetNotificationPositionHint`. They check the documented required arguments (async block, user, `_In_z_` strings). - **Player picker**: `XGameUiShowPlayerPickerAsync/ResultCount/Result` returns the pre-selected players, capped at `maxSelectionCount`. - **Text entry**: `XGameUiShowTextEntryAsync/ResultSize/Result` returns `defaultText` truncated to `maxTextLength` (1024 when 0 or for a password scope), and the in-game virtual keyboard lifecycle (`XGameUiTextEntryOpen/Close/GetState/GetExtents/UpdatePositionHint/UpdateVisibility`). The HLE keyboard never receives input, so the text and the change type never move, and `maxLength` above 32K is `E_INVALIDARG` as documented. Enums are exposed as `uint32_t` plus constants. Signatures and values come from the public reference pages (learn.microsoft.com, `gdk-2610`); I re-read the `XGameUiTextEntry*` struct and enum pages against the header before opening this. ## Layout New files, so the change does not overlap the open XUser / XGameSave / XMem work: `src/shims/xgr_gameui.cpp` (registered in `CMakeLists.txt`) and `tests/test_xgameui.cpp` (new `test_xgameui` target, which signs in the default user to get a real `XUserHandle`). The header gets one hunk, a new `// XLauncher.h` + `// XGameUI.h` section; `xgameruntime_shim.cpp` and `test_xgameruntime_abi.cpp` are untouched. ## Verification - Built with MSVC + Ninja x64. Full suite: `test_xgameui` passes and everything else passes except the three tests that already fail on an unmodified `origin/main` (`test_boot_hello_scarlett`, `test_boot_rt_showcase`, `test_d3d12_guest_texture`; see #1 and #2).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:56:48 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/42/head:github-bot/gh-42'
git switch 'github-bot/gh-42'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-42'
git switch 'github-bot/gh-42'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-42'
git switch 'github-bot/gh-42'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-42'
git switch 'main'
git merge --squash 'github-bot/gh-42'
git switch 'main'
git merge --ff-only 'github-bot/gh-42'
git switch 'main'
git merge 'github-bot/gh-42'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.