Hello everyone! Thank you very much, vvbee, for this project, and congratulations for your work. It is always amazing to see new projects of this kind.
I spent some time debugging Destruction Derby and, despite my limited skills, I made some interesting discoveries I want to share with everyone in this thread.
In first place, I made a proper No-CD patch that retains the ability to play music tracks from any inserted CD-ROM, either on a real unit or a virtual one. Of course it still works with no CD-ROM inserted and even if the system has no CD-ROM units at all (the original patch fails to launch in this case). It can even be used with a winmm wrapper to play the tracks from ripped files on the hard disk, I tested it with the one included in DxWnd (which is, by far, the best that I'm aware of).
The following patch is mean to be applied to the original DD.exe executable from the CD-ROM, or the No-Diamond patched one. Do not apply it to the old No-CD patched one, it won't work as expected. With an hexadecimal editor, make the following changes:
- At 0x786F change 55 89 E5 with 33 C0 C3
- At 0xB293 change 75 5E with 90 90
In second place, I made a patch that allows the game to be executed on Win10/11 (XP should work t0o) without requiring the handle exceptions trick from DxWnd/DxWrapper or the IgnoreExceptions compatibility shim. Upon launching, the game tries to execute some CLI/STI instructions, which are privileged ones, and should never be executed by userland processes (Windows 95 was crazy times). The following patches NOP these instructions, preventing the exception that makes the game crash:
- At 0x25782 change E8 41 24 FE FF with 90 90 90 90 90
- At 0x258FF change E8 C6 22 FE FF with 90 90 90 90 90
The above patches, combined with WineD3D 10.1 as DirectDraw wrapper and the s3dtkw.ini file configured at 640x480 and limited to 60 fps, allows the game to be run on Win10/11 flawlessly. I tested it on Win10 22H2 with modern hardware (Intel Gen 12th CPU and a 4070 GPU) and a Win11 VMware virtual machine, and everything seems to work fine.
If the game crashes at launch with a memory write error, disable any compatibility modes that could be enabled. If the problem persists, try to rename the executable to anything else, as sometimes Windows insists to automatically apply compatibility settings (specially if the process crashed before).
DDrawCompat 0.5.3 can also be used instead of Wine3D3, but it has a very annoying issue. Sometimes when loading the menu or a race, the image freezes but the game continue to work in background (you can tell by the sound and game responding to key presses, but the image stays still). When this happen, press shift+f11 to enter the DDrawCompat setting menu and change the RenderColorDepth parameter to any other value, this will temporarily fix the issue until the next race is loaded.
Also tested dgVoodoo and CnC-DDraw, both of them cause a memory write error at launch. This is probably easy to fix, but I have no DirectX skills, so I can't debug it. Anyway, WineD3D seems to work perfectly.
If anyone tries any of the above patches, It would be great to have more feedback.