Sonic Adventure 2 Battle: Recompiled (Linux)
============================================

A native PC version of Sonic Adventure 2: Battle (GameCube, USA), made by static recompilation.
Nothing of the game is included - neither its data nor its code. You need your own copy of the
game, a USA disc image (GSNE8P, .iso/.gcm); the game's code is built from it on your computer.

Playing
  1. Run ./SA2BLauncher (from a file manager, or a terminal in this folder).
  2. CHOOSE DISC and pick your disc image.
  3. PLAY. The first time, the launcher builds the game from your disc (the SETUP page shows each
     step's progress): about 10 minutes with 8 processor threads, 20 or more with 4. It needs about
     1 GB of free space while it works (in ~/.cache/SA2BRecompiled), and keeps the result here as
     sa2b_game.so. It does this again only after an update or when you choose another disc image.
  4. SETTINGS for display, frame rate, volume and loading.

  A gamepad works directly. Keyboard: WASD stick, Space A, Shift B, F X, C Y, Enter START, Q/E L/R,
  IJKL C-stick, arrows D-pad. F11 toggles full screen.

  Saves: saves/MemoryCardA.raw in this folder (a GameCube memory card image, as Dolphin's).
  The last session's log: sa2b.log. The last setup's: setup.log.

What it needs
  A 64-bit x86 PC with a Vulkan driver (Mesa's for AMD and Intel, NVIDIA's own), and a distribution
  from 2021 or later (glibc 2.34, for the bundled compiler: current SteamOS, Ubuntu 22.04, Debian 12,
  Fedora 35 and newer). The
  launcher picks a disc through the desktop's file dialog (xdg-desktop-portal, or zenity).
  Updates use the system's curl and tar.

Steam Deck
  In desktop mode: Add a Non-Steam Game to My Library, browse to SA2BLauncher in this folder. Run it
  once in desktop mode for the first-run setup and to choose the disc; then it plays from game mode
  too. Keep the folder somewhere of your own (your home folder or an SD card), not read-only.

A menu entry (optional)
  Write ~/.local/share/applications/SA2BRecompiled.desktop with, using this folder's path:
    [Desktop Entry]
    Type=Application
    Name=Sonic Adventure 2 Battle: Recompiled
    Exec=/path/to/SA2BRecompiled/SA2BLauncher
    Path=/path/to/SA2BRecompiled
    Icon=/path/to/SA2BRecompiled/sa2b_icon.png
    Categories=Game;
    StartupWMClass=SA2BRecompiled

Your disc image
  The setup checks it for you. It is made for the Redump dump of the USA disc:
    size   1,459,978,240 bytes
    CRC32  024f4f8f
    SHA-1  f8cc51128df2a3b0da9d6f3a234c895a4cd7dc22
  To check it yourself:  sha1sum "<your disc image>"
  A trimmed or otherwise different image of the same disc is accepted too when the game's program
  on it is identical. Keep the program in a folder you can write to.

Online co-op
  CO-OP on the launcher (or F1 in the game): host and send your partner the code, or join with
  theirs - Windows and Linux players play together. Each of you plays on your own screen: the host
  the story's character, the joiner the other side's (Sonic/Shadow, Tails/Eggman, Knuckles/Rouge).
  The host drives the menus and cutscenes; co-op has its own save (saves/coop). In the game: F1 for
  the co-op menu (colours, name, Discord), T to chat.

Updates
  When a newer release is out, UPDATE appears on the launcher's main menu: it downloads and installs
  it (no account needed). Your saves and settings stay.

What is in this folder
  SA2BLauncher       the launcher, with the recompiler built in
  sa2b               the runtime: our own code standing in for the GameCube (graphics, sound, ...)
  libSDL3.so.0       the window, input and sound library both use
  tools/llvm         the compiler and linker the setup uses (LLVM 19.1.5, unchanged)
  tools/lib          a stand-in for a library the linker asks for but never uses (libxml2)

Source code, issues, how the setup works: https://github.com/sonsegajp/Sonic-Adventure-2-Battle-Recompiled
  (docs/SETUP.md)

Sonic Adventure 2: Battle is (c) SEGA. This project is not affiliated with or endorsed by SEGA or
Nintendo.
