🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #179

Re: reading directly from screen

#179
From: Steve Resnick
Date: Mon, 26 Mar 1990 19:47
32 lines
1338 bytes
In article <3850@plains.UUCP> person@plains.UUCP (Brett G. Person) writes:
>
>How do I make Microsoft C read directly from video memory.  I need to 
>access the memory starting from b800.
>
>What does the c code that allows me to do this look like?
>-- 
>Brett G. Person
>North Dakota State University
>uunet!plains!person | person@plains.bitnet | person@plains.nodak.edu

This routine will read the characters on the video display at Row,Col.
The characters are stored in Buffer up to count characters.

The video ram is organized in char/attr pairs.
The Row/Col paramters are one based to the top left corner is 1,1.

#include <dos.h>
readscreen(char *Buffer, int Row, int Col, int Count)
{
	char far * Video;
	Video = MK_FP(0xB800,(((Row-1)*160)+(Col*2)))
	while(Count--)
	{
		*Buffer++ = *Video;
		*Video += 2;
	}
}
Hope this helps.....
Steve

 
Technical Details
Message-ID: <1990Mar26.194727.27500@Octopus.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!dali!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!apple!vsi1!octopus!stever
References: <3850@plains.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!dali!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!apple!vsi1!octopus!stever
From: stever@Octopus.COM (Steve Resnick )
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: reading directly from screen
Message-ID: <1990Mar26.194727.27500@Octopus.COM>
Date: 26 Mar 90 19:47:27 GMT
References: <3850@plains.UUCP>
Reply-To: stever@octopus.UUCP (Steve Resnick )
Organization: Octopus Enterprises, Cupertino CA
Lines: 33