Skip to content

xgameruntime: serve XAccessibilityImpl offline through QueryApiImpl - #4235

Open
Vonsek wants to merge 3 commits into
ItsNotRexed:mainfrom
Vonsek:claude/rt-accessibility
Open

Vonsek wants to merge 3 commits into
ItsNotRexed:mainfrom
Vonsek:claude/rt-accessibility

Conversation

@Vonsek

@Vonsek Vonsek commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Requested by Lucas · project thread

Claimed in the coordination issue as: EGEN-RT-ACCESSIBILITY, #4084 (comment)

What and why

QueryApiImpl refused XAccessibilityImpl (class 3e241977-6237-41e9-8559-102c2d9983f1), so a title's first XClosedCaptionGetProperties, XHighContrastGetMode or XSpeechToText* call failed with ERROR_NOT_SUPPORTED. It now serves the class and IXAccessibilityImpl2 offline, in runtime/shims/xgameruntime_accessibility.cpp, hooked in with one line in QueryApiImpl. The 19 slots follow xgameruntime-docs' layout; signatures follow the public GDK reference. No package DLL calls any of them, so the slots are not measured against a caller (docs/runtime_imports.md says so).

A PC with no console accessibility settings answers like a console with everything off:

  • closed captions: off, scale 1, white font, until the title calls XClosedCaptionSetEnabled, which the next XClosedCaptionGetProperties reports;
  • high contrast: Off;
  • speech-to-text: accepted and dropped (the title's text is not logged); Begin hands out an id that Update/Finalize/Cancel check;
  • speech synthesizer: no voice installed, so the enumeration calls back zero times, handles can be created and closed, and anything that would produce audio fails with HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED).

XColor's byte layout is not in the pages read; only the font colour (all 0xFF, the same in any channel order) is filled in.

Touches runtime/shims/xgameruntime.cpp (6 lines) and the source lists in runtime/CMakeLists.txt and scripts/build_runtime.ps1. #3657 does the same for XGameUiImpl in its own file; the two should merge with a trivial conflict at the QueryApiImpl loop.

Tested

Windows 11, MSVC 2022 Build Tools, RelWithDebInfo. No GPU involved.

  • xgameruntime_accessibility_test (new, registered as ctest xgameruntime_accessibility): 45 checks, 0 failures. It calls every slot through QueryApiImpl the way the thunks do, and checks the ids against the text the docs print.
  • xgameruntime_test: OK (106 checks); gta6rt builds.
  • Negative control: changing *mode = kHighContrastOff to *mode = 1 makes XHighContrastGetMode reports Off (0) fail (45 checks, 1 failure); reverted.
  • tests/test_build_runtime_batch.py, test_build_runtime_fallback.py, test_ctest_registration.py, test_cmake_vulkan_missing.py: OK.

AI-assisted.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

QueryApiImpl now serves XAccessibilityImpl (IXAccessibilityImpl and 2, 19
methods in xgameruntime-docs' order): closed captions report off until the
title sets them, high contrast is Off, speech-to-text calls are accepted and
dropped with hypothesis ids tracked, and the speech synthesizer has no
installed voice (handles work, stream creation is not supported).
xgameruntime_accessibility_test calls every slot.

AI-assisted.
@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Independent check of 07070dab on a second toolchain: clang-cl 21 cross-build (xwin, Windows SDK 10.0.26100, RelWithDebInfo), run under Wine 11 on Ubuntu 22.04. No GPU involved.

  • xgameruntime_accessibility_test: 45 checks, 0 failures, in 3 of 3 runs.
  • xgameruntime_test: OK (106 checks). gta6rt.exe links with the new file.
  • No new warnings under /W4 from the new file or test.
  • All three CMake source lists that compile shims/xgameruntime.cpp (gta6rt, xgameruntime_test and the new test) also add xgameruntime_accessibility.cpp, and so does the cl.exe fallback in build_runtime.ps1. So nothing links QueryApiImpl without the new hook.

AI-assisted (Devin).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built xgameruntime_accessibility_test at 07070dab on Windows 11 and ran it: 45 checks, 0 failures, exit 0; ctest -R xgameruntime_accessibility -> 1/1 passed (0.01 s).

The shim answers the XAccessibilityImpl QueryApiImpl surface offline: the speech synthesizer create/set-voice/close paths, the "not supported" stream-creation results that clear the handle, null-handle and double-close E_INVALIDARGs, and the closed-synthesizer case all match the checks. No blocking issue.

@sh1shu1

sh1shu1 commented Nov 23, 2026

Copy link
Copy Markdown

Tested 07070da on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main aa2988c.

  • ctest: 154/154 passed, same 9 skips as main aa2988c
  • xgameruntime_accessibility: 1/1
  • run_gpu_tests (LEONIDA_VK_VALIDATION=1): 164/210 native, 195/210 with LEONIDA_W64_EMULATE=1, 0 failed; identical to main aa2988c
    AI-assisted (Claude Code, Claude Fable 5.1).

Conflicts: docs/runtime_imports.md, runtime/CMakeLists.txt,
runtime/shims/xgameruntime.cpp, scripts/build_runtime.ps1

AI-assisted.
Conflicts: docs/runtime_imports.md

AI-assisted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants