www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/31/21:12:43

Sender: nate AT cartsys DOT com
Message-ID: <375331E2.65A7180A@cartsys.com>
Date: Mon, 31 May 1999 18:05:38 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.5 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: putpixel method
References: <12907576 DOT 928170590243 DOT JavaMail DOT w-epost AT localhost>
Reply-To: djgpp AT delorie DOT com

Lars S. Loevlie wrote:
> 
> Can anyone explain to me (in a very basic way) how to use the
> putpixel-method in djgpp c, and wether writing directly to video-memory
> is actually risky or not? Some say it is and some say not...

Find out where it video memory you need to poke your byte, and write it
with `_farpokeb'.  For example, mode 0x13 is 320x200 256 colors, so
`_farpokeb(_dos_ds, 0xA0000 + (y * 320) + x, c)'.

Writing to video memory is not risky per se; the risk comes if you miss
and write to some other kind of memory :)  In the above example, it
might be wise (while debugging) to check that y < 200 and x < 320, and
that you have the right number of zeros in 0xA0000.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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