40 Column Text Mode Issues

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Re: 40 Column Text Mode Issues

Postby NewRisingSun » 2006-1-18 @ 20:02

CGA monitors include my PCjrs and Tandys and evan an AT&T D25 double-scanrate CGA monitor and they *all* show brown for #6. And that's the way I've always remembered it for two decades.


You're missing the point. I'm not doubting that your current 5153 are all brown. I am doubting that *all* 5153s in existence are brown. You can show me a hundred 5153s that are all brown; it still does not address the point whether there are some (early) 5153s that are yellow.

We are seeing a picture in this very thread that shows a monitor that is not brown, and I am rejecting the cheap explanation that the photo is rigged/badly done or that the monitor is so misadjusted that red and green would display correctly, but brown wouldn't. I also am doubtful of the explanation that it's the intense color's we're seeing, because I have never seen the game displaying the high score screen in intense colors. Also, when compared with the room lightning, the colors look too dark to be the intense ones.

So, the facts are: we are seeing a picture of a 5153 that is yellow. Most 5153 are brown. How can this be explained?
If you have followed the discussion so far, the hypothesis has been thus: the original 5153 was yellow, but when the EGA was introduced, it was modified to display brown instead. You mentioned that you got into PCs in 1985, which is well after the introduction of the EGA, so any 5153 you might have bought would have been the "revised" model, if there was one. Do you understand what I'm saying? You don't have to agree with it, just tell me if you get my point.

Why would the introduction of EGA be of such importance? Because the CGA's RGBI color model does not allow for brown. Bit 0 sets B to AA, bit 1 sets G to AA, bit 2 sets R to AA, bit 3 adds 55 to R,G,B. Color "6" has bits 1 and 2 set, therefore, R and G have a value of AA, therefore, the color is #AAAA00. Brown would be #AA5500, which is not possible in the RGBI color model. Any RGBI monitor displaying brown MUST have some kind of "hack" to detect color 6 and artifically lower the green component.

The EGA on the other hand uses the 6-bit ECD color model. Bit 0 sets B to AA, bit 1 sets G to AA, bit 2 sets R to AA. Bit 3 sets B to 55, bit 4 sets G to 55, bit 5 sets R to 55. Brown, being #AA5500, therefore needs to have bits 2 and 4 set, which results in the value 0x14, which is indeed the palette entry for attribute 6.

In other words, while the RGBI color model does not allow for brown, the EGA color model does. My hypothesis is that when the EGA came about and people used it with the 5153 instead of the more-expensive 5154, IBM added a "hack" to the 5153 so that there would be no color difference between the two monitors.

Of course, it could also be that the "hack" was there from the start, and the EGA finally had the color model to properly reflect that RGBI-violating "hack". I reject this variant because:
- we are seeing a picture of a display that does not have this hack (see above on why I think the picture displays what is claimed);
- the CGA's composite output undoubtedly displays color 6 as yellow, NOT brown. Why would the composite output follow the RGB output in all colors but one?
NewRisingSun
Member
 
Posts: 408
Joined: 2005-9-02 @ 02:26

Re: 40 Column Text Mode Issues

Postby Great Hierophant » 2006-1-18 @ 20:08

Here's something to chew on: If it wasn't supposed to be brown, then why did IBM make it brown in the text color section of the default VGA palette?


The answer is it was brown for the EGA, so it would be brown for the VGA. That way they would not have to set different palettes between text and graphics modes and applications would look consistent regardless of display adapter. IBM probably did that so games for the PCjr. would look the same on the EGA. This is before IBM realized how poorly the PCjr. fared in the marketplace (1984).

Actually, to view/calibrate the dark 8 colors, you could use Microsoft Adventure, which allows you in text mode to set the letter colors to one color and the background/border color to another color with function keys. You could set a solid color by designating the same color for the foreground and background. I remember that when I set it to color 6 when playing the game on some modern PC, the background was brown but the border was yellow! I believe that was due to the VGA emulation designating brown in the text mode but whomever implemented it forgot to designate the same color for the border.

The in-game photos I posted could not give you the intense palette because it is impossible to have eaten the cherry as shown. (Cherry adds 1000 points and the score shows 0 points.)

