Skip to content

XSystemGetConsoleId: the console id in its documented format - #66

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
gefydev:xsystem-console-id-format
Nov 23, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
gefydev:xsystem-console-id-format

Conversation

@gefydev

@gefydev gefydev commented Nov 22, 2026

Copy link
Copy Markdown
Member

XCL's default console id is XCL00000000000000000000000000000000000001, 41 characters. The XSystemGetConsoleId docs say the buffer "must be equal to or greater than the XSystemConsoleIdBytes constant", and give the id's form as 00000000.00000000.00000000.00000000.00, 38 characters. So a title that sizes its buffer the documented way (38 + terminator) gets E_NOT_SUFFICIENT_BUFFER and no console id.

The same page says that on a PC, or in RETAIL, the function always returns 00000000.00000000.00000000.00000000.00. XCL's default sandbox is RETAIL, so that string is now the default (config::CONSOLE_ID). Every xcl.toml created so far has the old default written into it, so load_or_create replaces exactly that value when loading, the same way it adds new default mounts. A console id the user set themselves is kept.

XSystemGetAppSpecificDeviceId hashes the console id, so its value changes once for users who had the old default. Its 16 hex characters already fit XSystemAppSpecificDeviceIdBytes.

Validation

  • system_info now reads the console id into a 39-byte buffer. On main that returns 0x8007007A (E_NOT_SUFFICIENT_BUFFER).
  • New test the_console_id_fits_the_console_id_buffer: the default is 38 characters, an xcl.toml with the old default loads the new one, and a user-set id is kept.
  • cargo test -p xcl --lib: 344 passed, 0 failed, on Windows GNU under Wine.

The default console id was "XCL000…0001", 41 characters. Console ids
are 38 ("00000000.00000000.00000000.00000000.00"), and titles size the
buffer for that (XSystemConsoleIdBytes), so XSystemGetConsoleId failed
with E_NOT_SUFFICIENT_BUFFER. The default is now the id the docs give
for a PC and for RETAIL (XCL's default sandbox); an xcl.toml that still
has the old default gets the new one when loaded.
@ivall
ivall merged commit 5ed035c into xcl-dev:main Nov 23, 2026
ivall added a commit that referenced this pull request Nov 23, 2026
@ivall

ivall commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Merged (5ed035c). Tested on Windows 11 with an RX 9070: cargo test --workspace green with the retail samples (shader pack, console DLLs, texture archive), and Unicorn Overlord reaches its title screen with everything from this round merged. Thanks!

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.

2 participants