feat(xgameruntime): add the XGameInvite, XAccessibility and XSpeechSynthesizer HLE #45

Open
github-bot wants to merge 3 commits from github-bot/gh-45 into main AGit
Owner

@⁠wildheathen on GitHub · 2026-11-21 20:34 UTC · original
wildheathen:feat/invite-accessibility-speech → main · +652 −0 · 8 files · 3 commits · open

Summary

Adds three small GDK families to xgameruntime as offline, deterministic HLE, one commit per family. They have no overlap with the open XUser / XGameSave / XMem work, and each one lives in its own files.

  • XGameInvite (XGameInviteRegisterForEvent, XGameInviteUnregisterForEvent): no invite can arrive, so registering returns a valid task-queue token, the callback never fires, and unregistering accepts the token exactly once. Both functions are marked deprecated on their public pages ("Use XGameActivationRegisterForEvent instead"); XGameActivation is not part of this PR.
  • XAccessibility (8 of the 9 public functions): XClosedCaptionSetEnabled, XHighContrastGetMode (always Off: there is no display setting here), XSpeechToTextSendString, XSpeechToTextSetPositionHint (the eight positions are validated), and the hypothesis cycle Begin/Update/Finalize/Cancel. An unknown or expired hypothesisId is not an error, as the pages document ("Passing an invalid hypothesisId value does not return an error"). XClosedCaptionGetProperties is left out: XClosedCaptionProperties contains XColor, which has no public page, so its layout cannot be reproduced without guessing.
  • XSpeechSynthesizer (all 10 functions): no speech engine, so no voice is installed (the enumeration callback never fires) and every stream is a valid handle of size zero. XSpeechSynthesizerGetStreamData with an invalid stream handle returns HRESULT_FROM_WIN32(ERROR_NOT_FOUND), as documented. XSpeechSynthesizerVoiceInformation stays an incomplete type: it is only ever received by the callback and its fields are not public. Closing a handle that does not carry our magic is refused instead of freed.

Signatures, enum values and documented return codes come from the public reference pages on learn.microsoft.com (gdk-2610 view); I re-read the three enums (XHighContrastMode, XSpeechToTextType, XSpeechToTextPositionHint) and the function pages against the header before opening this (all of them except the XSpeechSynthesizerCloseStreamHandle page).

Choices the public pages do not cover

These are ours, marked as such in the code comments: E_INVALIDARG for XSpeechSynthesizerSetCustomVoice with an unknown voice id (none is ever enumerable), E_INVALIDARG for GetStreamData with a null buffer and a non-zero size, and E_POINTER for XHighContrastGetMode(nullptr).

Layout

src/shims/xgr_invite.cpp, xgr_accessibility.cpp, xgr_speech.cpp (registered in CMakeLists.txt) and one test per family: test_xgameinvite, test_xaccessibility, test_xspeechsynthesizer. The header gets three new sections placed before the XMem.h section. Nothing in xgameruntime_shim.cpp or test_xgameruntime_abi.cpp changes. The three commits are independent, so they can be taken separately.

Verification

  • Built with MSVC + Ninja x64. Each commit builds and passes its own test; the full suite after the last commit is 23/26, where the three failures (test_boot_hello_scarlett, test_boot_rt_showcase, test_d3d12_guest_texture) are the ones that already fail on an unmodified origin/main (see #1 and #2).
  • Checked that no other open PR adds any of these functions.
**@⁠wildheathen** on GitHub · 2026-11-21 20:34 UTC · [original](https://github.com/Freminet/ScarlettX/pull/45) `wildheathen:feat/invite-accessibility-speech` → `main` · +652 −0 · 8 files · 3 commits · open ## Summary Adds three small GDK families to `xgameruntime` as offline, deterministic HLE, one commit per family. They have no overlap with the open XUser / XGameSave / XMem work, and each one lives in its own files. - **XGameInvite** (`XGameInviteRegisterForEvent`, `XGameInviteUnregisterForEvent`): no invite can arrive, so registering returns a valid task-queue token, the callback never fires, and unregistering accepts the token exactly once. Both functions are marked deprecated on their public pages ("Use XGameActivationRegisterForEvent instead"); `XGameActivation` is not part of this PR. - **XAccessibility** (8 of the 9 public functions): `XClosedCaptionSetEnabled`, `XHighContrastGetMode` (always `Off`: there is no display setting here), `XSpeechToTextSendString`, `XSpeechToTextSetPositionHint` (the eight positions are validated), and the hypothesis cycle `Begin`/`Update`/`Finalize`/`Cancel`. An unknown or expired `hypothesisId` is not an error, as the pages document ("Passing an invalid hypothesisId value does not return an error"). `XClosedCaptionGetProperties` is left out: `XClosedCaptionProperties` contains `XColor`, which has no public page, so its layout cannot be reproduced without guessing. - **XSpeechSynthesizer** (all 10 functions): no speech engine, so no voice is installed (the enumeration callback never fires) and every stream is a valid handle of size zero. `XSpeechSynthesizerGetStreamData` with an invalid stream handle returns `HRESULT_FROM_WIN32(ERROR_NOT_FOUND)`, as documented. `XSpeechSynthesizerVoiceInformation` stays an incomplete type: it is only ever received by the callback and its fields are not public. Closing a handle that does not carry our magic is refused instead of freed. Signatures, enum values and documented return codes come from the public reference pages on learn.microsoft.com (`gdk-2610` view); I re-read the three enums (`XHighContrastMode`, `XSpeechToTextType`, `XSpeechToTextPositionHint`) and the function pages against the header before opening this (all of them except the `XSpeechSynthesizerCloseStreamHandle` page). ## Choices the public pages do not cover These are ours, marked as such in the code comments: `E_INVALIDARG` for `XSpeechSynthesizerSetCustomVoice` with an unknown voice id (none is ever enumerable), `E_INVALIDARG` for `GetStreamData` with a null buffer and a non-zero size, and `E_POINTER` for `XHighContrastGetMode(nullptr)`. ## Layout `src/shims/xgr_invite.cpp`, `xgr_accessibility.cpp`, `xgr_speech.cpp` (registered in `CMakeLists.txt`) and one test per family: `test_xgameinvite`, `test_xaccessibility`, `test_xspeechsynthesizer`. The header gets three new sections placed before the `XMem.h` section. Nothing in `xgameruntime_shim.cpp` or `test_xgameruntime_abi.cpp` changes. The three commits are independent, so they can be taken separately. ## Verification - Built with MSVC + Ninja x64. Each commit builds and passes its own test; the full suite after the last commit is `23/26`, where the three failures (`test_boot_hello_scarlett`, `test_boot_rt_showcase`, `test_d3d12_guest_texture`) are the ones that already fail on an unmodified `origin/main` (see #1 and #2). - Checked that no other open PR adds any of these functions.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:56:51 +00:00
This pull request has changes conflicting with the target branch.
  • include/scarlettx/gdk/xgameruntime_abi.h
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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