Wing Commander 1 MS-DOS version, workaround on a 30 year old speed bug

CarlosTex

Spaceman
Hello my friends!

I'm Carlos Teixeira from Portugal, long time visitor of Wing Commander CIC but only registered today. I consider myself a veteran Wing Commander player, since the first time i played was sometime in 1991/1992.
I'm also an avid retro gamer and i play my old DOS games on my custom built MS-DOS PC. Wanting to play Wing Commander on all its glory, including a real Roland MT-32, the speed sensitive nature of the first game executable is a real show stopper. Not being amazingly talented in software reverse engineering i rolled up my sleeves, applied some elbow grease and started to work on a solution. I could build a 386SX33 just for Wing Commander, but i don't have a lot of space, and i decided to settle on only 3 MS-DOS computers. An IBM 5160 for early CGA/CGA Composite stuff, a Tandy 1000 SL for mid to early 90's 16 color stuff and my main AMDK6-3+ DOS PC. The latter is very flexible as the CPU multiplier can be controlled by software and i can disable all caches via software too. So why don't i just disable all the caches, reduce multiplier and enjoy WC? It actually runs decently on this config. Well, firstly because it's not perfect and because WC being as hard as it is, i don't need any additional quirks. Enough of this rambling, let's get to the good stuff.

So i'm sure that everybody is aware that SM2.EXE (executable for Secret Missions 2) does not suffer from the speed problem WC.EXE suffers. So a common solution is to rename the SAVEGAME.WLD to CRUSADE.WLD, and play that way with the known caveats. You know, Paladin now has DOOMSDAY graphics and Bossman is now JAZZ. So i decided to try to remove all the caveats i could.

So this is basically some hex editing and graphics swapping, thanks to the wonderful WC TOOLS pack, so i'm including 2 executables. WC1.EXE and SM1.EXE. Both these files are basically SM2.EXE HEX edited to use the proper graphically swapped files and to start its proper campaign. So far i've been playing and found no issues gamebreaking issues. Only thing i haven't been able to solve is the campaign flag on the savegame file. Both WC1.EXE and SM1.EXE now use a different savegame file: SAVEGAM.WLD, and the .EXE files still save the games with a byte value of 2 which means the Secret Missions 2 campaign. I haven't been able to find where in the .EXE it saves that byte. It needs to have a value of 0 for Vega Campaign and 1 for Secret Missions 1. You can always use the tool WCSAV to change it properly, but everytime you save the game it will always save the byte with value of 2. That byte can be found on a save game file if you count 1AA hex starting from each save slot.

I'm not so good with this so if anybody experience can help me out that would be great. I tried IDA but i'm not really good looking at assembly code.

Give it a try! Put all the .EXE files on your main game folder, and the others on the gamedat folder. Again this is for the DOS version, and i've been editing the version sold on GoG.com.



EDIT: Please i want to make it clear that the intention is not to distribute a full game, only the files necessary for the workaround to work. Anyone wanting to try this patch is required to own the game.
 

Attachments

  • wc_carlostex.zip
    458.1 KB · Views: 117
Last edited:
I found the location in the executable where the campaign index is set. It is a small change that can easily be done with a hex-editor:

Code:
SM2.EXE, file size: 305024; pos: 21106; from  B8 02 00 --> B8 00 00  // for WC1
SM2.EXE, file size: 305024; pos: 21106; from  B8 02 00 --> B8 01 00  // for SM1

I have barely tested this, but it seems to work as expected. It sets the campaign index value in the save game (CRUSADE.WLD) file and also effects the files that are loaded (CAMP, BRIEFING, MODULE) since these are chosen by index position; so this might undo some of the changes you did.
 
Hmmm, B8 02 00, should be equivalent if i'm not mistaken to MOV AX, 2. If this does indeed affect the files that are loaded this might be positive, because i might not even need to rename those files in the .EXE. What i did was for WC1.EXE i renamed CAMP.002, BRIEFING.002 and MODULE.002 .000 and renamed the same files .001 for SM1.EXE. I'll try to patch it out and see if there's any difference.

Thank you so much!!

EDIT:

I just checked my SM2.EXE, and there's no B8 02 00 at 21106. You must have a different file version. Closest i could find was on 21a31. That's a lot of bytes ahead.

EDIT2:

OK i just tried to edit SM2.EXE at 21A31 offset and it still saves the campaign index as CRUSADE.
 
Last edited:
I found it!!

OFFSET is 5272 we have a MOV AX,2. So only byte that needs to be edited is of course at OFFSET 5273, value of 00 for WC1.EXE and 01 for SM1.EXE.


I'll make a revised pack and upload it soon!

EDIT: OK i've uploaded a revised version. Now when saving games it should save the right campaign index value.
 
Last edited:
OK so i've been playing the first campaign, and one caveat that i cannot seem to fix is the killboard. So after the Bhurak Starkiller mission, which is MacAuliffe mission 3, BOSSMAN disappears from the killboard and JAZZ appears. I Hex edited COLSON JAZZ to be BOSSMAN CHEN, but now he is a 1st LT and his record is way down.

So i see 2 ways to do this. The easy way is to keep COLSON JAZZ hex edited as CHEN BOSSMAN and give him the rank, SORTIES and KILLS that he should have by the time he gets replaced.

The hard way would be to find how this was harcoded into the EXE and fix it so that BOSSMAN never gets replaced.
 
What about the Scimitar/Dralthi? Is that one correct or are we flying Dralthis in the base campaign now?
 
What about the Scimitar/Dralthi? Is that one correct or are we flying Dralthis in the base campaign now?

You mean the VEGA campaign? So far i've only flew Scimitars. Do you remember which series mission that happens? I haven't played all series in the VEGA campaign yet.

Thank you for reminding me of this. I need as much help as i can get, so if anyone wants to chime in you're welcome!
 
If you have Scimitars in Vega all should be ok. I recall that they replaced the sprites/stats/... of the Scimitar with the Dralthi for the SM2.exe and if you just used that one for Vega you had the wrong ship once you left the Hornet. But maybe I am misremembering or there are different versions of WC1. Its a really really long time I played around with such stuff. It should affect all missions, so if it works in a single one you should be fine.
 
After quite some games of testing on Vega campaign it seems to be all fine, with the exception that the kill board seems to follow Secret Mission 2 progress.
 
Back
Top