xgameruntime: add XAccessibility closed caption and high contrast fallback #85
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!85
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/85/head"
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?
@certified-retart on GitHub · 2026-11-23 02:12 UTC · original
certified-retart:feat/xaccessibility-apis→main· +278 −0 · 3 files · 1 commits · merged 2026-11-23 10:36 UTCSummary
Implements offline/fallback support for the GDK
XAccessibilityclosed-caption and high-contrast APIs (XAccessibility.h):crates/xcl/src/hle/xgameruntime/accessibility.rs:#[repr(C, align(4))] XColor(A, R, G, B) and 28-byteXClosedCaptionPropertiesstructs with explicitly zeroed trailing padding.XClosedCaptionGetProperties,XClosedCaptionSetEnabled(takingu8at the FFI boundary to normalize any non-zero C/C++ byte safely without RustboolUB), andXHighContrastGetMode(querying Win32SystemParametersInfoW(SPI_GETHIGHCONTRAST)and classifying active themes viaGetSysColor(COLOR_WINDOW)luminance, returningE_FAILon OS query failure).crates/xcl/src/hle/xgameruntime/mod.rs:XClosedCaptionGetProperties,XClosedCaptionSetEnabled, andXHighContrastGetModeby name inexports().crates/xcl/src/hle/xgameruntime/api.rs:xcl_xaccessibility_object()and wiresNone if c == XACCESSIBILITYinQueryApiImplas a built-in fallback whenSystem32\xgameruntime.dllis not installed (matching the existingXAsyncfallback pattern). When Gaming Services is present on the host,QueryApiImplcontinues to delegate directly to the native PC runtime so host Windows caption settings, custom high-contrast themes, andXSpeech*remain untouched.XGameRuntimeIsFeatureAvailable(0)(XAccessibility) already returnedtrue; this ensures titles queryingXAccessibilitywithoutSystem32\xgameruntime.dllor importing the functions directly do not hitREGDB_E_CLASSNOTREG/ unresolved imports.Testing
XColor/XClosedCaptionPropertiessizes, alignments, field offsets, raw ARGB byte layout, null-pointerE_INVALIDARG, poisoned-buffer zero-padding verification, non-zerou8normalization,XHighContrastModeluma classification & OS query, andxcl_xaccessibility_object()COM vtable dispatch (slots 3..=5 +E_NOTIMPLon slot 6).cargo test -p xcl --lib hle::xgameruntime -- --test-threads=2: 44 passed; 0 failed.github-bot referenced this pull request2026-11-26 04:31:24 +00:00
@ivall on GitHub · 2026-11-23 10:36 UTC · original
Merged. Tested on Windows 11 with an RX 9070 (RDNA4):
cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), lib tests also withXCL_SPLIT_WAVE64=1; Unicorn Overlord, Minecraft and Fortnite run with this round merged. Thanks!