3 ms·
Microsoft leaned in hard to videogame support, but never did improve DOS emulation to a point where you could practically play much of anything in a window. In
by userbinator 6y ago
Microsoft leaned in hard to videogame support, but never did improve DOS emulation to a point where you could practically play much of anything in a window. In fact, I seem to recall NT did a little better at this at times. You'd think they could have managed it under 9x, and that they would have considered it worthwhile, but perhaps it's a harder trick than I think.
That's actually something handled by the video driver, or more precisely, the VXD responsible for virtualising the GPU; and although MS did write a few of their own, that is typically supplied by the GPU vendor.
The whole DOS-based Windows product line, from Windows/386 onwards, are better thought of as thin bare-metal hypervisors, like Xen, rather than a traditional OS. The main difference is that instead of contemporary virtualisation that denies guests access to the host hardware by default and requires specific "passthrough" configuration otherwise, Windows allows guests to access the hardware by default, and traps and virtualises only the bare minimum necessary for itself.
I recently experimented with writing a minimal VESA video driver ("framebuffer") for Windows 9x, and it was a very interesting experience; there's a usermode component (running in 16-bit protected mode, basically a DLL) which is called by GDI for the various drawing calls, and you can either implement acceleration if you can, or pass it on to the DIBENG ("DIB engine") to have it do all the drawing in software. This component is actually surprisingly easy to write, since all you need to do is set the video mode and pass DIBENG the framebuffer to draw into; I was able to get Windows to boot with the driver and graphical Win16/32 apps using it with around a weekend of work.
Trying my driver on various physical and emulated hardware revealed that with some GPUs, although Windows applications worked perfectly, opening just a DOS prompt window would corrupt the screen, yet full-screen DOS worked fine. I discovered that although Windows' built-in VXDs virtualised a standard VGA, if the video BIOS or DOS apps accessed the hardware beyond the standard VGA registers, it would not be trapped by the VXD and thus the state would "bleed out of the VM". A lot of super-VGA hardware is "hidden" inside the same interface as a regular VGA, which explains how my user-mode-only driver didn't encounter this issue; but others have more registers and I/O ports which Windows didn't know about.
I have yet to find the time to write the VXD component, but I think it's definitely possible to get graphical, even high-resolution, DOS graphics to work well in a window.