Star Fox: Assault - static recompilation (linux-x86_64)
=====================================================

This folder holds only the recompiled program. You need your own copy of the game.

Setup
-----
1. Put a disc image of your Star Fox: Assault (USA, GF7E01) in this folder, as an .iso or .gcm file
   (any file name). If Dolphin has it as .rvz or another compressed format, right-click the game in
   Dolphin, choose Convert File..., and pick ISO. (An extracted disc also works: Dolphin's
   Properties > Filesystem > Extract Entire Disc, placed here as orig/GF7E01/sys and orig/GF7E01/files.)
2. Run ./sfa.sh (fullscreen; add it to Steam as a non-Steam game) or ./sfa. A start screen comes up (mouse, keyboard or controller):
     Game disc    finds an .iso next to the program by itself; Browse... opens your system's
                  file dialog (with a controller, or in the Deck's Game Mode, a built-in browser)
     Display      window or fullscreen
     Frame rate   Original (on-foot missions and cutscenes run at 30 fps, as on the GameCube) or
                  60 fps everywhere (experimental; where your PC can't hold 60, the
                  game goes back to its own rate for a while, so it never runs in slow motion)
     Aspect ratio 4:3, or 16:9 to see more to the sides (the HUD and menus are stretched)
     Resolution   how many times the GameCube's resolution the game is drawn at (1x-4x), or
                  Auto to match your screen
     Anti-aliasing  smooths jagged edges (Off, 2x, 4x, 8x; higher costs more GPU time)
     Textures     Off, or 2x / 4x: every texture is upscaled with xBR as it loads, for smoother
                  edges in the artwork (no new detail; a texture pack's files are used as they are)
     Play        start the game (START on a controller)
   Your choices are remembered in user/launcher.cfg. To skip the start screen, run with --play
   or name the disc image on the command line.

Updates: when the start screen opens, it asks GitHub whether there's a newer release. If there
is, it shows "Update available": press Y on a controller, U on the keyboard, or click it, and the
program downloads the new version, replaces its own files and restarts. Your saves and settings
in user/ are kept. To turn the check off, set check_updates=0 in user/launcher.cfg.

The GameCube's system font (dialog text, comm subtitles) is built in: replacement fonts made from
Droid Sans by the Dolphin project, under the Apache License 2.0 (see font-licenses.txt). A dump of
your own console's boot ROM at user/GF7E01/ipl.bin, or font files in user/fonts/, are used instead
when present.

HD texture packs
----------------
Put a texture pack's PNG files in user/GF7E01/textures/ (any subfolders). Packs made for Dolphin
(its Load/Textures/GF7E01 folder) work as they are: files are matched by their tex1_... names.
To make your own, start the game with SFA_DUMP_TEXTURES=1 set (on the Deck in Steam's launch
options: SFA_DUMP_TEXTURES=1 %command%), or add the line dump_textures=1 to user/launcher.cfg.
Every texture the game shows is then saved to user/GF7E01/dump/textures/. Edit or upscale a file,
keep its name, and put it in user/GF7E01/textures/. Save PNGs without interlacing. Replacements
can be any size; the same shape as the original (2x, 4x...) looks right.

Mods
----
A mod changes the game's files (models, textures, levels, music, sounds, text, menus) without
rebuilding a disc image. Put each mod in its own folder in user/mods/, laid out like the disc's
files: a file in it with the same name and path as one of the disc's replaces it, at any size.
For example user/mods/My Mod/bgm/A00001.dsp replaces the disc's bgm/A00001.dsp. (To see the disc's
files: Dolphin's game Properties > Filesystem > right-click the disc > Extract Entire Disc; a mod's
files may also sit in a files/ folder of its own, as Dolphin writes them.)
The start screen's Mods page lists the mods: A turns one on or off, LB/RB (or left/right) moves it.
When two mods change the same file, the one lower in the list wins. The game's code can't be
changed this way: .dol and .rel files in a mod are left out. What each mod replaced is written to
user/sfa.log. HD texture packs (below) are separate and work alongside mods.

Controls
--------
Any SDL game controller (the Steam Deck's own controls included), or the keyboard. Up to four
controllers for VS mode's split screen: each one is a player in the order you connect them (the
start screen lists them; a controller's player light shows its number). Computer players: on VS
mode's character screen, press Z (R1 / RB on most pads) to put a bot in the next empty slot, then
choose its character with left/right and press A, then its handicap with left/right and A (or press
Z again for a random character, which keeps the handicap as it is); the bot then gets ready by itself.
L (left trigger) takes the last bot out again (it steps out of its slot over a few seconds). Bots stay for rematches; backing out of the character screen removes them all.
A pad SDL doesn't recognise gets the usual generic layout; if its buttons come out wrong, put a
gamecontrollerdb.txt (the community list of controller layouts) in the user folder.
The keyboard is player 1:
    stick: WASD or arrow keys     C-stick: numpad 8/4/6/2
    A: Space or J    B: K or Backspace    X: L    Y: I    Z: Z
    L: Q             R: E                 START: Enter
F11 or Alt+Enter toggles fullscreen.

Options
-------
usage: sfa [options] [disc image (.iso/.gcm) or extracted disc folder]
  (without one: an .iso/.gcm or orig/GF7E01 in this folder or next to the program)
  (with neither, a start screen lets you pick the disc and press PLAY)
  --play                skip the start screen
  --fullscreen          start fullscreen (F11 or Alt+Enter toggles)
  --window=WxH          window size (default 1280x960)
  --no-video            run without a window (testing)
  --stage=N             start stage N of the stage table instead of Mission 1
  --auto-press          press buttons automatically (testing)
  --auto-keys=a,w,...   scripted button presses, one per 1.5 s (testing)
  --dump-frames         save every 15th frame to build/GF7E01/frames
  --selftest            check the recompiled code and exit
Saves (memory card files) are kept in user/GF7E01/card_a/.
user/shaders.bin remembers the game's graphics effects, so they're prepared at start instead of
causing a short hitch the first time each one appears. It fills in as you play; deleting it is safe.

If the game stops with an error or crashes, a report is added to user/crash.log. When it isn't
started from a terminal (from Steam, a file manager, or the Deck's game mode), everything it prints
also goes to user/sfa.log for the last run. Send both files with a bug report.
