My History With MechWarrior
Back
in 1988, when I was in the Finnish counterpart for senior high school,
Battletech run on cable. If I remember correctly, the channel was a
British one, Super Channel, or something like that. Some years after
that I found a game called MechWarrior. After I realized this game had
similar theme as Battletech, i.e. big robots battling it out, I bought
it.
Almost ten years passes, it's 1997, and I'm on a business
trip to Seattle (visiting Geoworks). Guys over there take me to this
arcade hall in University district to play a MechWarrior style game in
which you sit in these closed pods with multiple displays and such.
What a blast it was!
On that same trip I bought MechWarrior 2,
GBL, and Mercs. They might have been bundled up in a big box, I can't
remember for sure anymore. I played through MW2, and GBL. Mercenaries
was the one I didn't finish due to many reasons: three moves within
Finland, marriage, two kids, a house that needed renovating, other
hobbies, work (damn!), ...
MechWarrior 2: Mercenaries
<Warning!
Win32 coding references mentioned here without explaining them. If you
don't understand, don't worry, skip to the patch guide.>
Every
now and then I thought about playing through Mercs. In February of 2007
I finally decided to play it through. I installed it on my Thinkpad
X60s running XP SP2, only to find out that it doesn't work. I figured
out that since it was a game for Win95, it should work also on XP,
since the APIs haven't changed that much.
After stepping through
the code with OllyDbg, I found a place which caused the game to quit
when starting up in XP. The culprit was a call to BitBlt() in GDI32.
The game expected the call to return the number of lines blitted,
instead of a flag indicating success/failure.
All it took to
play the game (non-3D v1.05), was to change two bytes in MW2SHELL.DLL.
Then I found v1.10 from the web and tried to do the same patch there.
Didn't work! Between those two versions, Activision had taken Lee
Hasiuk's code compression system into use, and that caused a lot of
virtual gray hairs for me (I'm bald). Hacking these protected DLLs
would generate a maintenance problem: the would need to be a patch for
each version of the game.
Then I thought that a nicer
solution would be to isolate the game binaries from the system DLLs via
proxy DLLs, and editing the game binaries to use these proxy DLLs. This
way the same proxy would (should) work for all game versions.
After
studying various approaches into generating these I came up with the
solution presented on my CodeProject page (see link on left). Via these
proxy DLLs v1.10 3D version runs 1024x768 resolution on my laptop, and
1600x1200 resolution on my laptop's external display.
How is this
possible? I noticed that when the combat mode, i.e. the simulation,
starts it reads from the Windows registry which display to use and at
what resolution. My proxy for ADVAPI32.DLL intercepts the calls to
reading these registry values and returns the values written to the
registry by the PREP.EXE utility. The combat mode is happy with those
values and starts the combat mode.
I occasionally do get a crash during the game. They are so rare for me, that I haven't bothered to look for the cause of it.
MechWarrior 2: Patch Guide
New version includes two new files: Vim.exe and
MercsProxyPatcher.bat. The batch file uses Vim to search and replace
text in the files required to be patched.
To apply the patches:
1. Install the game.
2. Optional: Install the v1.10 upgrade. As mentioned, this is optional, some people prefer v1.05 over v1.10.
3. Download the zip file from the link above.
4. Extract all files from the zip file into the game directory.
5.
Run MercsProxyPatcher.bat in the game directory. When Vim does its
magic the console window may beep and flash. Don't panic, it's business
as usual.
6. Run MechPrep.exe to set your preferences for D3D
playing. This step is optional. You need to perform this step if you
upgraded to v1.10. If you chose to play v1.05, you can omit this step.
MechWarrior 2: Patch Guide (old manual version)
Note!
I'm using DLL names GDI42, Kernel42, etc. because that way there's no
risk whatsoever of these overwriting the system DLLs GDI32, Kernel32,
etc.
You might want to make backups of the binaries that are
going to be edited in case something goes wrong. But this is not
necessarily required as the binaries are also on the game CD.
v1.05 (my version of game installed as this)
To play the game:
- Copy GDI42.DLL into the game dir.
- Use a hex editor, such as XVI32, to edit MW2SHELL.DLL to use GDI42.DLL
instead of GDI32.DLL. Use your hex editor's Find-function to find
GDI32.DLL in MW2SHELL.DLL, change 32 in
to 42 and save the DLL.
- Now edit the file called MW2SND.CFG in the game directory. The file
consists mostly of binary data, but starting from offset 38h (56
decimal), there is a filename. It may be either MCGA.DLL, or
VESA480.DLL. Change it into VESA768.DLL and save the file.

- Copy VESA768.DLL from either the game CD, or game install directory's VFX subdirectory into the game directory.
- Enable Win95 compatibility mode for the game.
- Now the game should start on XP and it should run on 1024x768 resolution.
v1.10 3D
- Follow the steps as in v1.05 patching.
- Copy ADVAPI42.DLL into the game directory, and edit MERCSW.DLL to use that DLL.
Update 16-May-07: You need to apply this ADVAPI42.DLL change to MW2SHELL.DLL as well.
- Run the accompanied PREP.EXE to specify the resolution and effects you want to use.

- Now the game should start, and combat mode should use the resolution set it PREP.EXE.
Support
A
known bug: after a battle the summary screen may sometimes be blank.
That can be fixed by going to the save/load screen and returning back
to the summary screen. Then the summary screen will be drawn correctly.
If you have questions regarding these patches, take it to MekTek discussion boards. Someone may help you there.