Skip to content

First-run disc image installer: pick your ISO, everything else is automatic - #4

Open
Alexbeav wants to merge 2 commits into
psxrestore:mainfrom
Alexbeav:first-run-iso-installer
Open

First-run disc image installer: pick your ISO, everything else is automatic#4
Alexbeav wants to merge 2 commits into
psxrestore:mainfrom
Alexbeav:first-run-iso-installer

Conversation

@Alexbeav

@Alexbeav Alexbeav commented Aug 6, 2026

Copy link
Copy Markdown

First-run disc image installer: pick your ISO, everything else is automatic

What this does

Fresh installs currently require the user to produce the extracted Assets/ tree themselves (extract-xiso / xdvdfs) before the game will boot. This PR teaches condemned2recomp.exe to do it: when Assets/default.xex is missing at startup, a full-screen wizard asks for the user's Condemned 2: Bloodshot Xbox 360 disc image and extracts the XDVDFS game partition straight into game_data_root, with byte progress. The typical first run becomes exactly one user action:

run condemned2recomp.exe → select your .iso → wait ~2 minutes → playing.

Same first-run installer pattern as LittleBitUA/DownpourRecomp (LittleBitUA/DownpourRecomp#27) and mchughalex/skate3recomp — Condemned 2 is simpler since there is no Title Update step to chain.

Details

  • src/condemned2recomp_iso_installer.{h,cpp} — new. A minimal read-only XDVDFS (GDF) reader: directory tables are AVL trees of 4-byte-aligned entries, files are contiguous sector runs, so extraction is a seek + copy per file, sorted by disc position for sequential reads. Supports Redump-style full images (game partition at 0xFD90000 — what Condemned 2's XGD2 disc uses), XGD3 (0x2080000), and bare game-partition dumps (offset 0). Rejects images with no default.xex at the partition root with a clear message, separating "wrong/bad dump" from "broken install" at the earliest possible point.
  • Resumable: files already present with the right size are skipped, and default.xex — the install-complete marker IsGameDataInstalled keys off — is extracted last, so an interrupted extraction re-opens the installer on the next launch and finishes the remaining files in under a second instead of booting with a partial tree.
  • $SystemUpdate skipped — the disc's dashboard update payload is meaningless to the recomp, so it never lands in Assets/.
  • Free-space check up front (needs ~7 GiB).
  • OnConfigurePaths now defaults game_data_root to Assets/ even when the game files are not there yet, so the installer knows where to extract; OnFinalizePaths gates the boot: game data present → boot, missing → wizard. It also honors CONDEMNED2_INSTALL_ISO=<path> for headless/unattended installs.
  • src/ui/wizard_screen.{h,cpp}, src/ui/acquire_wizard_dialog.{h,cpp} — the wizard UI, vendored from the ReXGlue SDK overlay the other recomps use (mchughalex/rexglue-skate3, LittleBitUA/rexglue-sdk-dpour). This repo builds against the stock SDK 0.9.0, which doesn't ship it yet; the files are kept in rex::ui with attribution notes so they can be dropped verbatim once the stock SDK gains the overlay. Two local changes: the stock ImGuiDrawer has no ui_font*() accessors, and the stock SDK only registers a 10 px bitmap font — so ConfigureWizardFonts() (wired through the existing OnConfigureFonts hook) loads the platform UI font (Segoe UI on Windows, DejaVu/Noto/Liberation on Linux) with a clean fallback to the default font.
  • Linux note: the file picker uses the same GTK path as the other recomps' installers; untested here, same status as the project's Linux build.

Testing

Built against the prebuilt rexglue-sdk v0.9.0 win-amd64 release package with Clang 22, Windows 11, RTX 4070 Ti, USA/Europe Redump image (7.3 GiB, game partition 86 files / 6.78 GiB):

  • Fresh headless install (CONDEMNED2_INSTALL_ISO=<path>, empty Assets/): full extraction — 85 files, 6935 MiB in ~110 s ($SystemUpdate correctly skipped) — then the runtime constructs and the game boots straight to gameplay. Fully unattended.
  • Interrupted-install resume: with default.xex and one other file removed to simulate a mid-extraction kill, relaunch restored exactly the missing files in 0.5 s (83 files skipped by the size check) and booted.
  • Negative path: pointing CONDEMNED2_INSTALL_ISO at a non-ISO file logs The selected file is not an Xbox 360 disc image (no XDVDFS game partition found) and falls through to the wizard, which shows the pick-your-ISO screen with the install directory row.
  • Already installed: subsequent launches skip the installer and boot straight to the game.
  • The XDVDFS layout handling (partition base detection, AVL walk, sector math) was additionally validated standalone against the real Redump image before being wired into the wizard. The interactive wizard path shares InstallGameDataFromIso with the headless path.

Fresh installs no longer need a manual extract-xiso/xdvdfs run: when
Assets/default.xex is missing at startup, an installer wizard asks for the
user's Condemned 2: Bloodshot disc image and extracts its XDVDFS game
partition into the Assets folder, then restarts into the game.

- Minimal read-only XDVDFS (GDF) reader; accepts Redump full images (game
  partition at 0xFD90000), XGD3 images (0x2080000), and bare partition dumps.
- Resumable: files already present with the right size are skipped, and
  default.xex is written last so it doubles as the install-complete marker.
- Skips the disc's $SystemUpdate dashboard payload and validates free disk
  space before extracting.
- CONDEMNED2_INSTALL_ISO env var installs headlessly for unattended setups.
- Wizard UI (wizard_screen, acquire_wizard_dialog) vendored from the ReXGlue
  SDK overlay used by other recomps; drop once the stock SDK ships it.

Mirrors the disc image installer of LittleBitUA/DownpourRecomp and
mchughalex/skate3recomp.
The stock SDK only registers a 10 px bitmap font, which upscales poorly to
the wizard's heading sizes. Load the platform UI font (Segoe UI on Windows,
DejaVu/Noto/Liberation on Linux) through the OnConfigureFonts hook, falling
back to the default font when none is found. Also drop a non-ASCII dash the
default font cannot render from the wizard intro.
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.

1 participant