Files
psxrecomp/runtime
Matthew Stanley b0f514c57e feat(bios): pick the BIOS at runtime — OpenBIOS unless the player chose one
Implements docs/BIOS_SELECTION.md on top of the backend ABI. One build
now carries both images and decides at startup, so the per-BIOS build
flavour (and its three uncross-checked restatements) is gone.

  - runtime.cmake takes PSXRECOMP_BIOS_STEMS (default "OpenBIOS;SCPH1001")
    and generates psx_bios_registry.c from it, so the stem list is the
    single source of truth for what a build carries.
  - [runtime] openbios (default true) records whether a title may use the
    bundled image. Not exposed to settings.toml: it is a developer's
    compatibility finding, not a player preference.
  - Selection: an explicit choice that matches a linked image wins;
    otherwise the bundled image; otherwise prompt. A mismatched explicit
    choice is explained and falls back to OpenBIOS when the title allows
    it, instead of dead-ending.
  - validate_bios_for_launch now ASKS WHICH backend an image is, rather
    than checking against one hardcoded identity, and activates it.

Crucially, "no BIOS" means "the player chose none" — not "no BIOS file
was discoverable". The compile-time DEFAULT_BIOS_PATH is no longer
treated as a choice: it made a stray file near the executable produce a
BIOS Mismatch dialog before the bundled image was considered.

Also fixed while wiring this: the settings.toml BIOS-adoption check read
psx_bios_image.image_bundled, which now runs before any backend is
active (all-zero), so it asks the registry instead.

Verified on Tomba! with ONE binary, both paths:
  no --bios          -> OPENBIOS, no dialog, boots to in-game save
  --bios SCPH1001.BIN-> SCPH-1001 (crc 37157331, bundled=0)
and the per-image state follows the selection, not just the label:
kernel-bless window 0x500-0x4BA0 vs 0x500-0x8500, deliver_event_ret
0x0 vs 0x80001720.

Still outstanding: savestates must record the active BIOS and refuse to
load under another (kernel RAM layout differs); a player-facing way to
clear a remembered choice; retiring PSXRECOMP_BIOS_STEM/_PROFILE, which
now only feed the staleness stamp.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-25 12:12:33 -07:00
..