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

From: "Student, T.U.E." <YourName AT student DOT tue DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Graphics
Date: Mon, 13 Mar 2000 13:51:03 +0100
Organization: Eindhoven University of Technology, The Netherlands
Lines: 39
Message-ID: <8aio7q$jbn$1@news.tue.nl>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000313111402 DOT 22802O-100000 AT is>
NNTP-Posting-Host: n183.dial.tue.nl
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
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.

Here is a quick example:

#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: 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