delorie.com/archives/browse.cgi | search |
Xref: | news-dnh.mv.net comp.os.msdos.djgpp:2387 |
Newsgroups: | comp.os.msdos.djgpp |
Path: | news-dnh.mv.net!mv!news.sprintlink.net!in1.uu.net!newshost.marcam.com!news.mathworks.com!news.duke.edu!godot.cc.duq.edu!nntp.club.cc.cmu.edu!cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!cfanews!cfa0!peprbv |
From: | peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock) |
Subject: | Re: Help with vid mem access, please. |
Sender: | news AT cfanews DOT harvard DOT edu |
Reply-To: | rbabcock AT cfa DOT harvard DOT edu |
Organization: | Smithsonian Astrophysical Observatory, Cambridge, MA, USA |
References: | <jstev DOT 812761647 AT ccserver> |
Date: | Wed, 4 Oct 1995 04:53:29 GMT |
Lines: | 19 |
To: | djgpp AT sun DOT soe DOT clarkson DOT edu |
Dj-Gateway: | from newsgroup comp.os.msdos.djgpp |
Joshua Bates Stevens (jstev AT ccserver DOT uoregon DOT edu) wrote: : Could someone please post a short code fragment showing how to directly : access video memory from djgpp *without* using inline assembly? I'd be : very grateful. Here's a fragment which displays a single character and attribute at screen position Screen. (Screen = 160*row+2*col for 80 char wide screen assuming 0-based row and col numbers.) #include <sys/farptr.h> #define MK_DOS_ADDRESS(seg,ofs) (((unsigned long)(seg) << 4) + (unsigned)(ofs)) _farsetsel(_dos_ds); screen = MK_DOS_ADDRESS(Screen_seg, Screen); _farnspokeb(screen, chr); _farnspokeb(screen+1, attr); However, the farptr routines expand to inline assembly, so maybe this doesn't fit your request.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |