Date: Tue, 21 Mar 1995 07:05:26 +0500 From: ld AT netrix DOT com To: DJGPP AT sun DOT soe DOT clarkson DOT edu, A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk Subject: Re: Text mode versus graphical mode. > From djgpp-bounces AT sun DOT soe DOT clarkson DOT edu Tue Mar 21 04:51 EST 1995 > From: "A.Appleyard" > To: DJGPP AT sun DOT soe DOT clarkson DOT edu > Date: Tue, 21 Mar 1995 09:20:46 GMT > Subject: Text mode versus graphical mode. > > According to a manual that came with my PC:- > Addresses 0xb0000000 etseq are the screen when in black & white text modes. > Addresses 0xb8000000 etseq are the screen when in color text modes, > or in graphical modes 4,5,6. > Addresses 0xa0000000 etseq are the screen when in graphical modes >= 0xd. These are supposed to be: b000:0000 -> 0xe00b0000 b800:0000 -> 0xe00b8000 a000:0000 -> 0xe00a0000 ^^^ Assume thats the 256 M area is at 0xe0000000. > (But otherwise when in Gnu C). > Is this still all always correct? Under DJGPP and normal VGA mode (not linear addressing,) the graphic window is at 0xe00a0000. For 16 bits card (linear), it's at 0xe0d00000, and for 32 bits, it's at 0xd0000000. > I wrote a program (a text editor called AAEMACS) that needs the PC's screen > to be in a text mode. It tests for mode type thus:- > > #define uns unsigned > uns char*graphicalscreen=(uns char*)0xd0000000; /**** this addr only in Gnu C > > and I set the byte graphicalscreen[44] = 16. If thereupon the byte > graphicalscreen[44] == 16, then the graphical screen address range exists and > I am in a graphical mode, not a text mode, so I complain and exit. This has This doesn't work unless you have a new SVGA card with linear addressing enabled. Or, if you ran it on a PC that has enough RAM to fill up to 0xd0000000, you'll get a wrong prediction. > always worked OK so far with me, lots and lots of times. But a few days ago I > put AAEMACS on Simtel, and I got today an email from someone saying this:- Why don't just call int 10h and/or VESA interrupt to see if you're in graphic mode? Or better yet, just assume that changing the screen mode is OK, and just do a mode switch at the beginning of the program. (It's unlikely that someone'd call a textmode editor inside a graphic program...) Hope that helps, Long.