VOGONS


CGA 4 color mode - why CMYK?

Topic actions

First post, by snorg

User metadata
Rank Oldbie
Rank
Oldbie

I've always been curious...if you only have 4 colors for 640x400 mode, why make them CMYK? Why not Red, Blue, Green and Black or RBG and Yellow?

I'm going to assume it has something to do with the print industry. Correct or no? Really made for butt-ugly ass games if all you could afford was CGA, though.

Last edited by snorg on 2012-12-01, 01:50. Edited 1 time in total.

Reply 1 of 23, by VileR

User metadata
Rank l33t
Rank
l33t

Don't you mean 320x200? anyway, CGA is based on the RGB color model, and I doubt that CMYK or the print industry had anything to do with the choice of palettes, as desktop publishing was a good few years in the future when the CGA was designed.

The two "official" CGA palettes are cyan/magenta/white and green/red/yellow, plus a background color. See here for the logic behind these palettes - mostl likely, it was just an easy-to-implement binary relationship, rather than a deliberate design choice.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 2 of 23, by snorg

User metadata
Rank Oldbie
Rank
Oldbie

You're right, my bad. Must have gotten it confused with the EGA spec. 16 color was only available in 160x100, 320x200 was 4 color and 640x400 was 2 color. Should have double-checked.

Still, pretty crummy colors, if you can only have 4.

Reply 3 of 23, by VileR

User metadata
Rank l33t
Rank
l33t

2-color CGA was 640x200. 😉 Anything x400 was VGA domain, as far as I know.

Crummy colors, yes, though IMHO the low-intensity variant of green/red/brown had a certain charm of its own. IBM fixed this issue with the PCjr (which had a full palette register, making those 4 colors freely selectable out of 16).

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 6 of 23, by VileR

User metadata
Rank l33t
Rank
l33t
Jorpho wrote:

Cyan and magenta were particularly suitable for monochrome displays, weren't they?

With the original CGA, the only kind of mono display you could hook up was mono composite, where any color shows up as a nasty vertical line pattern.

Maybe you're thinking of mode 5 (the "third palette", cyan/red/white) - it turns off the color burst signal on the composite output, and that fixes the above problem on mono displays.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 7 of 23, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
VileRancour wrote:

... IBM fixed this issue with the PCjr (which had a full palette register, making those 4 colors freely selectable out of 16).

Speaking of which... Micro Forté's "Demon Stalkers" uses some 16 different 4-color CGA palette combinations that display properly on TGA-based Tandy systems, and even on some VGA chipsets that I've tried, but not through any of DOSBox' emulated video modes. Is this a known issue?

Reply 8 of 23, by VileR

User metadata
Rank l33t
Rank
l33t
Cloudschatze wrote:

Speaking of which... Micro Forté's "Demon Stalkers" uses some 16 different 4-color CGA palette combinations that display properly on TGA-based Tandy systems, and even on some VGA chipsets that I've tried, but not through any of DOSBox' emulated video modes. Is this a known issue?

With DOSBox set to machine=tandy, the game seems to use the usual 16-color Tandy mode (visually equivalent to EGA). So that's not how it works on an actual Tandy1k?
I tried machine=pcjr as well, but this just promptly crashes the game (to be fair, I don't see any indication that the game supports PCjr at all).

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 9 of 23, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
VileRancour wrote:

With DOSBox set to machine=tandy, the game seems to use the usual 16-color Tandy mode (visually equivalent to EGA). So that's not how it works on an actual Tandy1k?

It works fine in 16-color mode. I'm referring to the 4-color CGA mode, however (set with the "c" command-line switch).

Reply 10 of 23, by VileR

User metadata
Rank l33t
Rank
l33t

Oh. That doesn't work in DOSBox 0.74, but it's been fixed since then (see attached screenshots from newer SVN builds).

Not sure why they'd do that when the Tandy already supported 16 colors... maybe some really low-RAM models couldn't handle the extra video memory overhead?

Attachments

  • game_002.png
    Filename
    game_002.png
    File size
    4 KiB
    Views
    4785 views
    File license
    Fair use/fair dealing exception
  • game_001.png
    Filename
    game_001.png
    File size
    4.16 KiB
    Views
    4785 views
    File license
    Fair use/fair dealing exception
  • game_000.png
    Filename
    game_000.png
    File size
    3.53 KiB
    Views
    4785 views
    File license
    Fair use/fair dealing exception

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 11 of 23, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
VileRancour wrote:

Oh. That doesn't work in DOSBox 0.74, but it's been fixed since then (see attached screenshots from newer SVN builds).

Ah, excellent... 😀

Not sure why they'd do that when the Tandy already supported 16 colors... maybe some really low-RAM models couldn't handle the extra video memory overhead?

It's not Tandy-specific, mind you. While the game isn't playable, I get those same colors in a system with an Accumos, AVGA1-based chipset. I'd be curious to know if it's more of a non-IBM CGA feature, or if the full palette register might have been implemented in later IBM cards?

Reply 12 of 23, by VileR

User metadata
Rank l33t
Rank
l33t

You could do the same thing with EGA and up - see John Romero's Pyramids of Egypt (or this TSR, which I found a while back and somehow thought it entertaining enough to merit its own thread). Basically, later IBM hardware let you mess with the 4-color palette to your heart's content, though this kind of tweaking was rarely used.

Then again, the actual method of doing that on EGA/VGA seems to be distinct from (and mutually incompatible with) the PCjr/Tandy way... which leads me to suspect that your VGA chipset was specifically designed with some degree of Tandy compatibility in mind. Hey, stranger things have happened. :)

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 13 of 23, by Sadist boar

