neuromancer

Spaceman
Hello!

I'm working on a source-code reconstruction of the original Windows/Win32 Wing Commander executable from Wing Commander: The Kilrathi Saga.

Function and module names are largely based on the Mac demo, which contains a substantial number of symbols, along with other releases that exposed some type names. I also discovered that a complete C source file was leaked as part of an old WC1 demo, which has been useful for the reconstruction.

You can follow the work-in-progress here:

https://github.com/neuromancer/wc1-re

The goal is to recreate the original Win32 executable as closely as practical. Since byte-perfect reconstruction is usually extremely difficult and, in most cases, unnecessary, it is enough to approximate it with a good similarity metric (around 98% or so). Once the reconstruction is mature enough, I'd also like to improve the game, possibly incorporating features from WCDX, and eventually port it to SDL2.

The code is still very preliminary, so expect its quality and readability to improve significantly over the coming days.

Stay tuned!
 
There is some gameplay already working from the simulator (flying and shooting works but the collision/target detection is still missing). A few screenshots that from the features reconstructed during today.
 

Attachments

  • generic-0004.png
    generic-0004.png
    26 KB · Views: 66
  • generic-0003.png
    generic-0003.png
    23.1 KB · Views: 66
  • generic-0002.png
    generic-0002.png
    11.7 KB · Views: 70
The source code recovery is now mature enough to provide some gameplay, first mission seems to be working fine in someone wants to give it a try. Happy to help anyone that need help compiling it.
 

Attachments

  • Screenshot 2026-08-11 at 13.38.25.png
    Screenshot 2026-08-11 at 13.38.25.png
    803 KB · Views: 59
  • Screenshot 2026-08-11 at 13.38.05.png
    Screenshot 2026-08-11 at 13.38.05.png
    615 KB · Views: 65
  • Screenshot 2026-08-11 at 13.37.48.png
    Screenshot 2026-08-11 at 13.37.48.png
    783.8 KB · Views: 57
  • Screenshot 2026-08-11 at 13.37.14.png
    Screenshot 2026-08-11 at 13.37.14.png
    717.4 KB · Views: 58
All the functions are finally lifted 🎉 , even some unreachable ones. The remaining work is to maximize similarity, improve code readability and test.
 
Hello!

I'm working on a source-code reconstruction of the original Windows/Win32 Wing Commander executable from Wing Commander: The Kilrathi Saga.

Function and module names are largely based on the Mac demo, which contains a substantial number of symbols, along with other releases that exposed some type names. I also discovered that a complete C source file was leaked as part of an old WC1 demo, which has been useful for the reconstruction.

You can follow the work-in-progress here:

https://github.com/neuromancer/wc1-re

The goal is to recreate the original Win32 executable as closely as practical. Since byte-perfect reconstruction is usually extremely difficult and, in most cases, unnecessary, it is enough to approximate it with a good similarity metric (around 98% or so). Once the reconstruction is mature enough, I'd also like to improve the game, possibly incorporating features from WCDX, and eventually port it to SDL2.

The code is still very preliminary, so expect its quality and readability to improve significantly over the coming days.

Stay tuned!

Please keep up the good work!
 
Had a little play with this and noted two problems:
1) in game, if i enter the nav screen and hit escape to leave, the game crashes (both with KS and Dos data)
2) the power recharge for the hornet was much faster than usual (basically can fire forever)

Despite those issues, impressive how playable this is, especially for so early in development.
 
Thanks a lot for your report!
I'm investigating issue 1, I cannot reproduced it. Which release you used exactly?
Regarding issue 2, I tested the power recharge in the hornet using the original game and shows the same behavior (except you take damage, where the recharge rate is lowered). I'm checking if the DOS release had some timing effect that produce a slower fire rate.
 
Thanks! I was using the 0.0.7 release, so will give 0.0.8 a try later.
Really interested in this as i took inspiration from Destro's Wingloader project (https://www.wcnews.com/chatzone/threads/wing-loader-ks-wcdx-loader-voice-over-mod.30387/) on adding full speech to the Kilrathi Saga port of first game and wrote an app that can hook to dosbox or KS versions and do the same - see https://github.com/MadmanLegion/WingLoaderCSharp - would be awesome to ultimately integrate that into your code later on (but i realise you have a lot of work to do first).
 
