W.C.A.T. - WC1 DOS Overhaul Mod [Beta v0.8 R4 Released]

AllTinker

Captain
Hey everyone! It's been a long wait since I announced it, but finally...

Here's W.C.A.T. - The Wing Commander AllTinker overhaul mod - it's an awkward name but it has "CAT" in it, so good enough! :D This is a pretty extensive overhaul mod for Wing Commander 1 for DOS - whether real hardware/FPGA or DOSBox.

The most critical thing it does is introduce game-wide sync-to-blank-based speed limiting. To do this properly required a huge number of code changes as many "scenes" in the game are coded slightly differently, requiring different approaches - and the effects of running on a fast machine varied widely. For instance, I've had to correct several hardcoded cutscenes, since their timing was obviously set up without ever having seen them running at full speed...

Here's a playthrough of the first mission, using a 360 controller in 4-axis/4-button mode, on the rough equivalent of a Pentium 90:

I've also successfully tested it on real DOS machines; most recently a Pentium 233MMX with a couple of different gameport joysticks.

I've made several attempts at this (starting with the speed fix) over many years. While I was able to get some basic things happening quite easily, creating a complete solution took an absolutely massive amount of work. Since I really started making major breakthroughs, this has taken a bit over a year (part-time) of very labour-intensive work in raw machine code & some assembly.