Why would the introduction of EGA be of such importance? Because the CGA's RGBI color model does not allow for brown. Bit 0 sets B to AA, bit 1 sets G to AA, bit 2 sets R to AA, bit 3 adds 55 to R,G,B. Color "6" has bits 1 and 2 set, therefore, R and G have a value of AA, therefore, the color is #AAAA00. Brown would be #AA5500, which is not possible in the RGBI color model. Any RGBI monitor displaying brown MUST have some kind of "hack" to detect color 6 and artifically lower the green component.


If you are using these values, then the 24-bit RGB values would be 0, 85, 170, 255 for each color element. These are attractive because they evenly divide 256 by 4. I believe DOSBox uses values 0, 84, 168, 252 for its palette. Which is correct?
User avatar
Great Hierophant
Oldbie
 
Posts: 1660
Joined: 2003-4-27 @ 08:20

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-18 @ 21:17

So, the facts are: we are seeing a picture of a 5153 that is yellow. Most 5153 are brown. How can this be explained?


How about a camera's white balance being off? Diffuse ambient light? Or, most likely, a miscalibrated monitor?

If you have followed the discussion so far, the hypothesis has been thus: the original 5153 was yellow, but when the EGA was introduced, it was modified to display brown instead.


Original 1981 documentation (I will try to provide a scan) calls it brown; software catalogs from IBM show it as being brown. The PC and PCjr tech reference (I can provide another scan) also mention it as brown. The IBM PCjr was introduced in 1983, a full year before EGA, and #6 is brown on PCjr monitors as well (which are just TTL CGA monitors but with a goofy pinout).

I really don't understand where you're getting this. Printed documentation, as well as most working units, contradict your theory.

You mentioned that you got into PCs in 1985


No, I owned them beginning in 1985. I've used them since 1983.

Do you understand what I'm saying? You don't have to agree with it, just tell me if you get my point.


I understand what you're saying but don't understand where you're getting it. Yes, if you go by pure digital RGB numbers and a linear colorspace, you would calculate it to look dark/dim yellow instead of brown. Analog monitors don't have linear colorspaces. You can't assume an analog CRT behaves like an RGB bitmap. It's not an LCD monitor with a DVI connection...

In other words, while the RGBI color model does not allow for brown, the EGA color model does. My hypothesis is that when the EGA came about and people used it with the 5153 instead of the more-expensive 5154, IBM added a "hack" to the 5153 so that there would be no color difference between the two monitors.


Whoa, hold on -- people didn't do that because EGA pinout isn't compatible with a CGA monitor. High-res sync aside, EGA doesn't implement "I" but rather secondary r, g, and b -- if you were to hook it up, the EGA secondary green pin would be inline with the CGA "I" pin, making all bright colors look green. So that's further proof against your hypothesis.

I get the feeling that this whole thing is brought on by your unwillingness to accept that the monitor doesn't display the linear RGB colorspace defined by the standard -- but that kind of thing happened (and still happens) all the time.
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-18 @ 21:29

Just caught this:

the CGA's composite output undoubtedly displays color 6 as yellow, NOT brown. Why would the composite output follow the RGB output in all colors but one?


The composite output colors are almost nothing like the RGB output! Have you seen one? A few of the colors are the same, but the others are way off, they're much more similar to double-high-res on the Apple IIe (which shouldn't be a surprise given that the techniques are identical, colorburst artifacting). The only composite colors that are dead-on identical are the CGA palette 1 colors (cyan, magenta, white) and those colors should be used when calibrating the monitor's hue control.

I wrote a CGA library that supports composite CGA as well as regular modes and also a few tweakmodes, and one of the test programs is a program that displays all the colors of the mode. I wasn't quite ready to distribute the library yet, but it looks like I'm going to have to display all these modes, with source code, with digital photos of what the machine is displaying on both the RGB and composite monitors simultaneously in order to put these issues to rest.
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 05:00

Update: I was able to obtain proof, which I am working on adding to my website as the explanation is probably too long for a post. More later.
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 05:45

Okay, I've added the answer with technical information to prove it to the link I posted earlier, which is:

http://www.oldskool.org/pc/cgacal/

What is the answer? The answer is that the pinout from the CGA card definitely suggests dark yellow, but there is special circuitry in the 5153 that is activated when pins 0 1 1 0 (color #6) go high, which decreases the amount of green in the output color. So it is the monitor that makes it brown.

While I haven't yet found information as to why IBM specifically did that (I haven't gotten all the answers back to my emails), it is obvious that it was quite intentional. Even clone monitors did it to maintain compatibility.

