VOGONS


First post, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

As posted in this thread by LCountach:
Re: MechWarrior 2 3dfx edition

Original Source:

http://kontza.googlepages.com/mechwarrior2%3A … ariesxppatching

My History With MechWarrior […]
Show full quote

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 whch 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.

Knowing the every changing state of the internet I included all of the files from the page and attached them to this post.

Looks like he posted here back in January:
MW2:Mercs on WinXP

I think I saw the thread in passing but I didn't get a chance to read it at the time.

Last edited by DosFreak on 2007-08-16, 11:34. Edited 1 time in total.

How To Ask Questions The Smart Way
Make your games work offline