• Please review our updated Terms and Rules here

CGA 640x200 (Screen mode 2) - Black & White or Greyscale?

kyodai

Experienced Member
Joined
Jan 26, 2011
Messages
467
Location
Kerpen, Germany
I guess this is a long shot - not sure if anyone can answer this...

So CGA 640 x 200 mode (SCREEN 2 in BASIC) "should" be 2 color mode. By default Black is background color, white foreground color. By definition it should be possible to set the foreground color to one of 16 CGA palette colors. I've made so many Black&White appz for this mode, but i noticed some games like Kings Quest use shades of grey on a monochrome 640x200 screen. heck even Microsofts "Visual basic 1.0 for DOS" uses grey scale while they say in the HELP text that "SCREEN 2" is only 1-Bit - Black or white. The irony... So how do you actually use greyscale in 640x200 monochrome? Is that some kinda hack that everyone knew back in the days?


Wikipedia has a wondeful example of how my graphics look in 640x200 @ Black&White:

Cga_640x200.png
 
There are no shades of grey. You only have 1 bit per pixel in 640x200 mode. So it can either be black or white. Or to be more exact, black or foreground colour.
I'm pretty sure that King's Quest has no 640x200 mode, but uses 640x200 mode as its 160x200 composite mode. In which case you get 16 NTSC artifact colours:
1k07_cga_composite_solid_colors_1.png

Many games of that era had composite and RGBI modes. And if you start such a game in composite mode on an RGBI screen, you'll just see 640x200 black and white.
 
Screen 2 gives only two colors. However, they can be any two colors from the 16 in the RGBI palette - so you can have black and white, black and grey, purple and blue if you want.

VB for DOS, though, is a text-mode application, not a bitmapped one. So it has an attribute byte for each character cell, meaning that characters can have any combination of colors 0-7 for the background and 0-15 for the foreground.
 
Screen 2 gives only two colors. However, they can be any two colors from the 16 in the RGBI palette - so you can have black and white, black and grey, purple and blue if you want.

VB for DOS, though, is a text-mode application, not a bitmapped one. So it has an attribute byte for each character cell, meaning that characters can have any combination of colors 0-7 for the background and 0-15 for the foreground.


So which mode does VB for DOS use when you run it on a monochrome 640x200 screen? I always found it embarrassing that the editor looked better than the compiled programs... XD But yeah let's not discuss about how bad Visual basic is...
 
So which mode does VB for DOS use when you run it on a monochrome 640x200 screen? I always found it embarrassing that the editor looked better than the compiled programs... XD But yeah let's not discuss about how bad Visual basic is...

If you're talking about CGA, do monochrome screens even exist? I mean, what's the point of connecting a monochrome screen to a Color Graphics Adapter?
There's MDA and Hercules for that. These have 3 'gray scales indeed'. There's an intensity attribute, so you have black, 'white' (or whatever colour your monitor is), and 'bright white', when intensity is used.

The only 'monochrome' option I know for CGA is the built-in screen for the IBM 5155. In which case we're talking about a screen connected to the composite output of the CGA card, so technically it just gets 16 colours, but it only interprets the luminance of these colours.
I suppose on a colour NTSC display, if you were to disable the colorburst signal, you'd get the same effect: no chrominance, only luminance.
But your effective resolution will be much lower than 640x200 of course.
 
80-column text mode will display in 640x200 on the CGA, where there isn't a higher-resolution mode available. (In this case, it uses the same 8x8 character set as 40-column mode, only horizontally compressed.) It's only more than 200 lines on MDA systems, EGA with a high-resolution monitor, or VGA.

Re: monitors, I got a CGA display from lutiana that has a switch for black & white, green, or amber display modes :D
 
Well actually pretty much all DOS-based palmtops use a 640x200 CGA monochrome screen. Most prominent example would be the famous HP 200LX. Theres a few dozen other ones that use pretty much the same screen, just in a bigger dimension ("Zeos pocket"). The cool thing is that the screens of these keep the aspect ratio so by todays standards you would call them an "Ultra wide screen" i guess...

Some early "laptops" like the "IBM PC convertible" also had the same aspect ratio 640x200 CGA monochrome screen - the IBM was even backlit.

Well when i run Visual Basic for DOS on my HP 100LX it looks like this:

1493473321.jpg



So i was just curious how they do the greyscale trick... Is that really just some text mode or so?