May I have your permission to revert your wikipedia CGA changes? I worked really hard on the CGA article there (see history/diffs for proof); that is why I went through all this effort to prove this...
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby augnober » 2006-1-19 @ 08:49

It seems to me that the brown hack is still in line with NewRisingSun's theory. Finding that there's a brown hack inside a monitor actually validates a part of his theory (that someone put a brown hack inside monitors.. :)). The question remains: Did anyone ever manufacture monitors which did not contain the hack? If someone did, it just requires an example. The theory that all monitors contained a brown hack which behaves in a particular standard manner is possibly true, yet it's extremely difficult to gather enough evidence to be convincing. We've got photos of a monitor which appears yellow and we don't have any proof that the photos are bad.. so it's practical to sit on the fence for a while and allow the possibility of either case. Anyway.. we're now certain that some (and likely a whole lot) produce brown. That's good to know.

Edit: I suppose I'll add a question.. Was the brown hack present in the first CGA monitors produced? I guess the answer to this may be found at the same time as finding out why the hack was introduced in the first place.
Last edited by augnober on 2006-1-19 @ 09:24, edited 1 time in total.
augnober
Member
 
Posts: 115
Joined: 2004-10-03 @ 02:23

Re: 40 Column Text Mode Issues

Postby jal » 2006-1-19 @ 09:20

Hey Trixter, glad you finally found this forum. I sent you an e-mail a while ago to invite you to the discussion, but I'm not sure it went to the right address (your internet presence this decade seems almost non-existent).

MobyGamer wrote:Whoa, hold on -- people didn't do that because EGA pinout isn't compatible with a CGA monitor. High-res sync aside, EGA doesn't implement "I" but rather secondary r, g, and b -- if you were to hook it up, the EGA secondary green pin would be inline with the CGA "I" pin, making all bright colors look green. So that's further proof against your hypothesis.


Well, this is what I thought, but I was more or less proven wrong. Somewhere on page 17 or so of this thread, I stated the same thing, but owners of original EGA cards remembered a DIP switch to set the type of monitor. Also, various EGA pin specifications, e.g. this one:

http://pinouts.ru/data/EGA_pinout.shtml

show secondary green as intensity as well. So very probably it was possible to attach a CGA monitor to an EGA card, when setting the right DIP switch.


JAL
User avatar
jal
Member
 
Posts: 488
Joined: 2004-1-02 @ 15:30
Location: Amersfoort, Netherlands

Re: 40 Column Text Mode Issues

Postby NewRisingSun » 2006-1-19 @ 10:03