In order to make this I primarily used the freeware IDA Pro 5 and ImHex, but it also involved writing several custom tools, including ones for modifying the EXE relocation tables (including for Borland's VROOMM overlays), one for post-processing TASM output to create the layers upon layers of byte patches... The list goes on - this has been a huge project, so much larger than I expected or honestly intended. One day I might do a full write-up from my notes.

The speed fix is far from all it does...

BUG FIXES​

Known code bugs have been fixed:
  • The 5-sortie ribbon, which was awarded after the first sortie.
  • The half-defeated copy protection in SM2 (e.g. GOG/EA release).
  • Losing a wingman should now be unnecessary for a perfect medal sweep.
  • The Adlib hanging-note bug (hopefully reduced, if not eliminated).
  • The series overflow bug caused by the original transfer programs.
I've also completely rewritten the joystick routines, which were only set up for proper operation on a mid-tier 386. This also means that the game now supports up to 4-axis, 4-button joystick setups.

CONTENT FIXES​

Several art & other asset issues have been fixed:
  • Missing pips on Halcyon's shoulders during award ceremony.
  • Incorrect helmet names for Hunter ("Dart") and Maniac ("Joker").
  • Rogue pixels in Iceman and Angel's portraits.
  • Visual error in barracks bucket splash animation.
  • Fixed broken Rostov loss cutscene (broken in v3.5).
  • Fixed broken loss cutscene for SM1 (no longer pans off screen).
  • Corrected some script typos and mistakes.
  • Completely redone lipsync; corrects Vega script, adds it to SM1/2.

NEW LAUNCHER​

The new DOS-based launcher handles the following:
  • Calibration for the new joystick routines.
  • Adjusting settings for the game; including new and old features.
  • Save game management beyond the game's 8 slots (beds).
  • Simple save game editing & creation.
  • Transferring between Vega, SM1 and SM2 campaigns.
    • Free of series overflow bug, and even sets proper starting dates!

NEW GAME OPTIONS​

New game options include:
  • Reduced asteroid field difficulty.
    • The original logic for asteroid fields was deliberately malicious, based on your speed. The new fields are still dangerous, but much more fair.
  • Keyboard "smooth auto-centre" mode. Wing Commander simulates a virtual joystick via the arrow keys/numpad; this includes not recentring while firing your weapons, and an instant stop when keys are released. This new mode instead smoothly re-centres when no directional keys are pressed, regardless if fire is held or not.
  • Configuring joysticks, up to 4-axes & 4-buttons. There are several modes which hopefully cover any kind of (analogue gameport) setup you might want to throw at it.
    • In theory, joysticks should only need to be calibrated once, or at least only every so often - they previously needed to be calibrated every game boot.

FUTURE PLANS​

The current release is a "beta" / "in development" primarily because I can't test it thoroughly enough to call it a completed release.

Besides further polishing the existing features, I have plans & ideas for some future additions to this overhaul mod; primarily new gameplay & difficulty options.

I also have plans to perform a similar overhaul on Wing Commander II; it has very half-baked speed limiting, and it would be nice to bring as many of these new features across as possible.

DOWNLOADS​

I've provided three options for installation:
  1. An automated installer for Windows, bundled with DOSBox-Staging, which will attempt to locate an existing Wing Commander install (e.g. GOG, EA) and copy over the data files automatically.
  2. A zip file version, again bundled with DOSBox-Staging. Once you've copied over GAMEDAT (see below), run Wing Commander.exe.
  3. A minimal zip intended for real DOS, or custom DOSBox setups. It includes example DOSBox configs which will be useful to refer to in the latter case.
Whichever way you decide to go, an existing Wing Commander install is required. The installer will attempt to copy the files automatically, but alternately you will need to copy everything in GAMEDAT/ over to W.C.A.T.'s GAMEDAT/ directory (found under files/ for the DOSBox downloads).

Do note that - in terms of real hardware - this overhaul is intended for mid-tier 486 or faster, preferably with VLB or PCI graphics. On slower machines this overhaul may end up running worse than the original, and pre-386 machines aren't supported at all. This overhaul mod is also incompatible with other mods.

I'm distributing it via itch.io. Amongst other things it opens up the possibility of accepting tips/donations for those in a position to do so; if you can't, no stress at all - it's just where I'm at at the minute.
:rolleyes:
With that said, here's the link:
Download W.C.A.T. on itch.io
Scroll to the bottom for downloads - I think pretty much everything in that page was also here.
 
Last edited:
I've just released Beta 0.8 R2, which fixes an oversight in the mouse controls.

Early in the project I was experimenting with reducing the mouse deadzone and accidentally left it in its modified state. This was before I added the launcher and could make such things optional. So now it is!

The default setting will match the original game's mouse controls, with a new "fine" setting available if you prefer.

You can just run the new installer to update, or overwrite the files manually from the ZIP files. Your current configuration will be preserved.
 
Great news and bad timing, as I am busy with XWVM at the moment.

Congrats on the release, your hard work is and will be appreciated.
 
Thank you for this great work! 😊
I managed to try it yesterday on a 486DX2-66 and the speed was perfect!

I experienced two bugs however 😅. I will share them here in the hope it can help.
Using Beta 0.8 R2:
  • In my first try, the joystick suddenly "decalibrated" when entered the bedroom for the first time and the pointer was stuck on top of the screen. Before that, I did the short initial arcade session and spoke to Shotglass then Angel in the bar.
    I deleted the cfg file then relaunched the wc-at batch which recalibrated the joystick. No problem after that.
  • Then I played the first mission. After clearing the 3rd nav point, the game became unresponsive: i could not enter any command anymore and leave the map. The music was still playing fine though.
This evening I'll try my vanilla WC install to confirm that I have no problem with it. I usually play it using a TSR that slows down the computer with the 1024Hz timer.

My config:
  • HP Vectra VL2/66 (486DX2-66, Cirrus Logic VLB integrated svga card with 1MB of VRAM)
  • 16 MB of RAM with EMM386 running
  • Pro Audio Spectrum 16 running on SB compatibility mode, IRQ5 / port 220
  • MSDOS 6.22
I used the "gamedata" from "WC Deluxe" that I bought some time ago from GoG. For whatever reason, my regular WC folder, that I think dates back from my very first installation in 1991 could not be used as its files failed the initial CRC check.

Let me know if you want more info or me to do more testing that could be of any help :)
 
Last edited:
Thanks very much for the feedback! :)

I could be wrong of course, but it does sound a lot like there's a connection issue to your joystick.

The first one is interesting, because there's nothing which can change the calibration info while the game is running - the launcher literally "hardcodes" the calibration data into the EXE itself. Assuming there isn't a bug... Which I don't want to totally discount! :D

I do need to add a different way to recalibrate your stick in the launcher (e.g. via keyboard shortcut) in cases where the calibration info is totally wrong - I'll try to do that for the next release. You might be able to use the keyboard arrows/enter to get to "Recalibrate" in the controls menu but I know this can be rough if the joystick is out of whack - I'll see what I can do about that too...

With the lockup what could have happened is that the joystick (even partially) disconnected, which means the counting for the axis measurement will take a very long time to time out (effectively locking up the game) - the timeout has to be quite long in order to support really fast DOS machines, but I may have gone overboard. Physically reconnecting the stick should fix it, but it's been a while since I've verified that, so I'll have to do some more testing on my own DX2-66.

Some games stop the joystick from working entirely when a timeout happens (to prevent future timeouts and keep the game running properly), but I decided against doing that. There may be other options, however... I will look into what else I might be able to do to handle it more gracefully.

I'd definitely be interested to hear whether or not you have any issues with your joystick in any other programs/games!

EDIT: If other games are working fine, could you let me know what kind of joystick you're using?

Oh I missed that part about failing the CRC - there should be a file called CHKFAIL.TXT in the LAUNCHER directory - would you mind posting the content of that if you still have it? There are so many releases of Wing Commander that I wouldn't be surprised if I missed one! :p
 
Last edited:
OK I've replicated the nav screen crash - looks like I broke something! The calibration thing is still a mystery though, haven't replicated it yet...

Thanks again for letting me know. :)

EDIT: OK I see what's happened! Hopefully it's a simple fix...
 
Last edited:
I have a box for a Wing Commander + Wing Commander 2 + all expansions. Wing Commander 1 is version F3.1. I also get checksum fails for the following files:

INSTALL.DAT : 0x646010A3
MIDGAME.V05 : 0x885C675A

I have an additional hypothetical question. Since you have a launcher that reads game data, i wonder how possible would it be to add support for PCM sound. The idea is that it would be possible to create voice packs that worked in DOS. One could use the voices from that Wing Commander version, or create new packs with AI tools. (there's been such a thing done for Space Quest V that never had voice acting)

There would be no need to create sound playing routines, instead use the real mode library called DIGPAK, which hooks into INT 66h
(IIRC) and one just needs to call the sound playing routine by selecting the proper number into the AH register before calling INT 66. The advantage of this is that DIGPAK supports a TON of sound devices for MS-DOS.

I know that this would be quite the undertaking, but would open quite a lot of possibilities. Anyway i'm just asking hypothetically.

All in all this is an AMAZING work, BRAVO!!!!!!!

EDIT: Also the ability to change the Adlib port is excellent!!! I have an AdLib Gold Clone on port 398h, and now i can turn on the surround module and listen to the music with those spatial effects provided by the module. :)
 
I've just released Beta 0.8 R3, which fixes the lockup in the nav screen when joysticks are enabled!

It also lets you press Alt-J in the launcher menu to jump straight to joystick calibration, and you can now use any button to progress through the calibration, which might be useful for some weirder controller layouts.

On LOAF's suggestion, I've also updated the graphics for the Hornet's canopy during the launch sequence - adding transparency to bring it in line with the other ships. This was apparently a known oversight as the Hornet's graphics were prepared much earlier for the rolling demo.

You can just run the new installer to update, or overwrite the files manually from the ZIP files - your current configuration will be preserved.

INSTALL.DAT : 0x646010A3
MIDGAME.V05 : 0x885C675A
Thank you for those, I'll add them for the next release!

I have an additional hypothetical question. Since you have a launcher that reads game data, i wonder how possible would it be to add support for PCM sound.
I've had it in mind since I really got into the depths that this would be the "ultimate" upgrade for DOS WC1, and would help bring it in line with the Kilrathi Saga version... I know some folks prefer the digital audio over OPL or MT-32. Adding speech support would be relatively easy if things were in place for playing PCM effects.

The most viable/simplest method requires me to improve my tooling for modifying the Borland overlays so I can add entirely new segments... It's definitely non-trivial though. For the immediate future I'm focussed on stabilising and improving the existing stuff, adding a couple of simpler extra features, but once that's all done? I'm certainly considering it! :D

Also the ability to change the Adlib port is excellent!!! I have an AdLib Gold Clone on port 398h, and now i can turn on the surround module and listen to the music with those spatial effects provided by the module. :)
Excellent! That's exactly the sort of setup I was hoping it would help with. :)
 
Last edited:
That is perfect ! Thank you so much !
Question , how about using it with Wingloader ? I see that it fails and checksumm (cause Wing1 already patched with wingloader) how can I bypass this , how can these patches co exist
 
OK I've replicated the nav screen crash - looks like I broke something! The calibration thing is still a mystery though, haven't replicated it yet...

Thanks again for letting me know. :)

EDIT: OK I see what's happened! Hopefully it's a simple fix...
Thanks for the great support!

