Wing Commander Reloaded

Wing Commander Reloaded is a native SDL2 port of Wing Commander for Windows, Linux, and macOS that supports Kilrathi Saga and DOS game data.

README

Wing Commander source reconstruction and SDL2 port

This project recreates the source of Wing Commander as shipped in Wing Commander: The Kilrathi Saga (1996). The reconstructed game core is C, the ix audio library is C++, and the reference build uses Microsoft Visual C++ 4.20 to reproduce the original Win32 executable as closely as possible.

A native SDL2 port is available for Windows, Linux, and macOS. It supports Kilrathi Saga data and has partial support for the original DOS game data.

No copyrighted game data is included.

If you find this project useful, you can support its development through GitHub Sponsors.

Status

The reference build works, but byte-for-byte reconstruction is incomplete. Unreferenced routines found between previously mapped functions are still being recovered.

make report calculates per-function machine-code similarity to the retail executable. It covers annotated functions and can miss unreconstructed code between them. Use make compare to check executable layout as well; neither score measures gameplay completeness.

Similarity

Run make report for the current per-function results. Generated report output is not stored in this repository.

Screenshots

Mission briefingTiger's Claw hangar
Mission briefing and flight path aboard the Tiger's ClawFighter parked in the Tiger's Claw hangar
Title sequenceCockpit combat
Wing Commander title screenCockpit combat targeting a Dralthi

Download and run the SDL2 port

Download the archive for your platform from GitHub Releases. Extract its contents and keep the bundled runtime libraries beside the executable. New release builds open a graphical launcher when started without arguments. Use Browse… to select an installed Kilrathi Saga or DOS Wing Commander directory containing GAMEDAT, choose the graphics and joystick options, and select Launch WC1. Older releases require the game directory as the working directory:

# macOS or Linux
cd /path/to/WC1
./wc1-modern
# Windows PowerShell
cd C:\path\to\WC1
.\wc1-modern.exe

With DOS data, compressed packet resources, OriginFX/AdLib music, and synthesized sound effects work; other DOS-specific data or behavior may not.

The launcher follows WC2's layout, with WC1's enhanced OpenGL renderer, EGA dithering, cockpitless view, cheat mode, joystick modes, axis layouts, and rumble. Kilrathi Saga installations also need STREAMS/PREFLITE.STR, POSFLITE.STR, and MISSION.STR. Clicking Launch saves the selected directory and these options in a per-user launcher.ini for the next GUI launch. See launcher settings for the file location and format.

The Super Wing Commander Mac demo also supports OpenGL, cockpitless view, cheat mode, the joystick modes and axis layouts, and rumble. Select its directory in the launcher or use --swc-demo DIRECTORY with the same switches. EGA dithering applies only to WC1 data.

Providing command-line arguments starts the game directly from the working directory. Add --gui to review those options in the launcher first; changing a control overrides its command-line default. Explicit command-line options override remembered settings; direct launches do not read or write the INI file.

Fixes and features

What the port adds on top of the reconstructed game. The first group is always active; the rest need a switch, and switches can be combined.

Fix or featureEnable with
Runs from either Kilrathi Saga or DOS game data, detected automaticallyalways on
Resizable window, fullscreen toggle, and mouse capturealways on
Aspect-correct 4:3 presentation and pointer mappingalways on
Camera-relative left/right panning for in-flight sound effectsalways on
Kilrathi Saga sound effects balanced against streamed musicalways on
Background planets drawn with correct per-object scaling (WCDX fix)always on
Static on knocked-out cockpit displays, which the 1996 port droppedalways on
Landing on the Tiger's Claw from any bearing; retail also required the Claw's bow to face youalways on
Mouse wheel throttle control during spaceflightalways on
Esc pauses during spaceflight, where the original left it inertalways on
Pointer confined only during unpaused, focused spaceflightalways on
Gamepad support with automatic SDL mappings and hot-plugalways on
OpenGL renderer drawing space objects at output resolution--enhanced
EGA 16-colour dithering--ega
Restored, music-synchronized startup intro--enhanced, or automatic with DOS data
OriginFX intro music--enhanced, or automatic with DOS data
Heavy-weapon, damage, collision, and afterburner rumble--joystick-rumble
WCAT-style four-button joystick layouts--joystick-mode=4button-2axis or 4button-4axis
Alternate twin-stick, HOTAS, throttle, and rudder axis layouts--joystick-axes=<layout>
Joystick diagnostics on stderr--joystick-debug
Legacy frame-rate flag (SDL text overlay is not implemented)-f
Cockpitless view-c
Cheat mode: player invulnerability and no player collisions (DOS, Saga, SWC demo)GUI checkbox or --cheats
./wc1-modern --enhanced --joystick-rumble
Enhanced renderer