This Help text makes me crazy - reading that it only supports Black&White, reading it in 640x200 monochrome greyscale... XD

1493430410.jpg
 
Last edited:
It's probably just some circuit in the display that remaps the 16 RGBI values of CGA to 16 gray scales.
The CGA adapter doesn't 'know' that it's monochrome, like with the 5155.
The same generally goes for EGA and VGA with monochrome screens. You can just use 'colour' software, and it will map to grayscale, the rest of the system doesn't know about it.
However, EGA and VGA at least have specific configuration settings to act as a 'monochrome' adapter (basically taking the place of an MDA/Hercules adapter, so it can be paired with a 'colour' adapter, for dual-screen). CGA cannot do this, it is always the 'colour' adapter in a system. CGA does support 'monochrome' modes in the sense that you can use certain modes with or without colorburst on composite screens. On an RGBI screen, it doesn't do anything of course.
 
OK, now imma be a nitpicker... Some games like the old Sierra games had a CGA monochrome driver that displayed in proper 640x200 Black&White as I'd expect it.

But let's take Prince of Persia for example... There is clearly some greyscale and I'm pretty sure this is not text mode...

Example (Look at the torch to see some true greyscale which is NOT B&W dithering):

1493425897.jpg



I have magnified it a bit so you can see it easier:

1493469696.jpg



And now to make it even worse - pretty much ALL CGA games work on these 640x200 monochrome devices. And monochrome screens were not really popular back in the days. So is it possible that CGA when you run a different screen mode like 320x200 that the graphics card would force it out on a 640x200 screen just converting it to greyscale and that weird aspect ratio? Is that a standard CGA feature? I am just puzzled how they do this.
 
But let's take Prince of Persia for example... There is clearly some greyscale and I'm pretty sure this is not text mode...

