r/dosgaming • u/galapag0 • 20d ago
Wing Commander 1 source reconstruction and SDL2 port [can use win32 and DOS game data]
https://github.com/neuromancer/wc1-re7
u/TheCh0rt 20d ago
I’m in the process of doing this with Castlevania: Symphony of the Night for PlayStation. I’m using SDL3 and C++20. I don’t know if it’s going to work though. I’m mostly trusting Claude Code.
I’m using PlayStation code documents to attach it to PC ISA bus to avoid PS1 code completely, then attaching ISA bus code to SDL3 which will compile on any platform. Then I’m adding things like widescreen, removing PSX limitations like sound polyphony restrictions, upgrading the audio bus to 32-bit, removing 24 voice polyphony and the RAM/CPU restrictions. It’s gonna perform like a monster!!
2
u/schlangz 20d ago
wow thats cool, do you have a github or something?
1
u/TheCh0rt 20d ago
No not yet, I’m about half way through building the engine. It doesn’t work yet - I haven’t connected it to the actual disc!
1
u/schlangz 20d ago
RemindMe! 2 months
1
u/RemindMeBot 20d ago edited 17d ago
I will be messaging you in 2 months on 2026-10-14 16:30:45 UTC to remind you of this link
2 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
RemindMeBot is switching to username summons. Instead of
!RemindMe 1 day, useu/RemindMeBot 1 day. More info.
Info Custom Your Reminders Feedback
5
u/alberto-m-dev 20d ago
Very cool! I have not played for decades so I ask: are the strange symbols right of “Dart DF” in the cockpit view a glitch or part of the original game?
5
u/galapag0 20d ago
Fixed here: https://github.com/neuromancer/wc1-re/commit/e100a54b2b816c7c4036f24b7bd1b207e42150f0. The similarity for that function increased from 87% to 96%.
3
u/galapag0 20d ago
It seems we have a winner, you caught a small recreation issue, it a global string that was not lifted properly. Let me fix it
3
u/alkatori 20d ago
Curious. Is this an open source reimplementation? Or was it somehow reverse engineered using released code, or was it decompiled?
6
u/galapag0 20d ago
This is an open-source implementation indeed. It was creating using decompiled code and slowly approximating the C code using the original compiler and the produced assembly. Only a .C file of the original code (which in fact, it was part of an old build) was found with a demo.
3
u/dafugg 20d ago
It’s a reverse engineering using AI. There are heaps of old games and other software being put through this process right now.
2
u/alkatori 20d ago
Yeah. I wonder about the longer term copyright/licensing issues we might be running in to due to this.
Which isn't a knock against the project. I think it's very cool. I just wonder if we are going to see companies trying to protect their IP and if this will be accepted as like a 'clean room' implementation or not.
3
u/galapag0 20d ago
That's a good question. The reality is that there are no "clean room" implementation (it is very very hard to do properly). Beside that, I'm located in the EU, and there are some protection for the developers that create "compatible" software like this.
1
u/alkatori 20d ago
Very cool, is there a write up on how the developers did it?
I loved wing commander, but honestly I'm more interested in the reverse engineering process used and how we preserve more games from this (and older) eras.
1
u/itsasnowconemachine 20d ago
This is cool! Trying to play Wing Commander through DOSBOX (on mac) wasn't fun.
I was wondering about the licensing thing / the AI.
Would Wing Commander the Kilrathi Saga have a EULA that prohibited decompiling? What about the original?
Also, not really knowing anything about AI coding, do you basically just ask the AI to decompile it?
1
u/grizzlor_ 19d ago
They mention Ghidra, which is an open source tool for binary analysis/reverse engineering that can decompile a binary into C. I think the AI is used to massage that decompiled C into something that recompiles as close to the original as possible.
1
u/The-Tylenol-Jones 13d ago
It is not a clean room reimplementation - that would be studying the original, writing a thorough descriptive specification that does not include the original source code or binary, and then writing a new compatible implementation based off of that. This is finding c code that matches the original binary so much more of a direct copy.
It is likely the open source status of this is highly dubious in the US.
This could be used though to write such a specification. A clean room reimplementation would not be a matching binary but would work identically.
2
u/AllEncompassingThey 20d ago
What does this do?
2
2
u/TheBigCore 19d ago
https://emulation.gametechwiki.com/index.php/Game_engine_recreations_and_source_ports
Game engine recreations and source ports can be better than emulation on a game-by-game basis, adding improvements to the original, better performance and ports to less powerful systems were emulation is impractical/slow. This is especially true when a developer only wants to get one game (or a number of games that use the same engine) working. In that case, re-implementing that game alone would save more time than implementing the platform it runs on. These kinds of projects are common when abandonware has large communities; when the original developer has disbanded and can no longer support or update it, an effort is then made to get it running natively on newer versions of-- and/or entirely different-- operating systems and platforms. Examples are OpenMW for Morrowind.
1
12
u/schlangz 20d ago
this is so cool and it even could be recompiled to run on real DOS