• Please review our updated Terms and Rules here

True CGA vs VGA card in CGA mode

I would love to see this wonder book of yours -- what is the title?

"Graphics Primer for the IBM PC".

I also would definitely like to see the interlaced listing, because that's the only thing I have not been able to see any use for. You would think that you can use interlaced mode to get 400 interlaced lines, but when I do it, I just get alternating pages on the same 200 lines (which makes interlaced mode worthless). Working with Andrew Jenner, we determined that IBM did not implement the interlaced functionality properly.

It's just a short program that turns the interlace mode on and fills the screen with As. You will also get some snow since it's writing directly to the video memory in 80-column text mode. There's four different settings for the interlace register. A value of 0 or 2 just produces a noninterlaced picture. 1 (probably what you tried) causes both pages to repeat the same information, and 3 produces a proper 400-line display.

5 'interlaced text
10 screen 0,0
20 width 80
30 cls
40 out &h3d0,8: out &h3d1,3
50 def seg=&hb800
60 for i=3 to 49
70 for j=0 to 79
80 poke 160*i+2*j,65
90 next j
100 next i
 
Last edited:
Thanks for the listing. This confirms what I saw in my own tests -- the card is interlacing memory/output, but the 5153 monitor displays the even and odd scanlines in the same 200 lines. A traditional interlaced mode would display the odd scanlines offset by half a scanline, but the way IBM CGA/5153 implements it, both 200 lines of information display in the same place.

To me, that says "broken implementation". The 30Hz flicker is tolerable, but mashing the visual information into the same space is not.

Still, I guess I can't completely call it "complete" until I support it, so I'll add something in there for interlaced testing, even if it is useless.

Speaking of which, I've completed the memory benchmarks, color select register tests, textmode manipulation tests, and am halfway through the monitor calibration tests. I think I'm ready for people to start testing it; please grab it at http://www.oldskool.org/pc/cgacomp and let me know any feedback, if any.
 
Thanks for the listing. This confirms what I saw in my own tests -- the card is interlacing memory/output, but the 5153 monitor displays the even and odd scanlines in the same 200 lines. A traditional interlaced mode would display the odd scanlines offset by half a scanline, but the way IBM CGA/5153 implements it, both 200 lines of information display in the same place.

The book has a screenshot of the program running, but it looks like they were using a green-screen composite monitor. Probably the 5153's fixed frequency is the reason it doesn't work.
 
Thanks for the listing. This confirms what I saw in my own tests -- the card is interlacing memory/output, but the 5153 monitor displays the even and odd scanlines in the same 200 lines. A traditional interlaced mode would display the odd scanlines offset by half a scanline, but the way IBM CGA/5153 implements it, both 200 lines of information display in the same place.

To me, that says "broken implementation". The 30Hz flicker is tolerable, but mashing the visual information into the same space is not.

Still, I guess I can't completely call it "complete" until I support it, so I'll add something in there for interlaced testing, even if it is useless.

Speaking of which, I've completed the memory benchmarks, color select register tests, textmode manipulation tests, and am halfway through the monitor calibration tests. I think I'm ready for people to start testing it; please grab it at http://www.oldskool.org/pc/cgacomp and let me know any feedback, if any.


I've downloaded it now and started it in Dosbox at work just to look at the UI etc etc. It looks very nice, and when I get home today I'll try it on the XT with the VGA card and post the results
 
Here's my results from the XT with the VGA adapter (Sorry for the mess, I made it on the 200LX when running the tests on the XT)

Block memory read speed:
378kb/s

Write:
457kb/s

Interleaved Opcode/Memory read:
214 kb/s
Write:
234 kb/s

Color select register:
Medium-res: cyan, Does not cycle

High-res: white, Does not cycle

Medium-res palettes:
cyan,magenta,white , Does not cycle


Textmode manipulation:
40-column: OK
Textmode highcolor backgrounds: OK
Cursor: Regular OK, Upside-down OK, Full block OK, Top and bottom dual: NO
Striketrough: NO, Back to regular, OK
 
So your VGA has faster memory speeds than CGA. This means that any programs that run slower are doing so for a different reason. VGA has a vertical refresh rate of 70Hz for 200-line modes; real CGA is 60. That might be one cause. I didn't have a chance to add that test yet.

Many early VGA adapters have programs you can run to "force" the card into behaving like CGA. I remember having one of those for an early ATI card that came with it in the package. It switched into the 8x8 font and all the CGA tricks (third palette, 160x100, etc.) worked. You had to run the utility again to get full VGA functionality back. Do you have a similar utility for your card?

I will try to add the rest of the tests tonight and do another release. I will also add a check to see if you are deliberately running the program on a non-CGA card :)

