- C++ 82.9%
- C 9%
- Python 5.7%
- Assembly 0.9%
- CMake 0.8%
- Other 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
What is emulated today, file by file: the sound chips, the EGA, the I/O ports, interrupts, BIOS and PIT timing (group A), and the memory images, native addressing, C runtime and DOS files (group B, pending a project decision). What replaces each piece: the game's sequencer played as notes through TinySoundFont and an MIT soundfont subset (its licence confirmed from the upstream file and shipped with it), the effect player on our own tone voice, SDL3 output and input, the game's clock, a canvas, typed state. Every dependency's licence, with the two LGPL synths flagged. The checks: note, tone and game-event logs exact, frames pixel-exact, the traces off port-level logs, the project owner's listening sheet. Group A as one ordered path for one developer, about 50 days plus listening. The phase 5 audio plan is marked superseded in part. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BtXDTPpebHbz6oftAcdcjJ |
||
| .github/workflows | ||
| assets/original-game | ||
| data | ||
| docs | ||
| extern | ||
| src | ||
| tests | ||
| tools | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| CMakeLists.txt | ||
| DEPLOY.md | ||
| LICENSE | ||
| MechWarrior.ini | ||
| README.md | ||
mw1-original
This is a fork of Elthial's MechWarrior SDL port, the readable reconstruction of MechWarrior (1989) whose
README follows below. It keeps Elthial's full history (the fork point is e119a72a), their LICENSE, the MIT text and
the rights notice. The original port is at https://github.com/Elthial/Mechwarrior-sdl-port and is the
upstream remote here (fetch only).
What we're doing with it: rebuilding the 1989 game as modern C++ for MechWarrior 1: Critical Hit (FIXES 130 in
mw3-re's mw1/FIXES.md). The plan is to turn the port into C++20 with classes, namespaces and plain names, no goto,
and code organized by what it does, each function keeping the original's address. The game's creative content still
comes only from the player's own copy of the game. Every step is checked against golden traces recorded from the port
(tools/trace): the rebuilt game must replay each script exactly as the original logic does.
Fixes that belong in the port itself are offered to Elthial upstream separately; this fork doesn't publish releases.
Credit: the reconstruction, its research and its tools are Elthial's work. Their licence terms (MIT for the host
code under src/SDL and src/Support; see docs/LICENSES/README.md for the rest) apply to everything taken from it.
Where it is
- C++20: the sources are
.cppand build as C++20 (CMake, the only build; Visual Studio opens the folder as a CMake project). The first step changed no behaviour: the C build and the C++20 build record identical traces (tools/trace/scripts/campaign_contract.keys). - Build (macOS, Linux):
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build build -j4. SDL3 from the system (Homebrew on the Mac); Munt and Nuked-OPL3 are fetched. - Headless runs:
SDL_AUDIO_DRIVER=dummy; on LinuxSDL_VIDEO_DRIVER=offscreen; on the MacMW1O_HIDDEN=1(a hidden window: macOS's offscreen driver has no renderer). - Golden traces and the menu-handler map:
tools/trace/README.md,docs/phase0/.
Elthial's README, as forked:
MechWarrior SDL port
A readable, assembly-loyal C17/SDL3 reconstruction of MechWarrior (1989). The aim is preservation: run the original game behaviour on modern hardware and expose its interior—BattleMechs, weapons, pilots, contracts and renderer—for education and research. This is not a redesign, remake or original asset pack.
A legally obtained original game installation is required. No original game executables or data files are distributed. See the rights notice and the licensing map. This is an independent, unofficial project.
Status
Experimental playable Windows x64 EGA/PC-speaker build, not a finished v1.0.
The real campaign/launcher chain reaches briefing, movement, firing and combat
return. Campaign travel, Bar/recruitment, contracts, Mech repair/rearm and trading
are connected. A local Support-pilot defence victory was recorded; that does not
certify the full campaign, all scenarios, adapters or audiovisual fidelity.
Combat runs at a fixed 60 ms per tick at 1x, with the main-row - and = keys
for 2x to 4x (game speed).
Campaign music also supports MT-32 and AdLib, with user-provided
ROMs required for MT-32. Combat initializes the selected card but retains the
original speaker effects supplied by its sound bank.
See runtime status for current gameplay limits. Research tooling and verification suites are maintained separately in the reverse-engineering repository, not bundled with this public game.
| Campaign planet hub | Combat gameplay |
|---|---|
![]() |
![]() |
More real runtime captures and provenance.
Build and play
Requirements: Windows x64, Visual Studio C++ and CMake tools, PowerShell, and an existing SDL3 package/source tree. Dependencies are not silently downloaded.
# Compile the platform-independent library without SDL or original game files:
./src/Build.ps1 -Headless -Configuration Release
# Supply your SDL3 installation (or use -SDLSourceDirectory):
./src/Build.ps1 -Configuration Release -SDL3Directory 'D:/Libraries/SDL3/cmake'
# Game data remains in your own installation:
./src/Run-MechWarrior.ps1 -GameDirectory 'D:/Games/MechWarrior'
Alternatively place private files in ignored assets/original-game. Saves and
F12 captures go to ignored local directories, not into the original installation.
On the first run the importer reads the game's exes once into a story file in
the save directory; from then on play opens only resource files, never an exe
(the program stops if anything tries). Copying just the TBL/BMP assets is
still insufficient for that first run. Keep SDL3.dll next to the built
executable. Visual Studio opens the repository folder as a CMake project
(File > Open > Folder) for source navigation and debugging.
The reviewed executable hashes identify the tested revision.
See build instructions for direct CMake and Visual Studio setup.
Arrows/Enter operate campaign menus. In combat: Up/Down throttle, Left/Right turn, Space fire, Tab fire all, Enter target, C command, D damage, E target damage, Q return, T map, Z zoom, P pause. Repair and rearm before deployment. F12 captures actual output. See controls and testing. Optional Support pilot is disabled unless explicitly requested; it is not native AI.
Find your way around
| Path | Responsibility |
|---|---|
src/Original/Campaign |
MW_MAIN: economy, planets, contracts, pilots, Mech services |
src/Original/Combat |
BTECH: units, movement, AI, weapons, damage and mission loop |
src/Original/Geometry, Video, Audio |
Original projection/raster and sound/music logic |
src/Original/Memory |
Canonical typed state and executable-derived initialisation |
src/SDL |
Narrow file/input/time/audio/video host boundaries |
src/Support |
Necessary representation bridges and optional automation |
src/include/mechwarrior |
Shared typed records and interfaces |
src/Build.ps1, src/Run-MechWarrior.ps1 |
Build and launch scripts |
docs |
Current user, gameplay, code and licensing guides |
Start with code/data guide, BattleMechs and weapons, documentation index, preservation policy and code style. Runtime identifiers use readable names; native annotations and symbol mappings stay in the reverse-engineering repository.
The separate MechwarriorTools repository contains the .NET desktop asset viewer/editor and CLI, not another game engine. Neither project includes the game.

