From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: Getting char Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <8s01vs$2ta$1 AT venus DOT telepac DOT pt> <200010110202 DOT HAA01248 AT midpec DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 28 X-Trace: /KHlxMWUeq7KeoZh3i+kEdK/cXmSF5zvh4LCpcw6U3PwG6TuP0AgmpjKmAnZ06DsvSAq6eAExAKX!FY6XYw7NNXkgaD5KvrPJFEi/ygzC9H11QaqTVn6cAFTjJ/p8zMog2/ZWZ6fH48g8CliD7NTZ1zGG!cX8vZg== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Wed, 11 Oct 2000 05:01:06 GMT Distribution: world Date: Wed, 11 Oct 2000 05:01:07 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Wed, 11 Oct 2000 07:32:04 +0530, Prashant TR wrote: >| From: "Paulo J. Matos aka PDestroy" >| 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); YM unsigned char c = _farpeekb (_dos_ds, 0xb8000 + 160 * y + x * 2); ^^^^^^^^ ^^^^^^^ ^^^^^ Remember: row major. --