It's interesting to note that your VGA card RAM is faster than CGA, but it is not 4x as fast -- that means running MCGA/VGA 320x200@256 games will be significantly slower than CGA, despite the RAM speed difference (because 256-color mode is 4x the memory to sling around). Your "sweet spot" for running games on that system is probably EGA 320x200@16 mode.
 
So your VGA has faster memory speeds than CGA. This means that any programs that run slower are doing so for a different reason. VGA has a vertical refresh rate of 70Hz for 200-line modes; real CGA is 60. That might be one cause. I didn't have a chance to add that test yet.

Many early VGA adapters have programs you can run to "force" the card into behaving like CGA. I remember having one of those for an early ATI card that came with it in the package. It switched into the 8x8 font and all the CGA tricks (third palette, 160x100, etc.) worked. You had to run the utility again to get full VGA functionality back. Do you have a similar utility for your card?

I will try to add the rest of the tests tonight and do another release. I will also add a check to see if you are deliberately running the program on a non-CGA card :)

No, I have no utils for the card. I have an original IBM CGA adapter as well (Just got it) and I'll try your program again when I have a monitor to hook it up to.

How come the colors didn't cycle in the different tests ?
 
How come the colors didn't cycle in the different tests ?

Because the port used to do that on CGA does something different on VGA. And VGA handles border color with a different port, and both border color and background color are handled with palette entries instead of RGBI combinations.

Try to identify your card and find that utility! :)
 
I've ordered a copy of this, thanks :)

Have fun with that. Since it's from 1983, only CGA and monochrome are covered. The program listings are all BASIC, no assembly language. It's notable that they make absolutely no mention of the 5153. Judging from the screenshots in the book, they were using entirely composite monitors.

This was actually part of a series of "Primer" books (though all by different authors), covering BASIC, Pascal, and assembly language. My local library used to have the assembly one, which had this nifty little utility that would dump the entire first megabyte of memory and show you what locations had stuff in them and what was empty.
 
Try to identify your card and find that utility! :)

It might be a neat addition to your program to paw through the option rom @ c000 and see if there are any ASCII strings in there you could dump out to help with identification and BIOS revisions.

Disclaimer: I haven't tried it yet, you might already be doing that.
 
Because the port used to do that on CGA does something different on VGA. And VGA handles border color with a different port, and both border color and background color are handled with palette entries instead of RGBI combinations.

Try to identify your card and find that utility! :)

Yes,I will try that. I think it's this card
 
It might be a neat addition to your program to paw through the option rom @ c000 and see if there are any ASCII strings in there you could dump out to help with identification and BIOS revisions.

I have a detection library I can employ to do this. This will increase the .exe to a whopping 140K though (I'm ashamed it's as big as it is, I'm using the Turbo Object Toolkit because I didn't want to spend weeks writing user interface code).

Oh well, might as well go for broke. I'll try to make sure it runs in 192KB so that it can run on 256KB machines and higher.

I'm very tired but I will try to work on it tonight. Because it's fun.
 
Yes,I will try that. I think it's this card

Last night I added my detection libraries to the cga compatibility tester, and part of them is VGA card detection. Maybe that can help you determine the chipset used and might be able to find the "force cga" utility if it exists.

(Unfortunately, adding them added another 70K to the .exe -- the program is in danger of not running on a 256KB machine; if it bugs me, I'll try to alter the program to use an overlay system)
 
As of drivers, I could only find drivers for Windows 3.1x. I don't know if they'll work, but if you plan to use the card in a computer running Windows 3.1, those drivers might come in handy. There is some new drivers and some older. The older ones requires manual windows installation, and the new ones comes with it's own installer.

However, I do only have the ability to upload the old one.
 
Last edited:
Last night I added my detection libraries to the cga compatibility tester, and part of them is VGA card detection. Maybe that can help you determine the chipset used and might be able to find the "force cga" utility if it exists.

(Unfortunately, adding them added another 70K to the .exe -- the program is in danger of not running on a 256KB machine; if it bugs me, I'll try to alter the program to use an overlay system)

Nice! I'll try it tomorrow on my XT and see what it reports.

Per: Thanks for the drivers. I'll look at them tomorrow as well.
 
Alley Cat on true CGA: Everything works fine, no slow-downs.


The graphics look just fine, they are just choppy and slow.

One other thing I might add. When I run VGA games, the animation is perfectly smooth and glassy. You're saying that CGA games are supposed to be like that on the real thing, correct?
 
Last edited:
One other thing I might add. When I run VGA games, the animation is perfectly smooth and glassy. You're saying that CGA games are supposed to be like that on the real thing, correct?

"Glassy"?

When I make a video of what the compatibility tester is supposed to look like, I'll make a video of Alley Cat as well for comparison.
 
Back
Top