Files
TMB_Recomp/scripts/run_native.sh
Thomas MartinandClaude Opus 5.5 c6b0163803 The runner as a PC game: native by default, user folder, game/ next to the exe, no console, log, crash reports (fork c4e7917)
A double-click on ps2EntryRunner.exe is now the full native port: TMB_NATIVE defaults to 1 (tmb::native::enabled and
the existing setEnvDefault block), so everything scripts/run_native.sh exports is a default; variables still win.
The fps counter is off (F3, PS2X_SHOW_FPS=1; run_native.sh sets it), scripts/run.sh sets TMB_NATIVE=0 to stay the
PS2 path. CMake names the app for the fork's ps2_app.h (title "Twisted Metal: Black", %APPDATA%\TMB_Recomp,
$XDG_DATA_HOME/tmb_recomp, game/SCUS_971.01) and builds the runner GUI-subsystem with runtime/app/tmb.rc (a
placeholder icon as GLFW_ICON, version information). Cards, input.ini, video.ini, imgui.ini, logs/ (last 3 runs)
and crashes/ in the user folder, the old cards and settings copied once. The mesh and texture packs fall back to the
file next to the ELF or the runner when the build's path is absent. README "As a PC game", RECOMP_NOTES.

Checked: a copy of the runner with game/ (disc files, ISO) beside it, started as Explorer starts it with only
PS2X_CAPTURE_WINDOW_DIR set: movies, menus, a Challenge match in Suburbs natively with sound, cards and video.ini
migrated, log written; arena.sh with main's runner, this one, and this one without the native variables: the same
menus (no fps counter now), matches native with the mixer playing, the terminal output unchanged and equal to the log;
PS2X_TEST_CRASH in a match: report and message box, addr2line resolving frame 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 19:31:47 +01:00

18 lines
1.0 KiB
Bash

#!/usr/bin/env bash
# Launches the game as a native PC port: the 3D drawn by the native renderer from the game's own data (TMB_NATIVE),
# the sound driver's IOP modules as recompiled code (PS2X_IOP_NATIVE, when scripts/iop_recomp.sh has generated them)
# and the sound and IOP on the PC's clock. Extra args are passed to ps2EntryRunner.
source "$(dirname "$0")/common.sh"
BIN="$GAME_BUILD/PS2Recomp/ps2xRuntime/ps2EntryRunner"
[ -x "$BIN" ] || { echo "missing $BIN, run scripts/build_runtime.sh first"; exit 1; }
# (All of these are the runner's defaults now, a double-click starts the same game; set here for the record. The frame
# rate counter, off for players, is on for us.)
export TMB_NATIVE=1 PS2X_SPU2_WALLCLOCK=1 PS2X_IOP_WALLCLOCK=1 PS2X_GS_RENDERER="${PS2X_GS_RENDERER:-native}"
export PS2X_SHOW_FPS="${PS2X_SHOW_FPS:-1}"
if compgen -G "$GENERATED/iop/*.cpp" > /dev/null; then
export PS2X_IOP_NATIVE=1
else
echo "no ${GENERATED#$ROOT/}/iop/: the sound modules run interpreted (scripts/iop_recomp.sh recompiles them)"
fi
exec "$BIN" "$ELF" "$@"