The OpenGL renderer keeps the original indexed artwork, palettes, cockpit, and HUD; only space objects are redrawn at output resolution. The software renderer remains the default.

Output-resolution shipsCockpit combat
Enhanced renderer showing two ships at output resolutionEnhanced renderer during cockpit combat
SDL2 port controls
ShortcutAction
Cmd+Enter (macOS)Toggle fullscreen
Alt+Enter (Windows and Linux)Toggle fullscreen
Cmd+Q (macOS)Quit the game
Ctrl+S (spaceflight)Toggle sound effects
Ctrl+M (spaceflight)Toggle music
Gamepad Start (spaceflight)Pause or resume
Gamepad BackEscape/back
Gamepad Y (Y/N prompts)Confirm Yes
Mouse wheel (spaceflight)Increase or decrease speed
Esc (spaceflight)Pause; press any key to resume

Esc pausing is a port addition. The original leaves it inert during spaceflight, and there is no in-flight quit or restart: a mission ends only by landing on the Tiger's Claw, ejecting, or dying. Quitting is done from the barracks menu (Quit Wing Commander), and retrying a mission means saving to a bunk beforehand and reloading it from there.

The default --joystick-mode=original keeps the original two-axis, two-button controls. Two WCAT-style layouts are also available:

OptionSpaceflight controls
--joystick-mode=4button-2axisButtons 1–4: fire, missile, afterburner, roll/throttle modifier
--joystick-mode=4button-4axisButtons 1–4: fire, missile, afterburner, cycle target; extra axes control roll and throttle

On mapped controllers, buttons 1–4 correspond to A, B, X, and Y; hold X to engage the afterburner.

In either WCAT-style mode, LB/RB cycle guns and missiles, LT/RT or the left/right stick clicks open navigation/map and engage autopilot, and the D-pad provides full speed, stop, communications, and target lock.

With communications open, D-pad Up/Down moves the highlighted choice, Right selects it, and Left closes the list. Flight and weapon controls remain active.

The four-axis mode defaults to --joystick-axes=twin-stick-roll. Additional twin-stick, HOTAS, throttle, and rudder layouts are described in the SDL2 port documentation.

Build from source

Clone the submodules first:

git submodule update --init --recursive
SDL2 port

Install a C/C++ compiler plus the SDL2 and LZO2 development packages, then run:

make -j modern

The executable is written to out-modern/wc1-modern (or out-modern/wc1-modern.exe on Windows). make run-modern launches it with Kilrathi Saga data in data/full; make run-modern-dos uses DOS data in data/dos.

To build the graphical launcher, also install CMake 3.21+, Rust 1.88+, and a C++20 compiler. Linux builds need the D-Bus and Fontconfig development packages (libdbus-1-dev and libfontconfig1-dev on Debian/Ubuntu), and the folder picker uses the desktop's XDG portal. Then build:

make -j modern-gui

This produces out-modern/wc1-modern-gui (.exe on Windows). The first build downloads the pinned Slint and Native File Dialog Extended sources. Both are linked into the executable; make modern keeps its existing dependencies. make run-modern-gui opens the launcher with data/full selected, or use MODERN_RUN_DIR=/path/to/WC1 to select another installation. Release archives include this GUI build under the usual wc1-modern name.

Reconstructed Win32 build

The default target builds WC1.EXE with the original MSVC 4.20 toolchain under wibo, and assembles the hand-written raster library with UASM, built from its submodule on first use:

make -j

To run it, provide a Kilrathi Saga disc image. The Makefile extracts the game data, substitutes the reconstructed executable, downloads DREAMM when needed, and launches it in an emulated Windows 95 environment:

make run GAME_ISO=/path/to/kilrathi-saga.iso

Use make debug GAME_ISO=/path/to/kilrathi-saga.iso to start DREAMM's debugger.

Reconstruction workflow

binary-comp is required only for comparison and verification commands:

python3 -m pip install "binary-comp[all] @ git+https://github.com/gg-sl-oss/binary-comp.git"
make compare-func FUNC=perform_maneuver
make verify

These commands require the retail executable at data/full/WC1.ORI.EXE and the original-code exports under code-full/.

Contributor references are intentionally limited to:

Acknowledgements

Special thanks to:

  • Origin Systems who created Wing Commander and developed its Kilrathi Saga port;
  • Electronic Arts for publishing Wing Commander: The Kilrathi Saga;
  • GOG for keeping Wing Commander 1 + 2 readily available;
  • AllTinker for the W.C.A.T. overhaul, whose fixes and analysis of the DOS release have been valuable references;
  • the WCDX project for its pioneering compatibility work on the Kilrathi Saga release; and
  • Aaron Giles for the DREAMM emulator, used to run and study the original release, and ymfm, which powers the SDL2 port's AdLib emulation.

License

See LICENSE. OpenAI Codex and Anthropic Claude were used during the reconstruction.