So about my joystick... I relaunched WC.bat tonight. Did not touch it since being locked in the nav map yesterday. And the joystick was not "calibrated" anymore :(. The cursor went straight to the bottom of the screen!

I immediately tried other games and had no trouble with them. Being unpatched-wc1, wc2, strike commander (without calibrating), Battle Hawks 1942 and X-Wing (this one with a calibration). This is strange.
It is a Microsoft Sidewinder 3D Pro like this one: https://www.ebay.com/itm/164147566365?chn=ps
It is plugged in the port of my sound card, a Pro Audio Spectrum 16.
I think it is recognized as a plain 2-axis 2-button stick by the WC-AT configuration.

I was still using Beta 0.8 R2 as I did not see your message about R3. This one I'll try it during the week-end ☺️

I also attach the chkfail.txt that was produced by my non-gog wc install. I was pretty sure that it was my original installation that I transferred from one PC to another, but it may have been "tainted" by SM1 and SM2 installation from whatever source, as I did not buy them in the 90s (yes I know...)
 

Attachments

Do you plan to write a technical blog or something about your work? I am quite intrigued about the architecture of the code of WC and how you managed to reverse it 😉
I happened to use Ghidra to look at a Gamecube game and reversing a DOS game was always something that I planned to do "someday". But I was never confronted to segmented code and always postponed in fear of the learning curve 😓
 
I'm seeing reports of this "decalibration" problem from some other folks too... I'm yet to see it myself though - I may have to see if I can source some other gameport joysticks! In DOSBox I've tried pretty extensively with XInput and DirectInput devices, so I'm at a bit of a loss currently... I'll be doing some more testing on original hardware later today, so we'll see how that goes.

For anyone using custom DOSBox, please note that I've confirmed classic DOSBox (0.74-3) does have issues with joystick support; especially 4-axis mode seems broken for me (i.e. broken in DOSBox code)... Earlier DOSBox-Staging versions also seem to have issues. I haven't seen any issues with any of the SDL2 versions of DOSBox-X that I've tried. The DOS download includes configs for DOSBox-Staging and DOSBox-X, which I definitely recommend referring to.

how about using it with Wingloader ? I see that it fails and checksumm (cause Wing1 already patched with wingloader) how can I bypass this , how can these patches co exist
They can coexist in the sense that both can be installed at once... :)

W.C.A.T. needs its own clean copy of the original files, since it needs to modify/patch them in its own specific ways. I don't want to speak for @Destro, but I believe his focus is entirely on working with/improving the Kilrathi Saga version for Windows, which is a different beast. He could add a new option to launch W.C.A.T. if it's installed perhaps, if he wants to? Not sure!

Do you plan to write a technical blog or something about your work?
I'm planning to do a write-up at some point, yes - I have pretty much a book worth's of notes. :D

I've used Ghidra for Windows stuff, but haven't had much luck with it for DOS personally (16 or 32-bit); hopefully that improves over time! For this one I used IDA Pro 5 - the old freeware version which the ScummVM project (which I also contribute to) got permission to distribute - later versions apparently largely dropped 16-bit support. The reversing aspect has been something I've been chipping away at for several years at this point - partly with the speed fix ambition in mind, but also for Confederation and Originator, my other two projects here.

And thank you for the CHKFAIL.TXT - I may have to adjust my approach to file verification/patching in a future version to cope with more possibilities...
 
Last edited:
Hey i tried R3, with my Deluxe CD version F3.1. The Secret Missions 1 file called MIDGAME.V05 is still giving me a checksum error:

MIDGAME.V05 : 0x885C675A

But the lockup on the nav screen seems to be fixed indeed, great job!!
 
Hey i tried R3, with my Deluxe CD version F3.1. The Secret Missions 1 file called MIDGAME.V05 is still giving me a checksum error:

MIDGAME.V05 : 0x885C675A
Thanks for that, yeah sorry I only saw you'd posted those after I'd released R3. I need to double-check some things with these other versions, but they should be compatible with R4 one way or another - should be out in the next couple of days, hopefully. :)
 
Excellent travail sur ce moteur de jeu. Le jeu fonctionne a merveille sous dosbox-x. Par contre la version française, et surement les autres versions de traduction ne fonctionnent pas avec. Est-ce qu'il y aura une version localiser ou non?
 
Excellent travail sur ce moteur de jeu. Le jeu fonctionne a merveille sous dosbox-x. Par contre la version française, et surement les autres versions de traduction ne fonctionnent pas avec. Est-ce qu'il y aura une version localiser ou non?
I would love to include translations - I do need to figure out how best to combine them with my work... Are these the latest French patches? WC1 (and WC2, for the future...)

It might take bit of work, so I'm not sure if it will be in the next release or not, but I'll try to get to it soon. :)

I need to track down the translations for other languages... I know there were several others. I'll give the authors credit inside the launcher when their translation is selected!
 
Back
Top