I think integrating your voice over mod is doable as an optional feature, specially with the .zip file it is already provided. Do you have a mapping between the lines and the files?
 
2) the power recharge for the hornet was much faster than usual (basically can fire forever)
Yes, the Hornet (and the Rapier firing lasers) can fire indefinitely, if their shields are full.

Playing the DOS version in the 1990s, I asked someone why they were making such efforts to evade at full shields, and they told me it was to keep their guns recharging at the maximum rate.

Thanks to neuromacer's work, we can now see how this was implemented. In version 0.0.8 it's in the file logic.c, lines 362 to 390, function name replenish_weapon_energy_bank(). If I understand it correctly:
  • All ships have the same energy store, 100 units.
  • If shields are full, you regain 2 energy per cycle.
  • If either shield is less than full, you only regain 1 energy per cycle.
  • Having both shields recharging doesn't make it any worse.
  • Looking at the adjacent function replenish_shields(), the reverse doesn't apply: draining weapon energy doesn't slow shield regeneration.
I'm a bit puzzled by the array sizes in globals.c. Wing Commander I supports 24 ships per mission, doesn't it? But does it only store these values for ships in the current action sphere?

C:
short g_aasShipArmor_0059d420[10][4];
short g_asShipWeaponEnergy_0059d470[16];
short g_aasShipShield_0059d5b0[12][2];
short g_aasShipMaximumShield_0059d6e0[12][2];
 
> I'm a bit puzzled by the array sizes in globals.c. Wing Commander I supports 24 ships per mission, doesn't it? But does it only store these values for ships in the current action sphere?

This is probably a defect in the reconstruction, my tooling is specialized in instruction matching but the global matching still needs a bit of work. It looks some array elements are mission, let me take a look...
 
@Dondragmer It seems WC1 only stores these values for ships in the current action sphere (which seems to be 10 ships instead of 12 as it was originally incorrectly assumed). If you see evidence in the assembly that this is not the case, please ping me here or open an issue in the wc1-re repository.
 
Attached some screenshots of the SDL2 port using the high definition render (original graphics, but no longer with 320x200, so ships and objects look more detailed in general).
 

Attachments

  • Screenshot 2026-08-20 at 21.33.35.png
    Screenshot 2026-08-20 at 21.33.35.png
    518.7 KB · Views: 84
  • Screenshot 2026-08-20 at 21.33.49.png
    Screenshot 2026-08-20 at 21.33.49.png
    396.7 KB · Views: 81
  • Screenshot 2026-08-20 at 21.34.00.png
    Screenshot 2026-08-20 at 21.34.00.png
    515.3 KB · Views: 83
Latest release for wc1-re is here: https://github.com/neuromancer/wc1-re/releases/tag/v0.0.11. The enhancement list of the SDL2 port is here (some of them require command line options, check the README for details):

Runs from either Kilrathi Saga or DOS game data, detected automatically
Resizable window, fullscreen toggle, and mouse capture
Aspect-correct 4:3 presentation and pointer mapping
Camera-relative left/right panning for in-flight sound effects
Background planets drawn with correct per-object scaling (WCDX fix)
Static on knocked-out cockpit displays, which the 1996 port dropped
Landing on the Tiger's Claw from any bearing; retail also required the Claw's bow to face you
Mouse wheel throttle control during spaceflight
Esc pauses during spaceflight, where the original left it inert
Pointer confined only during unpaused, focused spaceflight
Gamepad support with automatic SDL mappings and hot-plug
OpenGL renderer drawing space objects at output resolution
Restored, music-synchronized startup intro
OriginFX intro music
Heavy-weapon, damage, collision, and afterburner rumble
WCAT-style four-button joystick layouts

Next releases of wc1-re will be mostly for fixing bugs reported by players.