Blog

WineVDM Update & Win3mu

18 November 2018

So WineVDM has been out for quite a few months now, and has increased its software compatibility so much in that short time. A large majority of the 16-bit Windows programs and games that I have now work 100% correctly, and the rest work at least partially. I am amazed and pleased, and I thank the developers for their hard work on the project.

Let's take a quick look at Indy's Desktop Adventures again:

Screenshot of Desktop Adventures in WineVDM.

With WineVDM compiled on 2018-11-17.

Comparing it to how it looked and worked when I first found WineVDM (go a few entries back in this blog to see a screenshot), the main game frame is now in the correct position. Also, the speech bubbles have functional buttons; there is now no need to use the keyboard to close them. Only a minor transparency issue remains. The game is of course still completely playable from start to end.

I spent so much time with WineVDM that I didn't notice that the source code to Win3mu was released. Written in C#, it works in a similar fashion to WineVDM. Since the necessary CPU mode to execute 16-bit code is unavailable when running on 64-bit Windows (and is also broken on some newer CPUs), they both provide their own software emulated x86 CPU. The other half of the puzzle is the API "translator". Anytime a program wants to invoke a 16-bit Windows API, it gets redirected to a matching API on the host (or a reimplementation of it). WineVDM uses the API code from the Wine project, whereas Win3mu started from scratch.

The documentation for Win3mu is very scarce, but some things were explained inside the series of articles the author wrote for an online magazine. In case it helps anyone, here is the process I used.

Build Process

You need to have at least Visual Studio 2015. The project targets Microsoft .NET Framework 4.6.1, so install the targeting pack if needed.

The program has a few dependencies, all of which are from the author's other projects. These are: Sharp86, ConFrames and PetaJson.

  • Extract the Win3mu source code into a new folder.
  • Open the Win3mu folder, and unpack the contents of the Sharp86 CPU emulator into the empty Sharp86 folder inside.
  • Extract the ConFrames source into Sharp86\ConFrames.
  • Extract the PetaJson source files into Sharp86\PetaJson.

VS2015 was not happy with the project file for PetaJson (VS2017 might be alright with it). To resolve this, create a new C# ClassLib project within the Win3mu solution. Add the PetaJson.cs file into that project, and remove any other files that may have been automatically generated. Fix the references to PetaJson within the other project files, then remove the original PetaJson project. I also had to define PETAJSON_NO_DATACONTRACT within PetaJson.cs.

After that, it should all build and give you a number of binaries.

Usage

From what I can tell, the following programs do the following things:

  • win3mu.exe: This is the main emulator program. Invoke it with the full path to the target 16-bit program, otherwise it won't load.
  • win3muProxy.exe: This is a 32-bit template program for the tool.
  • win3muTool.exe: This tool is used to "convert" a 16-bit program into a 32-bit one. It renames the 16-bit program to have a .exe16 extension, then it takes the mainicon from that and injects it into a new copy of the proxy. The proxy takes over the original program.exe filename. Now you have a nice looking program file that Windows will be happy to run. Note: You have to set the registry key HKLM\Software\Win3mu Location string to where you put the Win3mu program files to make it work.
  • win3muShell.dll: I think this is an attempt to get the icons out of 16-bit program files without having to use the conversion tool. I could not make it work, though.

Compatibility

WineVDM is miles ahead, almost certainly thanks to the Wine codebase. But Win3mu can run many simple programs too. It does seem to need the actual Windows 3.1 library files to run some of those, especially win87em.dll. If you're trying it out, it is best to have a real 3.1 installation to hand so you can copy in any necessary files.

Programs that do work look really nice. Take a look at these comparison screenshots of Yacht 2.21 by Frank Bielsik.

Screenshot of Yacht in Win3mu. Screenshot of Yacht in WineVDM. Screenshot of Yacht in Windows 3.1.

1: Win3mu. 2: WineVDM. 3: Windows 3.1.

The scaling is a bit different in all cases, but pretty accurate. Win3mu adds font smoothing to the program.

The tool from Win3mu could be modified to create a converter for WineVDM instead. However I think the current methodology that borrows NTVDM64's mechanism (intended as a shim for 16-bit installers of 32-bit programs) works better. You only need to create a shortcut of the program and change the icon to look equally nice.

Summary

If you're looking to run old 16-bit Windows programs, then WineVDM is still the way to go. Win3mu is a nice second option for a problem that was practically unsolved only a short while ago.

Return to Blog Index