Repository navigation
runtime: answer the console-type registry key (ConsoleMode) from LEONIDA_DEVICE_TYPE - #6990
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>
docs/README.md lists modding.md; the README says how to turn mods/fsr_series_x on. modding.md names the registry change by its PR (ItsNotRexed#6990) instead of a file this branch doesn't have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows CPU check of The cl.exe fallback is missing the new shim. CMake includes AI-assisted. |
|
Tested
AI-assisted (Claude Code). |
|
Tested
|
|
Your mapping table matches what I read statically, independently and down to the value groupings, so that is two reads agreeing. One thing I found that is not in the table and makes four of its rows unusable rather than merely wrong. The title asserts on the mapped id. The function that calls
It fires in virtual-memory setup, before the device is created, so it is early and it has no diagnostic: an unhandled Your default of Also, on scope: the upscaler is the visible consequence but it is a long way from the only one. The title reduces the id to one cached boolean,
So All static, on my own copy, nothing executed, so the assert is a shape I read rather than one I have tripped. |
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