xgameruntime: add XAccessibility closed caption and high contrast fallback #84
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/85"
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 ivall/xcl. Originally posted by certified-retart on 2026-11-23T02:12:28Z.
Summary
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.Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T10:36:38Z.
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!