Mail Archives: djgpp/2000/03/13/09:11:33
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 -