feat(xgameruntime): add the XDisplay HLE (HDR mode and timeout deferral) #41

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

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

Summary

Adds the public XDisplay functions (XDisplay.h) to xgameruntime as an offline HLE:

  • XDisplayTryEnableHdrMode(XDisplayHdrModePreference, XDisplayHdrModeInfo*): the emulated output is SDR, so it returns Disabled and zeroes the info structure when one is passed.
  • XDisplayAcquireTimeoutDeferral(XDisplayTimeoutDeferralHandle*) / XDisplayCloseTimeoutDeferralHandle(...): each acquire hands out its own handle (nothing ever times out); a null output pointer is E_INVALIDARG; closing null is a no-op.

Enums are exposed as uint32_t plus constants, like the rest of xgameruntime_abi.h. Signatures and values from the public XDisplay reference pages (learn.microsoft.com, gdk-2610).

Layout

New files, so the change does not overlap the open XUser / XGameSave / XMem work: src/shims/xgr_display.cpp (registered in CMakeLists.txt) and tests/test_xdisplay.cpp (new test_xdisplay target). The header gets one hunk, a new // XDisplay.h section; xgameruntime_shim.cpp and test_xgameruntime_abi.cpp are untouched.

Verification

  • Built with MSVC + Ninja x64. Full suite: test_xdisplay 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/41) `wildheathen:feat/xdisplay` → `main` · +124 −0 · 4 files · 1 commits · open ## Summary Adds the public `XDisplay` functions (`XDisplay.h`) to `xgameruntime` as an offline HLE: - `XDisplayTryEnableHdrMode(XDisplayHdrModePreference, XDisplayHdrModeInfo*)`: the emulated output is SDR, so it returns `Disabled` and zeroes the info structure when one is passed. - `XDisplayAcquireTimeoutDeferral(XDisplayTimeoutDeferralHandle*)` / `XDisplayCloseTimeoutDeferralHandle(...)`: each acquire hands out its own handle (nothing ever times out); a null output pointer is `E_INVALIDARG`; closing null is a no-op. Enums are exposed as `uint32_t` plus constants, like the rest of `xgameruntime_abi.h`. Signatures and values from the public XDisplay reference pages (learn.microsoft.com, `gdk-2610`). ## Layout New files, so the change does not overlap the open XUser / XGameSave / XMem work: `src/shims/xgr_display.cpp` (registered in `CMakeLists.txt`) and `tests/test_xdisplay.cpp` (new `test_xdisplay` target). The header gets one hunk, a new `// XDisplay.h` section; `xgameruntime_shim.cpp` and `test_xgameruntime_abi.cpp` are untouched. ## Verification - Built with MSVC + Ninja x64. Full suite: `test_xdisplay` 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:47 +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/41/head:github-bot/gh-41'
git switch 'github-bot/gh-41'

Merge

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