Solved

Graphics Tutorial part 2

Posted on 2004-05-02
12
1,597 Views
Last Modified: 2009-12-16
I guess I closed that last question too fast.  [url]http://www.experts-exchange.com/Programming/Programming_Languages/Assembly/Q_20974198.html[/url]

What's the difference between CGA and VGA?  Is it just the amount of colors?  Could I use a VGA tutorial for CGA?  

If not, does anybody have a tutorial just on CGA?  For beginning assembly on the 8086.  Nothing to do with pascal.  I noticed a lot of those links involved pascal. That's way different than what we're doing I think.  We don't have for loops or if then statements.
0
Comment
Question by:chaosrage
  • 3
  • 3
  • 2
  • +1
12 Comments
 

Author Comment

by:chaosrage
ID: 10973407
0
 
LVL 2

Expert Comment

by:enkimute
ID: 10975172
are you using old hardware ? Because todays hardware has no support for CGA anymore .. And no, you can't use a VGA tutorial to
learn CGA programming. Anyway, programming the CGA is so akward and the technology and techniques behind it are outdated and
not used anymore. So unless you _need_ to make something work on CGA, I sugest learning something that can actually be of some
use to you in the future. VGA Mode $13 programming uses a linear memory setup and the techniques approach those still used for
todays graphics cards.

But if you insist ..

http://thorkildsen.no/faqsys/docs/cga.txt

0
 
LVL 14

Expert Comment

by:Hamidreza Vakilian
ID: 10977511
Hello!

Yse, As enkimute Mentioned CGA Is Very Old. I Recommend You To Use a Mode Of SuperVGA Modes (High Resolution/High Colors/Supported Under Real Mode)

Best Wishes...
Programmer-x
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 14

Expert Comment

by:Hamidreza Vakilian
ID: 11014884
Why Don't You Say Something !!?

I Recommended You To Use a Mode Of SuperVGA Modes (High Resolution/High Colors/Supported Under Real Mode).

So What Do You Think?

Best Regards...
Programmer-x
0
 

Author Comment

by:chaosrage
ID: 11077833
Won't work.  She says we have to use CGA.  Heh.
0
 
LVL 2

Expert Comment

by:enkimute
ID: 11078729
hehe bloody teachers ;)

The reference work here would be Abrash's "Zen of Graphics Programming", which you can download
an online copy of right :

http://www.dvara.net/HK/zen.asp

there ..

If I'm not mistaking there's still a chapter on the CGA that explains all you need to now ..

e.

0
 

Author Comment

by:chaosrage
ID: 11176770
I didn't see any chapter on CGA.  Oh well, the semester's over with anyway.
0
 
LVL 8

Expert Comment

by:adg080898
ID: 11365998
What? All (PC) graphics adapters are CGA compatible! VGA is backward compatible all the way back to monochrome (although most BIOS's set it to be compatible back to CGA, the monochrome registers and memory map are different than CGA onward).

Now it depends on what you mean by compatible. VGA has protection registers that make it ignore certain direct-register-access to prevent you damaging the monitor with crazy timings. You have to unlock the timing registers when you REALLY want to change the timings, and you KNOW it is a VGA.

As long as you use INT 10h for the modeset, you can access the video memory and draw just like a real CGA video card.

Don't believe me? Get Commander Keen (from ID software), it is an ancient CGA side-scroller. It will run on a VGA.
0
 
LVL 8

Accepted Solution

by:
adg080898 earned 50 total points
ID: 11366030
> What's the difference between CGA and VGA?  Is it just the amount of colors?

No. The VGA is vastly superior to CGA. VGA allows higher resolutions, and more colors. Since it allows more than 64KB of video memory, VGA is much more complex to use (the CPU only gets to "see" 64KB at address 0xa0000). The only VGA mode that is simple to access is mode 0x13 (which is 320x240 256 colors, one byte per pixel).

The VGA is incredibly compatible. It is so compatible, you can set it to emulate an ANCIENT monochrome video card (MDA). It even has extra hardware to emulate EGA color pallettes.

> Could I use a VGA tutorial for CGA?

Absolutely NOT. Almost *nothing* in a VGA tutorial will apply to CGA.
0
 
LVL 8

Expert Comment

by:adg080898
ID: 11366064
By the way, I hope you are an accomplished assembly programmer. Most people are *extremely* confused by the insane video-memory layout of CGA, EGA, and "bit-plane'd" VGA modes!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Assembly Language program in MIPS 4 554
core dump analysis 26 2,633
Wondows Handles 4 417
Picking random number 8 179
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question