xsaveopt wrote on 2025-01-19, 10:45:
Hi!
I'm building an emulator, and I have come to realize that emulating the CPU is not actually the difficult part. Up to Windows 3.1 you just need to do real mode, and for everything up to at least XP you can get away with protected mode and maybe x87.
Hi there, as for Windows 3 I recommend checking out sources of OTVDM/WineVDM and Win3mu.
https://github.com/otya128/winevdm
Win3mu Soon OpenSource
For Windows 3.x, I would choose an 80286 as the bare minimum.
Emulating at least 4 MB of RAM, the HMA and 64KB or more free RAM in the UMA region might be recommended.
Windows 3 also wants memory that's contiguous, so a higher memory expansion is not a bad idea per se.
It helps against memory fragmention caused by applications, which slows Windows 3 down.
If support for Windows 3.0 in Real-Mode is a thing,
then emulation of a LIM 4 or EEMS compatible EMS board should be provided.
(It support Small-Frame and Large-Frame type; 64KB and 256KB page frame AFAIK).
EMS for Real-Mode Windows is no luxuray, I think.
Windows 2 and 3 are so big that little conventional memory will be left to Windows applications.
That being said, many Windows 3 applications available in the wild need the Protected-Mode kernals (krnl286.exe, krnl386.exe).
Applications like Visual Basic, Turbo Pascal for Windows, Quick C for Windows etc. won't run in Real-Mode.
Also, many of the early professional Windiws 3.0 applications were made using Win386 extender by Watcom (FoxPro, SQLWindows etc. I think).
It requires an 80386 and has its own 32-bit version of Win16 API - it's very interesting. OpenWatcom still has Win386 support.
So all in all, a good old 386 might be the practical real-world minimum to fully support Windows 3.x with all its features.
Things like WinG, SVGA drivers/DCI, Win32s, WinMem32, virtual memory etc.
Speaking under correction, though, since I'm just a layman and no emulator writer.
Good luck, though! 😃🤞
Jo22
PS: Better avoid emulating PS/2 mice and use serial or bus mouse etc.
The combined PS/2 keyboard+mouse VXD of Windows 3.x in 386 Enhanced Mode is quite complex.
Also, serial mouse is less likely to be "jumpy".
Edit: I forgot, there were patches for Windows 3.0 by intel for the Inboard 386.
That's an 386 accelerator board for IBM PCs.
Anyway, the thing is that these patches make Windows 3.0 run in 386 Enhanced Mode on an XT architecture (one DMA controller, one IRQ controller).
The patched DLLs can also be injected into Windows 3.1, I read.
So Windows 3.1 (Enhanced Mode) can be run in an XT environment.
Edit: I recommend emulating the AT&T/Olivetti extension to CGA, if CGA is being chosen.
It can do 640x400 mono and is a simple, logical extension to 640x200 hi-res mono mode.
Windows 2 and 3 do ship with the Olivetti/AT&T driver and by using it will look much better than in ordinary 640x200 pixel resolution.
Also, most Windows applications will need 350 lines anyway to fit on screen (same amount as Hercules and EGA had).
Just to be safe please make sure the BIOS string contains the Olivetti part, so no patching is needed.
QuickBasic applications needed a bit of patching.
Olivetti/Logabax/AT&T/Toshiba 640x400 hi-res graphics mode
Edit: Please have a look at how pretty Windows 3 can be in 640x400 mono (we're not affiliated):
https://www.retrospace.net/infoseiten/readm.php?id=125
"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel
//My video channel//