Files
psxrecomp/tools/duckstation/launch.py
Matthew Stanley 957256134b duckstation oracle: fix headless boot — rcc target + first-run wizard
Root-caused the post-rebuild boot failure:

1. MSBuild's duckstation-qt target does NOT include the Qt resource compile.
   The separate duckstation-qt-rcc target produces
   build/bin/resources/duckstation-qt.rcc (~740 KB). Without it the binary
   shows a "duckstation-qt.rcc could not be loaded" dialog and exits.
   build.sh now builds both targets in one MSBuild invocation.

2. A first-time GUI launch is also required so DuckStation's setup wizard
   can write out a working settings.ini. Our auto-generated settings.ini
   (with SetupWizardIncomplete=false etc.) is insufficient — the wizard
   records other fields (probably Graphics API init, controller profile,
   achievement opt-out) that are needed for headless emulation to start.
   Thanks to mstanley for running the wizard interactively.

After those two fixes, verified end-to-end:
- `python3 tools/duckstation/launch.py -bios -nogui -fastboot` runs
- port 4371 binds
- read_ram 0x00079D9C returns an incrementing VSync counter
- read_ram 0x000DFEE0 returns 0x8005A5BC (VBlank chain handler — patch live)
- pc_break_list responds (proves my compile-but-untested pc_break family
  from the uncommitted additions is now tested via embedded binary)

tools/duckstation/launch.py — detached-spawn wrapper (uses
CREATE_NEW_PROCESS_GROUP only, no DETACHED_PROCESS so the GUI stays
visible on first-run). Moved from tools/launch_ds_detached.py to live
alongside setup.sh / build.sh / README.md.

README updated to replace the "known issue" section with the correct
recovery steps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 08:49:45 -07:00

24 lines
891 B
Python

"""Launch duckstation-qt.exe so it survives the parent shell exiting.
Uses CREATE_NEW_PROCESS_GROUP (no DETACHED_PROCESS) so the GUI window stays
visible — important for the one-time setup-wizard walkthrough.
Usage:
python3 tools/duckstation/launch.py # GUI (first run / wizard)
python3 tools/duckstation/launch.py -bios -nogui -fastboot # headless oracle
"""
import subprocess, os, sys, pathlib
REPO_ROOT = pathlib.Path(__file__).resolve().parents[2]
BIN = REPO_ROOT / "duckstation" / "build" / "bin"
EXE = BIN / "duckstation-qt.exe"
if not EXE.exists():
sys.stderr.write(f"not found: {EXE}\nrun tools/duckstation/build.sh first\n")
sys.exit(1)
args = [str(EXE)] + sys.argv[1:]
CREATE_NEW_PROCESS_GROUP = 0x200
subprocess.Popen(args, cwd=str(BIN), creationflags=CREATE_NEW_PROCESS_GROUP, close_fds=True)
print(f"spawned: {' '.join(args)}")