From: Mihai Moise Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP help! Date: Fri, 27 Sep 1996 16:50:53 -0400 Organization: Universite Laval Lines: 51 Message-ID: <324C3E2D.167EB0E7@ift.ulaval.ca> References: <52fp71$p09 AT news DOT inconnect DOT com> NNTP-Posting-Host: britten.ift.ulaval.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Stuart Thorpe wrote: > > 1) I am new to DJGPP but have used Watcom for some time. I was unable to > find a FAQ so part one is where is the FAQ? > > 2) I have a series of prograrms that I have made in DOS under Watcom and > a little Borland C. Some of my friends have expressed interest in me > converting them to linux. The best way to do that I see is by using > DJGPP (question number 2 is, is this a true conculsion?). > Yes. If you use DJGPP with svgalib your code will be portable to Linux, and vice-versa. Just make sure you don't use any libraries which are not ported to Linux, and NO INLINE ASSEMBLER. > 3) After installing and getting "started" getting code transfered over I > have found myself not able to access A000:0000 for my graphics stuff > I am just tring to do some simple 320x200x256 mode stuff and I am > at a loss. I found something about a SVGA lib? What is this lib? does > it come with DJGPP? How do I use it? If someone could give me a simple > code on getting into 320x200 mode and putting a simple white dot on the > screen I am sure I can figure the rest out (and I can't stress this next > part enough... PLEASE NO ASSEMBLY) Everything I do must be in true > C. If this works the program will be ported to as many OS's as I can. DOS/svgalib can be found at http://wwwbacc.ift.ulaval.ca/~moisemih/svgalib.zip try this: #include int main ( void ) { vga_init(); vga_setmode ( G320x200x256 ); /* or vga_setmode ( G800x600x64K ) if you dare */ graph_mem = vga_getgraphmem(); /* Pointer to graphics memory*/ ......................................................... /* Here it is complicated because you have to use the palette, but you can look everything in vga.h and in the README written by Harm Hanemaayer. Both are in the distribution. */ } svgalib handles linear framebuffers at high-resolution/high color modes. Just remember to call vga_setlinearaddressing() after vga_setmode(). Note that svgalib, AFAIK, only works on DOS and Linux. Good Luck, and remember I always like it when people write me back telling me whether svgalib functions on their system! Mihai