From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Understanding Allegro... Date: Mon, 5 May 1997 13:06:38 +0100 Organization: None Distribution: world Message-ID: References: <01bc58dd$9a65a2a0$beee8081 AT default> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 28 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gorman Ho writes: >For some unknown reason, I have an urge to understand how various modules >in Allegro work. I have begun by studying the allegro_init() and >allegro_exit() functions. I understand most of it, but I have no idea what >the CRTC register is. Could someone please explain this one to me? It's one of the VGA hardware registers, which is used all over the place in the graphics code. This is normally located at port 0x3D4, but on some cards it lives at 0x3B4 instead, so allegro_init() has a look to see where it is, and stores the address in a global variable for use by other parts of the lib. In terms of figuring out how everything works, though, the init functions probably aren't the best place to start: they are mostly just in charge of boring housekeeping stuff and making sure everything shuts down cleanly when your program exits. It would probably be better to start with the actual worker code, like keyboard.c, timer.c, and mouse.c for the IO modules, graphics.c for the core of the video mode setting, the various graphics drivers (something like s3.c is a fairly typical example), and all the .S files for the main graphics drawing routines... Feel free to ask the next time you run across some crucial bit of code where I failed to put a comment! :-) -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ Beauty is a French phonetic corruption of a short cloth neck ornament.