From 7dbb24e64f9e8a41b54ace39489f9e33b16cfe34 Mon Sep 17 00:00:00 2001 From: Sylpheed RE agent Date: Tue, 18 Aug 2026 20:15:35 +0000 Subject: [PATCH] [RE] --create_profile_if_none: bootstrap a profile for scripted runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The title screen's (A) opens the Sign In dialog when no profile exists, and the game goes no further. That dialog cannot be completed from a scripted container: "Create Profile" asks for a gamertag in an ImGui text field, and synthetic X key events do not reach it — tried with the window focused, via XTEST and via --window, char by char, after clicking the field. Mouse clicks work; text entry does not. So: when no profile exists on disk and this cvar is set, create one at startup and sign it in. It uses ProfileManager's fixed `default_xuid` (B13EBABEBABEBABE), which is what makes it usable from a script — a later run passes --logged_profile_slot_0_xuid=B13EBABEBABEBABE and is deterministic. Ignored when a profile already exists, so it is safe to leave in a launcher. Verified: "RE bootstrap profile 'SylphRE' -> created", then on the next boot "Found 1 Profiles" / "Loaded SylphRE (GUID: B13EBABEBABEBABE) to slot 0". This does NOT get the game past the title — see the Reborn repo's docs/re/canary-scripted-input-traps.md for what does and does not, and for the content-path crash that is the actual blocker. --- src/xenia/kernel/xam/profile_manager.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/xenia/kernel/xam/profile_manager.cc b/src/xenia/kernel/xam/profile_manager.cc index 33bb26479..66535d619 100644 --- a/src/xenia/kernel/xam/profile_manager.cc +++ b/src/xenia/kernel/xam/profile_manager.cc @@ -27,6 +27,16 @@ DEFINE_string(logged_profile_slot_2_xuid, "", DEFINE_string(logged_profile_slot_3_xuid, "", "XUID of the profile to load on boot in slot 3", "Profiles"); +DEFINE_string( + create_profile_if_none, "", + "Reverse-engineering aid: if no profile exists on disk, create one with " + "this gamertag at startup and sign it in. Without a signed-in profile the " + "title screen's (A) opens the Sign In dialog and the game goes no further, " + "and this container has no way to type a gamertag into it: the dialog is " + "an ImGui text field and synthetic X key events never reach it. Ignored " + "when a profile already exists.", + "Profiles"); + namespace xe { namespace kernel { namespace xam { @@ -105,6 +115,17 @@ ProfileManager::ProfileManager(KernelState* kernel_state, LoadAccount(account_xuid); } + // RE aid: bootstrap a profile for scripted runs (see the cvar's help). The + // fixed XUID is what makes it usable from a script — `default_xuid` gives + // 0xB13EBABEBABEBABE every time, so a run can pass + // --logged_profile_slot_0_xuid=B13EBABEBABEBABE and be deterministic. + if (accounts_.empty() && !cvars::create_profile_if_none.empty()) { + const bool ok = + CreateProfile(cvars::create_profile_if_none, true, true); + XELOGI("ProfileManager: RE bootstrap profile '{}' -> {}", + cvars::create_profile_if_none, ok ? "created" : "FAILED"); + } + if (!cvars::logged_profile_slot_0_xuid.empty()) { Login(xe::string_util::from_string( cvars::logged_profile_slot_0_xuid, true),