🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: reading directly from screen

#157
From: Everett Kaser
Date: Fri, 23 Mar 1990 16:49
21 lines
1274 bytes
Reading/writing the alpha screen from C is pretty trivial, actually.  Set up
a far pointer with the address 0xb800:0x0000, and then use it like any other
pointer to read/write memory.  NOTE: on the old CGA displays, this will cause
snow (only a visual problem, the code still works).

unsigned char far *disp = 0xb8000000L;
int	i;

/* to clear the display, for instance */

for(i=0; i<25*80*2; i++) {
	*(disp + i++) = '\0';	/* write character byte, null char */
	*(disp + i) = 0x0f;	/* write attribute byte, white on black */
}

I'm sure I've got a mistake in there somewhere, and I'm sure someone will point
it out :-).

Everett Kaser                   Hewlett-Packard Company
...hplabs!hp-pcd!everett        work: (503) 750-3569   Corvallis, Oregon
everett%hpcvlx@hplabs.hp.com    home: (503) 928-5259   Albany, Oregon
Technical Details
Message-ID: <102220001@hpcvlx.cv.hp.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!everett
References: <3850@plains.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!everett
From: everett@hpcvlx.cv.hp.com (Everett Kaser)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: reading directly from screen
Message-ID: <102220001@hpcvlx.cv.hp.com>
Date: 23 Mar 90 16:49:35 GMT
References: <3850@plains.UUCP>
Organization: Hewlett-Packard Co., Corvallis, OR, USA
Lines: 21