Repository navigation
runtime: answer the console-type registry key (ConsoleMode) from LEONIDA_DEVICE_TYPE - #9884
Open
AwkGrep256 wants to merge 1 commit into
Open
AwkGrep256 wants to merge 1 commit into
AwkGrep256 wants to merge 1 commit into
Conversation
…IDA_DEVICE_TYPE The title reads its console type from HKLM\Software\Microsoft\Windows NT\ CurrentVersion\OEM, value ConsoleMode, not from XSystemGetDeviceType. A PC has no such key, so the title saw Pc while the xgameruntime shim reported Series X. advapi32.dll's RegOpenKeyW, RegQueryValueExW and RegCloseKey now answer that one key from XSystemGetDeviceType (LEONIDA_DEVICE_TYPE, default Series X: 0x64); advapi32.dll stays a host DLL, so every other key and name reaches the host's registry. xgameruntime_test checks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resubmitted unchanged: this was #6990, closed at the repository's move to the organisation (the members-only switch, 22:25–22:49 UTC) with no review comment; reopening it is refused. Same branch and head (
dab411220), which merges cleanly onmain7e39a81ea. The test reports from other contributors are on #6990.Claimed in the coordination issue as part of: #6750 (comment) (FSR in the Series X render path; this is its first, standalone step and also matters for RT-5).
What and why
The retail executable does not ask
XSystemGetDeviceTypefor its console type. It reads the registry:RegOpenKeyW(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows NT\CurrentVersion\OEM"), then theREG_DWORDConsoleMode, and maps the value itself (a static look at my own copy, nothing executed;RegOpenKeyW,RegQueryValueExWandRegCloseKeyare its onlyadvapi32.dllimports, and that query isRegOpenKeyW's only caller):ConsoleMode0x600x640x680x58/0x50/0x400x10,0x20,0x21,0x30,0x31A PC has no such key, so under
gta6rtthe title saw Pc whileXSystemGetDeviceType(andLEONIDA_DEVICE_TYPE) said Series X. One thing that hangs on it: the title picks its upscaler from it. Series S gets AMD's FFX upscaler (theamd_fidelityfx_loader_xbox.dllpath), every other type the title's own.The change
runtime/shims/advapi32_registry.cpp(new):RegOpenKeyW,RegQueryValueExWandRegCloseKeyanswer that one key fromXSystemGetDeviceType, looked up in the shim table, so the two can't disagree:0x64by default,0x60withLEONIDA_DEVICE_TYPE=6, no key for1(Pc), as the title's mapping reads them back. The key and value names match case-insensitively. Every other key goes to the host's registry.runtime/shims/registry.cpp:advapi32.dlljoins the host DLLs (owns_dll) likekernel32anduser32, so its other names (and the package DLLs' advapi32 imports) still bind to the host's.runtime/README.md: theLEONIDA_DEVICE_TYPErow says the registry follows it.Tested
Windows cross-build (clang-cl + xwin), run under Wine 11 on CachyOS:
xgameruntime_test: OK, 153 checks. New: the three names are shims andadvapi32.dllstays a host DLL;ConsoleModeis0x64by default and0x60withLEONIDA_DEVICE_TYPE=6;1gives no key; case-insensitive key; a size query gives 4; a 2-byte buffer getsERROR_MORE_DATAand 4; another value isERROR_FILE_NOT_FOUND; another key opens and closes in the host's registry.ctest -R "loader|pe_loader|xmem|process_cmdline|winhttp_offline|run_tiny|xgameruntime": 30 of 31 pass.run_tiny_game_abort_exit_codesfails the same way onmain1cc6e3c1under Wine (nativeabortexit codes), so it's unrelated.--run(it doesn't reach the query yet on Linux), native Windows.Nothing from the executable is in the repository or here: only the import names, the public registry path the GDK uses, and the value mapping.
AI-assisted (Claude Code).
🤖 Generated with Claude Code