User metadata
Rank Newbie
Rank
Newbie

The big idea is - using blue as an intensity bit for monochrome monitors.

Sad fat people are never good at using complex programs.

Reply 14 of 23, by sliderider

User metadata
Rank l33t++
Rank
l33t++
VileRancour wrote:

Oh. That doesn't work in DOSBox 0.74, but it's been fixed since then (see attached screenshots from newer SVN builds).

Not sure why they'd do that when the Tandy already supported 16 colors... maybe some really low-RAM models couldn't handle the extra video memory overhead?

Looking at those pics hurts my eyes. How the hell did we ever sit in front of CRT monitors with crappy refresh rates for hours at a time back in CGA days without going blind?

Reply 15 of 23, by kao

User metadata
Rank Member
Rank
Member

You could do the same thing with EGA and up - see John Romero's Pyramids of Egypt (or this TSR, which I found a while back and somehow thought it entertaining enough to merit its own thread). Basically, later IBM hardware let you mess with the 4-color palette to your heart's content, though this kind of tweaking was rarely used.

Then again, the actual method of doing that on EGA/VGA seems to be distinct from (and mutually incompatible with) the PCjr/Tandy way... which leads me to suspect that your VGA chipset was specifically designed with some degree of Tandy compatibility in mind. Hey, stranger things have happened.

Interestingly, I found this with Mineshaft. This is a CGA-only game, however if run on the PCjr, it changes around the colors. Mineshaft uses INT 10h Function 1000h (first introduced on the PCjr and then a standard part of all later video cards) and thus will display the tweaked palette on everything except CGA (where you'll get the default CMW colors). I had thought Crossfire does this as well, but it appears to set Mode Bh on the PCjr (though still only displaying four colors at once).

I'm not sure exactly what's with the tweaked colors on Demon Stalker. It seems to be intended as Tandy support, yet the game already runs in Mode Bh. May have been for some oddball CGA clone card or perhaps for users of older Tandys that didn't have have the 384k required to run it in 16 colors.

Also I might mention Earl Weaver Baseball as another game that supports tweaked CGA colors. This seems to have been for good reason though because I found various references on old Usenet posts about how the game needs 12Mhz or better to run acceptably in EGA, so they made have put this in so you could run it on slower machines without the miserable default CGA palette.

Looking at those pics hurts my eyes. How the hell did we ever sit in front of CRT monitors with crappy refresh rates for hours at a time back in CGA days without going blind?

I use a Tandy CM-11 monitor on my XT. It's fuzzy stuff, and 80-column text is especially bad to look at.

Reply 16 of 23, by VileR

User metadata
Rank l33t
Rank
l33t
kao wrote:

Mineshaft uses INT 10h Function 1000h (first introduced on the PCjr and then a standard part of all later video cards)

Thanks for clearing that up... for some reason, IBM's later video standards didn't support any of the PCjr's other innovations, so this seems to be an exception. Pyramids of Egypt shows the same palette tweaking whether machine=pcjr or EGA/VGA, and while I'm too lazy to verify with the dosbox debugger right now, I'll just assume that it uses the same method.

Looking at those pics hurts my eyes. How the hell did we ever sit in front of CRT monitors with crappy refresh rates for hours at a time back in CGA days without going blind?

I use a Tandy CM-11 monitor on my XT. It's fuzzy stuff, and 80-column text is especially bad to look at.

Some CRT tubes lose beam focus as they age. The CM-11 is supposed to be quite good as far as CGA monitors go (unlike, say, the CM-5 with its monster dot pitch from hell).
'80 video standards sure offered plenty of exciting ways to get an ocular migraine, but CGA could've been worse... at least it wasn't interlaced.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 17 of 23, by Joey_sw

User metadata
Rank Oldbie
Rank
Oldbie

but CGA could've been worse... at least it wasn't interlaced.

but,
I thought weird even/odd horisontal line from mode4/5/6's B800:0000 memory block
was to accomodate the interlace stuff,
while scanning said memory area sequentially ?

-fffuuu

Reply 18 of 23, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The even/odd thing is because the MC6845 CRTC controller was not developed with graphics mode in mind. It can only do 127 or 128 text rows, where a row has as many scanlines as the character is tall.

In graphics mode i.e. 320x200, 200 rows are required. Too much. IBM's workaround was to program the controller for characters with height 2, so they need only 100 rows.

The 6845 has extra signals to indicate the current row in a character, this is used to direct the memory accesses to either the even or odd bank.

1+1=10

Reply 19 of 23, by VileR

User metadata
Rank l33t
Rank
l33t

Yes, the memory layout is interleaved, but the display is still progressive scan.
The CRTC itself can be reprogrammed for interlaced output (see that CGA compatibility tester from Trixter), but IBM's CGA design doesn't allow for "halfway" scanline positioning, so the result is kind of broken.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]