This means nothing to me, as I have no idea how this screenshot was taken (although it seems to be taken with an emulator, not real hardware, given that it's a pixel-perfect 640x200 image), and what kind of processing was applied where to get to this particular image.
Note however that it is actually a 320x200 grayscale image. On a grid of 640x200, you'll see that every 'pixel' on screen is actually two vertical pixels at 640x200 resolution.
So it looks like just a grayscale mapping of a 320x200 'colour' game.

I think you may be confusing CGA resolution with display resolution.
I mean, any CGA monitor will always be capable of 640x200 resolution. It can also do this in colour, it's just that the CGA card can't drive it. An EGA card can. It gives you 320x200 and 640x200 in 16 colours on your standard IBM 5153 CGA monitor.
Likewise, if you have some kind of LCD screen or whatnot, the pixels are 'fixed'. There's always going to be 640 pixels vertically. In 320x200 mode, it just uses two pixels at a time. So in theory you could have 16 grayscale values in 640x200 mode on that screen, but CGA simply can't drive it in graphics mode, only in text mode.
 
Last edited:
It's not text mode, no. But it's not 640x200 either - notice how those pixels are actually two pixels wide? That's a 320x200 screen enlarged horizontally.
 
Well actually pretty much all DOS-based palmtops use a 640x200 CGA monochrome screen. Most prominent example would be the famous HP 200LX. Theres a few dozen other ones that use pretty much the same screen, just in a bigger dimension ("Zeos pocket"). The cool thing is that the screens of these keep the aspect ratio so by todays standards you would call them an "Ultra wide screen" i guess...

Some early "laptops" like the "IBM PC convertible" also had the same aspect ratio 640x200 CGA monochrome screen - the IBM was even backlit.

Well when i run Visual Basic for DOS on my HP 100LX it looks like this:

1493473321.jpg



So i was just curious how they do the greyscale trick... Is that really just some text mode or so?





This Help text makes me crazy - reading that it only supports Black&White, reading it in 640x200 monochrome greyscale... XD

1493430410.jpg

This is definitely text mode here. NOT 640x200 graphics mode. CGA only had 200 lines of resolution because it was 15KHz scan.. Text mode had 640 dots horizontally so this makes sense.

Nothing magical here.
 
The only 'monochrome' option I know for CGA is the built-in screen for the IBM 5155.
There was more, and not just for portables, but for desktops as well.
Eg. Amstrad PC-MM, commonly used with the PC1512 series.
And there was plenty of noname "dual" monochrome monitors, which could sync to both 18 and 15 kHz.
 
There was more, and not just for portables, but for desktops as well.
Eg. Amstrad PC-MM, commonly used with the PC1512 series.
And there was plenty of noname "dual" monochrome monitors, which could sync to both 18 and 15 kHz.

Yea, but clones can do whatever they want. Eg, my Philips P3105 came with an ATi Small Wonder and an MDA/Hercules-compatible 12" amber screen. The Small Wonder can output CGA on that with 16 shades of amber (using some clever PWM trickery to make the monitor display these shades).
None of this makes it a new/special CGA mode though. The software doesn't know anything about it. Which is probably exactly what is happening with the other examples in this thread.
 
Yea, no matter what I try, I can't get Prince of Persia to start in 640x200, it's always 320x200 in 4 colors mode.

So effectively that means that when the computer has a 640x200 resolution screen the horizontal pixels just get doubled and colours converted to Greyscale? I just wonder if it is a special feature of these chipsets for palmtops or something "any" CGA board would do by default.

Interestingly there is a tool called "LXPIC" which can display pictures (like jpeg and stuff) on the 200LX and amazingly in 640x200 in 4 grey shades.

http://hplx.pgdn.de/

But personally i think that is kinda "hack" referencing to the specific hardware, i don't think it will work on other machines like the IBM convertible...
 
So effectively that means that when the computer has a 640x200 resolution screen the horizontal pixels just get doubled and colours converted to Greyscale? I just wonder if it is a special feature of these chipsets for palmtops or something "any" CGA board would do by default.

Depends on how you look at it. Technically, it's a continuous analog signal, and there isn't really a concept of horizontal 'resolution'. A CGA monitor doesn't 'know' whether it's running in 320x200 or 640x200 mode. The signaling is the same. It's just that in 320x200 mode, the CGA can only change the colour signal 320 times per scanline, where it can change the signal 640 times in 640x200 mode.
So there aren't really any 'pixels', and they don't really get 'doubled'.
There are only sync pulses vertically, and only there would you need a different signal to double scanlines vertically (as VGA does, for example. Any '200' line mode is actually 400 lines, where it sends every scanline in memory twice).

With any kind of LCD/plasma screen, you have a fixed grid of pixels, so you actually have 640 pixels per scanline, and the analog signal needs to be digitized to match the 640 pixels. So it's this digitizing circuit that does the 'magic'.
Back when LCDs became commonplace as regular monitors, they all worked like that initially: VGA is an analog signal, much like the RGBI signal of CGA. So the LCD screens would sync to the signal and digitize it internally (and when the signal didn't map 1:1, they'd also stretch it. They have an internal framebuffer for this, so technically they could also do things like vertical scandoubling for you), then display it on the discrete grid of pixels.
Later we got pure digital signals, like HDMI, DVI and DisplayPort, where the connection is more like a network connection, and you send packets of discrete pixels to the monitor, so you can skip the analog-to-digital conversion. So now you finally have an actual horizontal resolution in your signal, and you are sending actual pixels to the screen.
 
Scali, RGBI is actually pretty digital. 4-bit TTL. But yes, you can fit as much horizontal resolution as you want, if you can turn the beam on and off fast enough in each scan.

It's like how 640x480p 60Hz 31.5KHz, and 1280x960i 60Hz 31.5KHz are electrically the same, (and yes I have long proven I can interlace ALL old VGA monitors to 960i), and works just fine, as long as you can actually see the 1280 pixels wide. On color CRT's it's a bit of a challenge with the shadow mask being in the way if it's not fine pitch, but it is there and on monochrome CRT's it's far more readable, if it doesn't smear from unshielded cables, etc.
 
Scali, RGBI is actually pretty digital. 4-bit TTL.

You don't have to explain to me how it works :)

But yes, you can fit as much horizontal resolution as you want, if you can turn the beam on and off fast enough in each scan.

That's the 'analog' part of it.
Your signals are driving sync and colour circuits directly. Yes, the signals are 'digital' in the sense that they only have two values, usually 0 and +5v, hence TTL.
But they are used as a continuous, 'analog' input signal raster-wise, rather than something that is actually 'digital' in the sense that you have discrete values describing discrete elements (in this case pixels).
VGA is technically the same as CGA this way, except instead of just TTL values for RGBI, they have analog values for RGB (generated by a DAC on the video card), and dropped the separate intensity.
What we consider 'digital' these days is way different from what a CGA RGBI interface is.

The later Commodore Amiga models actually supported super-highres on standard PAL screens, such as 1280x512.
 
Back
Top