delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/13/09:53:33

Message-ID: <BD45D855D714D311A7150008C7EBBA362AD241@studentex3.student.tue.nl>
From: "Heuvel, A.W.v.d." <A DOT W DOT v DOT d DOT Heuvel AT student DOT tue DOT nl>
To: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>
Subject: Re: Graphics
Date: Mon, 13 Mar 2000 13:49:08 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp AT delorie DOT com


Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote in message
news:<Pine DOT SUN DOT 3 DOT 91 DOT 1000313111402 DOT 22802O-100000 AT is>...
> 
> On Sun, 12 Mar 2000 bobbi AT integrityonline DOT com wrote:
> 
> > How do you plot pixels in mode 13h (DJGPP)?
> > My (old) Borland code doesn't work.
> 
> Post here the code which desn't work, otherwise no one can tell why it
> doesn't, and how to change it so it would.

You could use the _farpoke* functions:

#include <dpmi.h>
#include <go32.h>
#include <sys/farptr.h>

__dpmi_regs r;

void inline plotpixel(unsigned short x,unsigned short y,unsigned char color)
{
  _farpokeb(_dos_ds,0xA0000+y*320+x,color);
}

int main(void) {
  // Switch to mode 13h
  r.x.ax = 0x013;
  __dpmi_int(0x10,&r);
  plotpixel(10,10,4);
  getch();
  // Switch to text mode 03h
  r.x.ax = 0x03;
  __dpmi_int(0x10,&r);
}		

If you still have problems mail me: mailto://A DOT W DOT v DOT d DOT Heuvel AT Student DOT tue DOT nl

- Raw text -


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