How about a camera's white balance being off? Diffuse ambient light? Or, most likely, a miscalibrated monitor?
White balance and ambient light doesn't change brown into yellow while leaving everything else intact. And you can't "miscalibrate" a monitor to show red and green properly but show brown (being a combination of red and green) improperly. White balance/ambient light/miscalibration do not have a "chroma key", they would affect all colors.
Original 1981 documentation (I will try to provide a scan) calls it brown;
The CGA's composite color patent calls it brown as well, even though it doesn't look brown.
Analog monitors don't have linear colorspaces. You can't assume an analog CRT behaves like an RGB bitmap.
An analog CRT's nonlinear behavior is properly described by a power law. To turn yellow into brown, the non-linear characteristic would need to behave differently for the green gun than for the red gun. The non-linear characteristic however always affects all guns equally, otherwise you wouldn't get a gray color when sending equal R/G/B values.
Whoa, hold on -- people didn't do that because EGA pinout isn't compatible with a CGA monitor.
Yes, it is. You set a dipswitch on the EGA that you're using a CGA monitor, and the 350-line modes will no longer be used, only the 200-line modes, which ARE compatible with an RGBI monitor, which is why you can't select the extended palette colors in 200-line modes, because the pins will carry an RGBI signal in these modes.
I get the feeling that this whole thing is brought on by your unwillingness to accept that the monitor doesn't display the linear RGB colorspace defined by the standard -- but that kind of thing happened (and still happens) all the time.
No, you are just unwilling to accept the photographic evidence, giving non-plausible reasons (as explained above). And you also don't know about the non-linear characteristics of analog monitors either... :)
The composite output colors are almost nothing like the RGB output! Have you seen one? A few of the colors are the same, but the others are way off, they're much more similar to double-high-res on the Apple IIe (which shouldn't be a surprise given that the techniques are identical, colorburst artifacting).
Obviously, you don' t know enough about the CGA's composite output. Read US patent #4,442,428 thoroughly, THEN reply.
In regular modes, the CGA's composite output creates a normal quadrature-modulated non-interlaced NTSC signal. On sharp edges, you also get further cross-color artifacts, which you can use to get 16 colors in 4-color modes. This is what Ultima3 and Microsoft Decathlon do, they do NOT use the 640x200 mode with color burst.
The "640x200 mode with color burst", which is what you think is "THE" composite color mode (which it isn't exclusively), gets rid of the chip-generated modulation and uses solely cross-color artifacts, yielding different (more saturated) colors than the 320x200x4 method that Ultima3 and Decathlon use.
Don't lecture me on the composite output, I've emulated it completely in software, if you care to consider reading this thread completely, especially the last five pages or so.
And as far as the composite output in regular modes is concerned (not the artifact colors, but the normal modulated colors), the colors follow their RGB colors except for your color 6.
May I have your permission to revert your wikipedia CGA changes?
You may change it to reflect that most 5153s display color 6 as brown (see that schematic on your page), but there are *some* monitors which display it as dark yellow because they don't have that yellow-to-brown circuit, presumably early ones, such as the one in GH's picture.
Last edited by NewRisingSun on 2006-1-19 @ 17:03, edited 5 times in total.
NewRisingSun
Member
 
Posts: 408
Joined: 2005-9-02 @ 02:26

Re: 40 Column Text Mode Issues

Postby Great Hierophant » 2006-1-19 @ 14:16

I accept that IBM always called color 6 "brown", and the dark yellow color could pass for a brown, just not a very good one. Then someday, IBM's designers decided to add a simple circuit to get a better, true brown. "Someday" I would guess would be around the time of the PCjr. My contact has an early PC.
User avatar
Great Hierophant
Oldbie
 
Posts: 1660
Joined: 2003-4-27 @ 08:20

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 18:07

I suppose I'll add a question.. Was the brown hack present in the first CGA monitors produced?


Yes. The schematic I reproduce on my website was taken from the IBM Tech Ref in 1981.
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 18:10

Somewhere on page 17 or so of this thread, I stated the same thing, but owners of original EGA cards remembered a DIP switch to set the type of monitor.


After some research, I've comfirmed this. I stand corrected!
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 18:15

You may change it to reflect that most 5153s display color 6 as brown (see that schematic on your page), but there are *some* monitors which display it as dark yellow because they don't have that yellow-to-brown circuit, presumably early ones, such as the one in GH's picture.


I see you're conveniently ignoring the evidence I posted. Based on the 1981 IBM tech ref schematic, all 5153s had that circuit; it was a quite intentional hack. (As to *why* IBM chose to do that, I'm still researching.) The only CGA montiors that don't display #6 as brown are either 1. broken, or 2. aren't 100% IBM CGA compatible.

Based on that, I don't think it's appropriate to say that some 5153s displayed yellow for #6 because in order to do that, they would have to be broken :-)
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 18:22

Great Hierophant wrote:I accept that IBM always called color 6 "brown", and the dark yellow color could pass for a brown, just not a very good one. Then someday, IBM's designers decided to add a simple circuit to get a better, true brown. "Someday" I would guess would be around the time of the PCjr.


That's just conjecture, while the schematic I posted is fact. The 5153 has always had that circuit from the design stage. It has always been brown as displayed.

The web can be rewritten, but the printed word can't :-)

I know everyone sick of this topic by now, so I'll stop responding unless a direct question is asked.

What I'm going to work on now, since I didn't realize composite CGA info was somewhat nonexistant, is release my CGA library with source and examples on generating the composite colors, then include a digital photo of what they look like, and also a PNG of the raw data used to display it for those who don't want to run the source or have access to real CGA. Hopefully this will allow DOSBOX and others to support composite color properly.

