Emulated CGA+MDA Dual-Displays in DOS with IBM LOGO and MartyPC
So I was going to write about IBM LOGO for the PC-XT, but then I fell down a rabbit hole.
Dual. Screens. In. Dos.
I had heard of such things as a youngling but I had never witnessed them.
Now as a nostalgic greybeard I was intrigued when I stumbled upon the .SETSCREEN command in the IBM LOGO for DOS manual that I was reading for my post about IBM LOGO.
Multiple monitors in DOS was never very common. Of course it required two video cards, and one of them had to be an MDA card (or hercules, maybe?). MDA stands for "Monochrome Display Adapter" but more specifically it was a text-mode only adapter; no graphics modes.
That's basically the magic that makes it work. The MDA card is so old and weird that it can exist alongside newer CGA or EGA (or even VGA?) cards without hardware or driver conflicts.
Okay so first I needed to get a PC with an MDA card and a CGA card or something. Those aren't easy to find. So I tried configuring such a thing in QEMU; no luck there either. It only has VGA devices and adding two crashes my VM.
Then I found MartyP
C. MartyPC advertises dual monitor support for dos. I got a PC with both cards. Now just to get it working.
C. MartyPC advertises dual monitor support for dos. I got a PC with both cards. Now just to get it working.
MartyPC is written in Rust. I just recently installed Rust, so it was easy to check it out with git and build it with cargo. But getting dual monitors to actually work was a puzzle that took a while to solve.
The docs are a bit sparse, and the blog post announcing the dual screen support did't go into details. So I figured "maybe it will just work". I tried booting off the IBM logo floppy image file, Nope.
Undeterred, I began investigating the MartyPC configurations. Poking around the UI it seemed like it could support multiple monitors, but was only configured for one. So I dove into the config files and started playing with various config options. I figured out the appropriate command line:
cargo run -r -- --machine-config-name ibm5160_hdd --machine-config-overlays ibm_cga_and_mda
Now I could see the CGA and MDA adapters, but I still coldn't figure out how to get the 2nd screen to appear in a window somewhere. I was getting slightly frustrated and making a last cruise through the configs before giving up, when I found the "disabled by default and unmentioned anywhere-else second screen config".
# Second window, optional. Set 'enabled' to true to activate.
[[emulator.window]]
-enabled = false
+enabled = true
name = "Secondary Window"
size = { w = 800, h = 600 }
resizable = false
-card_id = 0
+card_id = 1
card_scale = 1
scaler_preset = "Green CRT"
always_on_top = false
Yay! Now I have two windows! But LOGO is STILL refusing to go into 2 screen mode. Fsck.
So on the reddit post I noticed in the two-screen screenshot OP had used the `MODE MONO` command to move the DOS console to the MDA screen. Okay, maybe I have to do that to make logo happy.
The LOGO disk image, while a bootable DOS disk, does not include the MODE command, and it is not mentioned in the IBM LOGO manual, which is terrible BTW. It's largely the same text as other LCSI-derived LOGO manuals but organized "stereo-instructions" style.
So I started downloading FreeDOS. Frick that's big. Oh nuts MartyPC doesn't emulate a CD-ROM so no live-CD ISO. Nuts to FreeDOS, I'll just get the MODE.COM file. Oh this one from DOS 1.25 should work.
It didn't. "DEVICE UNAVAILABLE".
I tried switching the order of the MDA and CGA cards. DOS came up on the MDA display, and so did LOGO, but it refused to do any graphics at all let alone .SETSCREEN 2.
I was about ready to give up, but investigating DOS 1.25 MODE.COM a bit more revealed that it was NOT CGA-aware. Ok let's try DOS 6. Fffff it freezes on boot on a useless CDROM driver. Ok DOS 5 then. Crap this is an install disk... Whatever, install DOS 5 to my 20mb C image.
Along the way I also downloaded a full set of IBM PC ROMs, Not sure which if any I really needed, but it was a 10MB download for like every PC-era ROM ever including CGA, MDA, and hard disk controller ROMs. MartyPC wouldn't boot with a hard-drive configured VM unless I installed the HD controller ROM.
OK so I booted up DOS 5 and mounted the LOGO floppy image.
MODE MONO
Of course it's Crap-G-A graphics which were laughably bad even in 1983. It's easily one of the most visual displeasing color LOGOs. You've got two pallets to choose from, ugly and uglier. And did we mention there are only 4 colors per pallet? And one of those is the background color? At least IBM LOGO supports artifact background colors giving us a whopping 16 background color choices, most of them hideous to the eyes.
Not that Apple II graphics were much better, but they were better. IBM really messed up with their early attempts at "color" graphics. All hail Woz.
See? Four colors NOT including the background! Take that, Big Blue. Fewer background choices overall though. The Apple II turtle can also draw artifact colors, but it's of questionable usefulness.
Anyway I'm getting tired. I'll most more classic LOGO stuff eventually. Ciao.
Comments
Post a Comment