delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/10/22:25:44

Date: Wed, 11 Oct 2000 07:32:04 +0530
Message-Id: <200010110202.HAA01248@midpec.com>
From: Prashant TR <tr AT midpec DOT com>
To: pdestroy AT netcabo DOT pt
CC: djgpp AT delorie DOT com
In-reply-to: <8s01vs$2ta$1@venus.telepac.pt> (pdestroy@netcabo.pt)
Subject: Re: Getting char
References: <8s01vs$2ta$1 AT venus DOT telepac DOT pt>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

| From: "Paulo J. Matos aka PDestroy" <pdestroy AT netcabo DOT pt>
| Date: Tue, 10 Oct 2000 22:33:11 +0100
| DJ-Gateway: from newsgroup comp.os.msdos.djgpp
| 
| I need a function of reference to a library to get a char from the screen. I
| want to know what char is at a (x,y) position on screen. How can I do that?

You could read the video memory directly. It starts at 0xb8000 for
color and 0xb0000 for mono (linear address).

You could use a calculation like this:

char c = _farpeekb (_dos_ds, 0xb8000 + 160 * x + y * 2);

(I'm assuming the coordinates are zero based).

-- 
Prashant TR <tr AT midpec DOT com>
Web: http://www.midpec.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019