It was previously mentioned that composite color could be affected by the color registers; this is true (I've done it myself) but I ran 12 games that supported composite color with both RGB and composite monitors attached, and every single one didn't mess with the color registers (if they had, I would have seen it on the RGB monitor). I think it's fairly safe to say that a single composite color palette could be used as a reference.
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby NewRisingSun » 2006-1-19 @ 18:35

What I'm going to work on now, since I didn't realize composite CGA info was somewhat nonexistant, is release my CGA library with source and examples on generating the composite colors, then include a digital photo of what they look like, and also a PNG of the raw data used to display it for those who don't want to run the source or have access to real CGA. Hopefully this will allow DOSBOX and others to support composite color properly.
That has already been done, if you care to read this thread (and my previous post, regarding your incorrect composite color statement) in its entirety.
NewRisingSun
Member
 
Posts: 408
Joined: 2005-9-02 @ 02:26

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 19:51

NewRisingSun wrote:That has already been done, if you care to read this thread (and my previous post, regarding your incorrect composite color statement) in its entirety.


I came into this thread at page 19 for the color issue; I will go to the start of the thread and comment where appropriate.
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby MobyGamer » 2006-1-19 @ 20:14

Great Hierophant wrote:Also, as far as color composite mode goes, take a look at the results of the algorithm mentioned on this page:

http://www.queststudios.com/forum/viewt ... 8&start=25

Comparison to MobyGames screenshots show something quite close to true the color composite mode.


This algorithm is missing from that forum (it is replaced by two broken image icons)... NewRisingSun, can you please repost it?
User avatar
MobyGamer
Newbie
 
Posts: 75
Joined: 2006-1-18 @ 04:30

Re: 40 Column Text Mode Issues

Postby Great Hierophant » 2006-1-19 @ 20:35

Ok, while I don't profess to totally understand the schematic or the explanation for it, I accept that the color should be brown for all 5153s. My contact's 5153 is clearly dark yellow, so why does it display dark yellow? Here are the possible explanations:

Bad picture - I doubt it because my contact described it as dark yellow and there is a significant difference between brown and dark yellow.
Miscalibration - Unlikely, unless the 5153 has user-adjustable settings that affect the color beyond brightness/contrast, and I don't believe it does. Even so, the miscalibration would have to saturate the green to the extent it would be overbalanced in comparison to the other colors, and the picutre doesn't show that.
Damaged Monitor - This is a possibility. If the circuitry that makes the change has been damaged, for example, the transistor that triggers the green reduction is bad, then you would see yellow even though the bits have been properly identified in the monitor. Also, I'm not sure if this is helpful, but my contact said he got his IBM equipment from a fellow who worked at IBM. Did IBM have a program whereby its employees could obtain "not the best" at a substantial discount. Or perhaps he got it after several years of use. The last possibility is that he obtained a pre-production model that did not yet have the circuit added.
User avatar
Great Hierophant
Oldbie
 
Posts: 1660
Joined: 2003-4-27 @ 08:20

Re: 40 Column Text Mode Issues

Postby NewRisingSun » 2006-1-19 @ 20:41

Another possibility is that the schematic presented is not really from 1981, as claimed, but from a later, revised edition (I'm sure I've seen "revised" versions of the IBM tech doc), that already features a revised monitor design. Or, IBM deviated from that monitor schematic. I find it hard to believe that a monitor would be broken in just the exact aspect we need but work perfectly otherwise.

I wonder if we should just email IBM and ask them whether they made changes to the 5153 design over the years. Big corporations are not known to be particularly responsive, but who knows?
NewRisingSun
Member
 
Posts: 408
Joined: 2005-9-02 @ 02:26

Re: 40 Column Text Mode Issues

Postby Qbix » 2006-1-19 @ 20:58

MobyGamer wrote:
Great Hierophant wrote:Also, as far as color composite mode goes, take a look at the results of the algorithm mentioned on this page:

http://www.queststudios.com/forum/viewt ... 8&start=25

Comparison to MobyGames screenshots show something quite close to true the color composite mode.


This algorithm is missing from that forum (it is replaced by two broken image icons)... NewRisingSun, can you please repost it?


The screenshots I posted in the first page look a lot like those two of NewRisingSun. (they are of the same games, although NewRisingSuns algorithm is has some more complex features)

You might want to download the cvs version of dosbox from:
http://cvscompile.aep-emu.de/dosbox.htm
open dosbox.conf and change machine to cga.
then start a game and you can see it yourself.

I'm not sure if NewRisingSun has posted screenshots of his final algorithm. (with the final hues and such)
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 9656
Joined: 2002-11-27 @ 14:50
Location: Fryslan

PreviousNext

Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest