This thread is dedicated to my second attempt to run the Mechwarrior 2 game (in some of its different releases) in a DxWnd-only way. I see that BEEN_Nath_58 already published a guide to do this using a combination of DxWnd and shims, and I'd like to move one step further ...
I will start with Mechwarrior 2 Pentium edition. According to the guide the game can run using a dedicates sdb with (as far as I could guess) just two shims:
IgnoreScheduler
EmulateCDFS
Now, both these shims could be emulated by DxWnd flags, but maybe not closely enough. Maybe it's possible to improve the built-in implementation of these shims. Also, it seems that the most recent DxWnd releases are not supportig this game and this is another problem to be fixed.
The hunt begins ...
Last edit: gho 2023-11-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well they support. I wrote in the thread 2.05.96 because .97 had that Lego Loco 8bit color bug.
The biggest problem I noticed, other than the shims, is the Fake HD I/O logging that was very empty. Game wise, there is a random but easily recurring hardlock that happens in Wolf or Jade Falcon clan Training room, once you end a mission and play another (can happen anytime)
Last edit: BEEN_Nath_58 2023-11-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yesterday I tried to follow the procedure with a MW2 Pentium CD but I failed: the CD does not have a "Setup.exe" file, there is another installer but it seems to be incompatible with both otvmw v8.1 and 9.0 (I go by heart, I could be more precise later). In short, I suspect that there could be different Pentium edition CDs. Is that possible?
On another front, I revised the Microsoft EmulateCDFS shim and its target is much wider (that is, more kernel32 calls to be hooked) than my implementation, that could explain the partial effect of DxWnd on this game?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I will start with Mechwarrior 2 Pentium edition.
the CD does not have a "Setup.exe" file,
You are following the "Titanium Edition" guide from that site. The Pentium Edition guide is above it.
I revised the Microsoft EmulateCDFS shim and its target is much wider (that is, more kernel32 calls to be hooked) than my implementation, that could explain the partial effect of DxWnd on this game?
Actually that wasn't needed...the Fix buffered I/O after Win98 was always there which worked correctly, but since you added it, lets keep it.
The thing that I need specific help for is:
Fake HD File I/O logging
IgnoreScheduler implementation (not the most important thing though)
If possible, make the training sections more stable.
Update: The followig update is for Software version of Titanium Edition. When I enable FakeHD, the game wants 256 color desktop, but I already enabled that in Video tab. I want that because the game, when I exit a mission, locks up when returning to the GDI-based menu.
Last edit: BEEN_Nath_58 2023-11-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The no 3. point above, this seems to be fixed using EmulateHeap, the game no longer is unstable but we all know what EmulateHeap does on Win11. The solution is to add the "only subset" required from the shim, but it would be required to know what is needed to be added.
About the MANY EDITIONS, the only reason you see Titanium and Pentium is because all games are based on one edition or the other, or an intermediate between the two.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, the start is quite encouraging.
I installed the CD (full install) to a WinXP VMWare (there's no way to run the installer on a 64 bit architecture!), applied the patch and brought the files back and the registry on Win11.
First of all I'd like to signal a few problems that may (I'm not sure) affect someone that is trying to follow your guide:
1) In the installed files I got a 16 bit version of MW2.DLL and MW2SHELL.DLL. I don't know how they got there, but I recovered the 32 bit versions of these files directly from the CD and they worked
2) The mech2startupfix.bat script references a %CD% environment variable that I don't know how it should be initialized
After that, I tried to go on my way, making a portable version with emulated CD, CD audio and registry and without applying the shims in the .sdb file. I also found some very interesting news.
At the beginning, the game had crash situations. Looking at the logs I found exceptions for missing execution permission, so I added the Suppress DEP" flag. This way the game works well enough, but sometimes it hangs for a while (for almost a minute) and then recovers. This seems caused by the addition of execution permission that is made on a single instruction at a time. I think I should make a better implementation that, when a DEP situation is detected, it would add the permission to the whole data segment.
To replicate my testbed, remember that in addition to the profile and ripped audio tracks you will also have to create the cd folder for the fake-CD and copy in there the OLD_HERC.DRV file that is used as a copy protection.
Not sure how you got 16bit files, how do you even know they are? Was there any error?
The startupfix bat is just a automatic installer of the sdb files, DxWnd doesn't need to handle it. Only thing DxWnd can add to remove this is a WORKING IgnoreScheduler.
The other problem I mentioned is EmulateHeap related, that the game needs (but not the entire one). The game will hang if you continuously exit and enter missions (specifically Training missions have this most).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Umm the game CD doesn't even have a 16bit file. It could be quite possible that the file got corrupted. At least the Titanium Edition installed corrupted files on my machine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some more news (this time not so good). Analyzing the exception records I found that the segments with no execution permissions are private memory area mostly filled by zeroes. This raises the doubt that they are not proper code segments but instead data segments like heaps where the instruction pointer accidentally lands. I want now to see the differences with your settings, returning to the shims and a more conventional configuration...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Let me know if you want to know the purpose of each setting...
Returning to the shims, the more difficult (and maybe tedious) thing would be to configure a limited EmulateHeap, one that is free from FAULTS of Win11, and one that handles the mission exit and entry correctly.
Note: As I updated to Win11 23H2, some of the EmulateHeap related crashes got fixed. This includes GTA Vice City on Win98 compatibility mode, as well as Mech2 Titanium installer on Win95 compat mode. It is quite possible the errors are caused by DEP. The common error that's always visible in these 2 Windows releases is MCI RELATED errors. If you run MW2 Pentium Edition SETUP.EXE (autorun program) with Win9x compat, you'll probably get an error related to MCI.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good news: One user played MW2 Titanium from start to end without any problems. Phew!
Now he says he didn't hear the CD audio...on investigation (since I heard it)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need some more details about this. Where the idea comes from?
I don't know if this answers the question, but you can surely remap a memory segment to some other place, but if you do this after that the program has stored some memory addresses, then it is too late, the program will keep using the old addresses.
When I wrote the "Virtual Heap" flags, that was a serious problem: despite the early hook, when you allocate the heap segments somewhere else, you still have some segments allocated at the program start (by who? good question...) so DxWnd wrappers will have to keep handling a mixed situation.
About the "Emulate Win9X heap" implementation, I think there are sad news: it seems that not only BatteryShark made no progresses to port its code to Win11, but he also deleted the project from GitHub.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
About the "Emulate Win9X heap" implementation, I think there are sad news: it seems that not only BatteryShark made no progresses to port its code to Win11, but he also deleted the project from GitHub.
First things first, save your progress! There could be a reason he removed...
I need some more details about this. Where the idea comes from?
The fact that it is always a memory violation at every "9xheap" location. The memory violation doesn't occur without it, instead malfunction (that's why thhtting exists). If we could just reroute the code to somewhere...
...but if you do this after that the program has stored some memory addresses, then it is too late, the program will keep using the old addresses.
despite the early hook, when you allocate the heap segments somewhere else, you still have some segments allocated at the program start (by who? good question...) so DxWnd wrappers will have to keep handling a mixed situation.
A trial would better explain the concept. I assume the rerouting of heap should be "fast-enough" to not violate the WASAPI, since thattis the biggest issue,
only BatteryShark made no progresses to port its code to Win11
Little confused here, that works in Win11! It doesn't work anywhere under 10
Alternative plan: Is it possible to remove a execution prevention policy (DEP) from everywhere the heap is violated?
Last edit: BEEN_Nath_58 2023-11-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to analyze the situation better. Recently I found that the "hook:DisableDEP" tweak works very well on "Westwood Monopoly" (1995 edition) so I wonder why this works in certain conditions and not others.
About "Is it possible to remove a execution prevention policy (DEP) from everywhere the heap is violated?" in theory the "Handle exception" + "Suppress DEP" flags should do it, though slowly, but in reality it depends also on the type of exception, some situations are not recoverable.
I was concerned about the "Emulate Win9X heap" flag because on my Win11 it causes an immediate crash on SBK2001, while the other flags can somehow mitigate the troubles, so I thought it was malfunctioning.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was concerned about the "Emulate Win9X heap" flag because on my Win11 it causes an immediate crash on SBK2001, while the other flags can somehow mitigate the troubles, so I thought it was malfunctioning.
That's the correct behaviour on WIn11 22H2
"Handle exception" + "Suppress DEP" flags should do it, though slowly, but in reality it depends also on the type of exception, some situations are not recoverable.
Well we don't want to touch exceptions probably. What may be necessary is DEP to create those segments "accessible". HE skipping or NOPing those segnments is already giving errors to a program I suppose.
I used HE + 9xheap in Last Bronx, the game somehow worked, it had black screen and it ran, without HE it crashes at start.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First problem: the installer checks the OS language and pretends an English system. My system is Italian. How to cheat on this? I'll try to find out, unless you already know ...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried changing the system to US english (at the cost of a reboot), but the result didn't change. What is really bad is that the installer is a Win16 program that can't be debugged by a Win32 debugger. I can't even see the import table to guess how the installer detects the system country. And In any case I can't use DxWnd to hook and patch it.
The only option probably is to use a VM with a US OS version and transfer the files in the end.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Consider trying somewhere where the exception occur :0
Otherwise you will just get an installed game without the issue in the installer. I often use a Win7 VM for these. The last time I tested an Activision installer in XP, it worked so if it works there for you, you will need some newer OS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This thread is dedicated to my second attempt to run the Mechwarrior 2 game (in some of its different releases) in a DxWnd-only way. I see that BEEN_Nath_58 already published a guide to do this using a combination of DxWnd and shims, and I'd like to move one step further ...
I will start with Mechwarrior 2 Pentium edition. According to the guide the game can run using a dedicates sdb with (as far as I could guess) just two shims:
Now, both these shims could be emulated by DxWnd flags, but maybe not closely enough. Maybe it's possible to improve the built-in implementation of these shims. Also, it seems that the most recent DxWnd releases are not supportig this game and this is another problem to be fixed.
The hunt begins ...
Last edit: gho 2023-11-14
Well they support. I wrote in the thread 2.05.96 because .97 had that Lego Loco 8bit color bug.
The biggest problem I noticed, other than the shims, is the Fake HD I/O logging that was very empty. Game wise, there is a random but easily recurring hardlock that happens in Wolf or Jade Falcon clan Training room, once you end a mission and play another (can happen anytime)
Last edit: BEEN_Nath_58 2023-11-15
Yesterday I tried to follow the procedure with a MW2 Pentium CD but I failed: the CD does not have a "Setup.exe" file, there is another installer but it seems to be incompatible with both otvmw v8.1 and 9.0 (I go by heart, I could be more precise later). In short, I suspect that there could be different Pentium edition CDs. Is that possible?
On another front, I revised the Microsoft EmulateCDFS shim and its target is much wider (that is, more kernel32 calls to be hooked) than my implementation, that could explain the partial effect of DxWnd on this game?
You are following the "Titanium Edition" guide from that site. The Pentium Edition guide is above it.
Actually that wasn't needed...the Fix buffered I/O after Win98 was always there which worked correctly, but since you added it, lets keep it.
The thing that I need specific help for is:
Update: The followig update is for Software version of Titanium Edition. When I enable FakeHD, the game wants 256 color desktop, but I already enabled that in Video tab. I want that because the game, when I exit a mission, locks up when returning to the GDI-based menu.
Last edit: BEEN_Nath_58 2023-11-15
For a reference:
Been Nath's working guide is here if you ever want to play ANY OF THE MANY EDITIONS: https://www.vogons.org/viewtopic.php?p=1049607#p1049607
More update:
The no 3. point above, this seems to be fixed using EmulateHeap, the game no longer is unstable but we all know what EmulateHeap does on Win11. The solution is to add the "only subset" required from the shim, but it would be required to know what is needed to be added.
About the MANY EDITIONS, the only reason you see Titanium and Pentium is because all games are based on one edition or the other, or an intermediate between the two.
Well, the start is quite encouraging.
I installed the CD (full install) to a WinXP VMWare (there's no way to run the installer on a 64 bit architecture!), applied the patch and brought the files back and the registry on Win11.
First of all I'd like to signal a few problems that may (I'm not sure) affect someone that is trying to follow your guide:
1) In the installed files I got a 16 bit version of MW2.DLL and MW2SHELL.DLL. I don't know how they got there, but I recovered the 32 bit versions of these files directly from the CD and they worked
2) The mech2startupfix.bat script references a %CD% environment variable that I don't know how it should be initialized
After that, I tried to go on my way, making a portable version with emulated CD, CD audio and registry and without applying the shims in the .sdb file. I also found some very interesting news.
At the beginning, the game had crash situations. Looking at the logs I found exceptions for missing execution permission, so I added the Suppress DEP" flag. This way the game works well enough, but sometimes it hangs for a while (for almost a minute) and then recovers. This seems caused by the addition of execution permission that is made on a single instruction at a time. I think I should make a better implementation that, when a DEP situation is detected, it would add the permission to the whole data segment.
To replicate my testbed, remember that in addition to the profile and ripped audio tracks you will also have to create the cd folder for the fake-CD and copy in there the OLD_HERC.DRV file that is used as a copy protection.
Last edit: gho 2023-11-15
Okay so finally your problem comes out as...DEP.
Not sure how you got 16bit files, how do you even know they are? Was there any error?
The startupfix bat is just a automatic installer of the sdb files, DxWnd doesn't need to handle it. Only thing DxWnd can add to remove this is a WORKING IgnoreScheduler.
The other problem I mentioned is EmulateHeap related, that the game needs (but not the entire one). The game will hang if you continuously exit and enter missions (specifically Training missions have this most).
The CFF explorer shows a 16 bit file header structure
sure I will try!
Umm the game CD doesn't even have a 16bit file. It could be quite possible that the file got corrupted. At least the Titanium Edition installed corrupted files on my machine.
Some more news (this time not so good). Analyzing the exception records I found that the segments with no execution permissions are private memory area mostly filled by zeroes. This raises the doubt that they are not proper code segments but instead data segments like heaps where the instruction pointer accidentally lands. I want now to see the differences with your settings, returning to the shims and a more conventional configuration...
Let me know if you want to know the purpose of each setting...
Returning to the shims, the more difficult (and maybe tedious) thing would be to configure a limited EmulateHeap, one that is free from FAULTS of Win11, and one that handles the mission exit and entry correctly.
Note: As I updated to Win11 23H2, some of the EmulateHeap related crashes got fixed. This includes GTA Vice City on Win98 compatibility mode, as well as Mech2 Titanium installer on Win95 compat mode. It is quite possible the errors are caused by DEP. The common error that's always visible in these 2 Windows releases is MCI RELATED errors. If you run MW2 Pentium Edition SETUP.EXE (autorun program) with Win9x compat, you'll probably get an error related to MCI.
Good news: One user played MW2 Titanium from start to end without any problems. Phew!
Now he says he didn't hear the CD audio...on investigation (since I heard it)
@ghotik Is it possible to REMAP the ENTIRE heap segment location to a different memory location? It looks like that's what EmulateHeap wants.
(Offtopic: I was navigating DDC and saw some open threads, in case those are done you could close it, looks better to the eye ;)
https://github.com/narzoul/DDrawCompat/issues/161
https://github.com/narzoul/DDrawCompat/issues/171
https://github.com/narzoul/DDrawCompat/issues/213
https://github.com/narzoul/DDrawCompat/issues/219
https://github.com/narzoul/DDrawCompat/issues/163???)
Last edit: BEEN_Nath_58 2023-11-21
I need some more details about this. Where the idea comes from?
I don't know if this answers the question, but you can surely remap a memory segment to some other place, but if you do this after that the program has stored some memory addresses, then it is too late, the program will keep using the old addresses.
When I wrote the "Virtual Heap" flags, that was a serious problem: despite the early hook, when you allocate the heap segments somewhere else, you still have some segments allocated at the program start (by who? good question...) so DxWnd wrappers will have to keep handling a mixed situation.
About the "Emulate Win9X heap" implementation, I think there are sad news: it seems that not only BatteryShark made no progresses to port its code to Win11, but he also deleted the project from GitHub.
First things first, save your progress! There could be a reason he removed...
The fact that it is always a memory violation at every "9xheap" location. The memory violation doesn't occur without it, instead malfunction (that's why thhtting exists). If we could just reroute the code to somewhere...
A trial would better explain the concept. I assume the rerouting of heap should be "fast-enough" to not violate the WASAPI, since thattis the biggest issue,
Little confused here, that works in Win11! It doesn't work anywhere under 10
Alternative plan: Is it possible to remove a execution prevention policy (DEP) from everywhere the heap is violated?
Last edit: BEEN_Nath_58 2023-11-21
I need to analyze the situation better. Recently I found that the "hook:DisableDEP" tweak works very well on "Westwood Monopoly" (1995 edition) so I wonder why this works in certain conditions and not others.
About "Is it possible to remove a execution prevention policy (DEP) from everywhere the heap is violated?" in theory the "Handle exception" + "Suppress DEP" flags should do it, though slowly, but in reality it depends also on the type of exception, some situations are not recoverable.
I was concerned about the "Emulate Win9X heap" flag because on my Win11 it causes an immediate crash on SBK2001, while the other flags can somehow mitigate the troubles, so I thought it was malfunctioning.
That's the correct behaviour on WIn11 22H2
Well we don't want to touch exceptions probably. What may be necessary is DEP to create those segments "accessible". HE skipping or NOPing those segnments is already giving errors to a program I suppose.
I used HE + 9xheap in Last Bronx, the game somehow worked, it had black screen and it ran, without HE it crashes at start.
Specific for MW2 BATTLETECH games
https://archive.org/download/MechWarrior_2_BattlePack_USA
Here's 2 CDs you need only 1.
Follow the steps in the other thread I posted to be able to run InstallShield through DxWnd window hook.
First problem: the installer checks the OS language and pretends an English system. My system is Italian. How to cheat on this? I'll try to find out, unless you already know ...
Honestly I don't know :)
You could try changing the language once and revert back, as we do for most Japanese games.
I tried changing the system to US english (at the cost of a reboot), but the result didn't change. What is really bad is that the installer is a Win16 program that can't be debugged by a Win32 debugger. I can't even see the import table to guess how the installer detects the system country. And In any case I can't use DxWnd to hook and patch it.
The only option probably is to use a VM with a US OS version and transfer the files in the end.
Consider trying somewhere where the exception occur :0
Otherwise you will just get an installed game without the issue in the installer. I often use a Win7 VM for these. The last time I tested an Activision installer in XP, it worked so if it works there for you, you will need some newer OS.