Monday, April 2, 2018

PC emulator screenshots look weird

If you remember the early PC era, or if you are a hobbyist who uses original PC hardware, maybe you wonder why PC emulator screenshots don't quite look like screens running on real hardware.

It's really noticeable in text-mode screenshots. For example, here's a screenshot of FreeDOS 1.2, taken in QEMU:


And my favorite DOS spreadsheet, As-Easy-As:


In text mode, QEMU emulates a standard PC character set, at 9 pixels wide by 16 pixels high. So it's easy math to understand why this 80×25 display is 720×400 pixels in size.

If you're running FreeDOS on modern hardware, such as a laptop, using an LCD screen (most common today) then this screenshot should look normal to you. The problem is that original PC hardware didn't use an exactly square pixel. So when you compare this 720×400 screenshot to original hardware, the screenshot looks weird.

The pixel hasn't always been a square dot. In modern flat panel displays, such as LCD, the pixel is a roughly square arrangement of red, green, and blue rectangles. Light all of them at once, and the human eye perceives them as a white square.

Original PC hardware didn't use LCD technology, but instead the cathode ray tube. The CRT used a hexagonal arrangement of red, green, and blue dots. Because these were not rectilinear, each "pixel" overlapped with the one next to it.

In the image below, I've modified Peter Halasz's image (cc by-sa) from Wikipedia, showing the arrangement of RGB on both CRT (top) and LCD (bottom). I've also outlined two adjacent pixels, one with a solid white line, and the next with a dotted white outline. You can see the LCD pixels adjoin, where the CRT pixels overlap slightly.


The result is that text on CRT displays looks a little different than text on LCD displays. Not a lot different, but a little different.

Computer displays on the early IBM PC models used a 4:3 aspect ratio, and the character generator outputted 80×25 text that neatly filled the screen. But in modern PC emulators, a pixel in text mode is represented as a single square dot. That means 80×25 text at 9×16 pixel dimensions fills a 720×400 screen, at an aspect ratio of 72:40, or about 5.4:3 aspect ratio. So the text appears too wide, compared to original PC hardware.

If I take the original QEMU screenshots, and resize them to have the same height but narrower image width, I can put the 80×25 display into a 4:3 aspect ratio. These screenshots have been forced to 533×400 pixels, which is 80×25 in 4:3 aspect ratio:



This looks more like how I remember using DOS in the 1980s and 1990s.

So if you've used FreeDOS on classic PC hardware, and wondered why the screen looks a little different than the screenshots we use on the FreeDOS website, that's why. Original hardware used a 4:3 display, but modern PC emulators use a one-for-one pixel display in text mode.

I'd be interested to know of any PC emulators that simulate a 4:3 display, and if they do that through video tricks (such as 3D effects) or by implementing a DOS font with a different height and width. If your favorite PC emulator can do this, let me know.

2 comments:

  1. I think it s worth mentioning that the fonts were 8x16 (or 8x8 in 80x50 mode) bitmaps and that the 9th pixel column was a blank line (bg color) or doubled from the previous line on a per character basis. This was the bane of text mode graphics and shading because all of the shaded character blocks (characters 176-178) had pin striped lines through them!!! This is many times not displayed in modern emulation/displays thus making ANSI graphic look better now!

    ReplyDelete
  2. Some of the builds of DOSBox have postfilters. I don't know of this is one of them, but I suspect you can add it.

    ReplyDelete