PORTCLUB
Cabecera de Wing Commander (wc1-re)
Port nativo

Wing Commander (wc1-re)

Port nativo de Wing Commander (wc1-re) para PC.

Wing Commander (wc1-re)

Port nativo basado en su ficha de origen.

README del repositorio

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.

A native SDL2 port is available for Windows, Linux, and macOS. It supports Kilrathi Saga data, has partial support for the original DOS game data, and also runs the Super Wing Commander Mac demo.

No copyrighted game data is included.

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

Status

The reconstruction has reached 100% executable similarity: the rebuilt WC1.EXE matches the original byte for byte (all 518,656 bytes, SHA-256 d517169e57f1d6254682c03dec5c254b5101ccd787d191f639b0cac1e8a616c4). A few matching workarounds remain in the source:

  • one compilation unit (LOGIC) still selects its own header context;
  • a four-instruction inline assembly block in the guarded memory allocator;
  • some volatile qualifiers and access casts; and
  • header declaration order and include placement chosen to reproduce the compiler's internal symbol ordering, plus three prototypes that nothing calls but that ordering still needs.

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 package for your platform from GitHub Releases:

  • macOS: open the .dmg for Apple Silicon (arm64) or Intel (x86_64) and drag Wing Commander into Applications. Requires macOS 15 or later.
  • Windows: run the -setup.exe installer, then open Wing Commander from the Start Menu. It installs for the current user without administrator privileges and includes an uninstaller in Windows Settings.
  • Portable ZIPs: available for Windows, macOS, and Linux. Extract the archive and keep the bundled libraries and sound bank beside the executable.

Game data is not included. Open the app to choose a detected installation, or use Add path… to select a Kilrathi Saga or DOS Wing Commander directory containing GAMEDAT. Choose the graphics and joystick options, then select Start game. Kilrathi Saga installations also need STREAMS/PREFLITE.STR, POSFLITE.STR, and MISSION.STR. With DOS data, compressed resources, OriginFX/AdLib music, and synthesized sound effects work; other DOS-specific data or behavior may not. Starting the game saves the directory and options for the next session. Enable Start in fullscreen under Graphics to open the game in desktop fullscreen mode.

With command-line arguments the game starts directly from the working directory; add --gui to review the options in the launcher first:

cd /path/to/WC1
./wc1-modern --enhanced --joystick-rumble

Use --fullscreen or --windowed to choose the startup display mode. With --gui, these also override the saved fullscreen setting in the launcher.

Autosave (slot 8) under Gameplay defaults to on the first time you use the launcher, which remembers your choice afterward. It saves a checkpoint named autosave after starting or loading a campaign and after each surviving mission's debriefing, awards, and transition to the next mission. Death or a campaign ending keeps the previous checkpoint. The last bunk is always reserved: manual saves use slots 1-7 even when autosave is off. Load the autosave from the last bunk as usual; an older manual save already in that slot also remains loadable.

Before a new or manually loaded campaign replaces an occupied last slot, the game asks Overwrite autosave? (Y/N) in its text box, including when the pilot uses the same name. Answering N keeps the existing save and disables autosave for the current game, even if another save is loaded. It becomes available again when you return to the title screen after death or ending the game, or restart the application, provided the launcher option is enabled. When autosave is active, loading the autosave itself resumes it without a replacement prompt. The command-line options are --autosave and --no-autosave.

The Super Wing Commander Mac demo supports the same options except EGA dithering and autosave (SWC saving/loading is not implemented yet). To play it, download the zip from archive.org, unzip it, and select its SuperWing DEMO folder in the launcher. Its Options commands keep their original keys: Cmd+U/Cmd+N (Ctrl+U/Ctrl+N on Windows and Linux) turn music and sound off or on, Cmd+B/Ctrl+B toggles text messages, and Cmd+V/Ctrl+V opens Volume Controls.

Fixes and features

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
Start in fullscreenGUI checkbox or --fullscreen
Automatic campaign checkpoints in reserved save slot 8GUI checkbox or --autosave
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
Cockpitless view-c
Cheat mode: player invulnerability and no player collisionsGUI checkbox or --cheats

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

Output-resolution shipsCockpit combat
Enhanced renderer showing two ships at output resolutionEnhanced renderer during cockpit combat

Controls

ShortcutAction
Cmd+Enter (macOS), Alt+Enter (Windows and Linux)Toggle fullscreen
Cmd+Q (macOS)Quit the game
Ctrl+S / Ctrl+M (spaceflight)Toggle sound effects / music
Esc (spaceflight)Pause; press any key to resume
Mouse wheel (spaceflight)Increase or decrease speed
Gamepad Start (spaceflight)Pause or resume
Gamepad BackEscape/back
Gamepad Y (Y/N prompts)Confirm Yes

As in the original, a mission ends only by landing on the Tiger's Claw, ejecting, or dying; quit from the barracks menu.

The default --joystick-mode=original keeps the original two-axis, two-button controls. The WCAT-style layouts use buttons 1–4 (A, B, X, Y on mapped controllers) for fire, missile, afterburner, and either a roll/throttle modifier (4button-2axis) or target cycling with extra roll and throttle axes (4button-4axis). LB/RB cycle guns and missiles, LT/RT open the navigation map and engage autopilot, and the D-pad provides full speed, stop, communications, and target lock. --joystick-axes= selects twin-stick-roll (the default), twin-stick-yaw, hotas-yaw, hotas-roll, linear-throttle, rudder-yaw, or rudder-roll.

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 (.exe on Windows); make run-modern launches it with Kilrathi Saga data in data/full, and make run-modern-dos with DOS data in data/dos.

The graphical launcher (make -j modern-gui) also needs CMake 3.21+, Rust 1.92+, and a C++20 compiler; Linux builds need the D-Bus and Fontconfig development packages. It produces out-modern/wc1-modern-gui, which release archives ship as wc1-modern.

Installer build instructions are in packaging/README-macos-build.txt and packaging/README-windows-build.txt. Tagged releases publish both macOS DMGs and the Windows setup executable alongside the portable ZIPs and their SHA-256 checksums.

The launcher header uses the original Wing Commander title artwork from TITLE.VGA packet 0, with colours from GAME.PAL. Its three frames are joined at native resolution into a 314x111 PNG and embedded in the executable, so the header is visible before selecting a game-data directory.

Reconstructed Win32 build

make -j builds WC1.EXE with the original MSVC 4.20 toolchain under wibo and assembles the hand-written raster library with UASM. Each link checks the executable against the original SHA-256; make verify-hash repeats the check. To run it in an emulated Windows 95 environment through DREAMM, provide a Kilrathi Saga disc image:

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

Reconstruction workflow

binary-comp is required for the assembly and layout comparisons. These commands also need the retail executable at data/full/WC1.ORI.EXE and the original-code exports under code-full/:

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

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;
  • Aaron Giles for the DREAMM emulator, used to run and study the original release, and ymfm, which powers the SDL2 port's AdLib emulation; and
  • DaisenryakuFan for providing very advanced source reconstructions for the DOS releases of several Wing Commander titles.

License

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

Comentarios (0)

Inicia sesión para dejar un comentario.

Sé el primero en comentar sobre este juego.