delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/08/15:30:08

From: frozensound AT gmx DOT de (MasterOfCheese)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Plotpixel and screen mode changing commands in DJGPP libs?
Date: 8 Sep 2001 12:23:47 -0700
Organization: http://groups.google.com/
Lines: 64
Message-ID: <59d01a8e.0109081123.46cd0dca@posting.google.com>
References: <3b9a096d$0$14584$4d4eb98e AT read DOT news DOT fr DOT uu DOT net>
NNTP-Posting-Host: 217.82.193.114
X-Trace: posting.google.com 999977027 12688 127.0.0.1 (8 Sep 2001 19:23:47 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 8 Sep 2001 19:23:47 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

#include <dpmi.h>

//you have to include <dpmi.h> to get access to the video memory
(a000h++)

void setmode(short mode)
{
    __dpmi_regs r;
	r.x.ax=mode;
	__dpmi_int(0x10,&r);
}

// do a _dpmi_regs variable (r for an instance)
// fill it with the stuff you want
// 
// do the __dpmi_int, and pass the register struct, too... the
__dpmi_int()
// cares about switching between the real mode, and back to protected

void wtsync(void)
{
 while((inportb(0x3da)&8));
  while(!(inportb(0x3da)&8));
}

// ... just because you could need it

void setpal(char * pal)
{
    int i;
    outportb(0x3c8, 0);
    for (i=0; i< 256*3; i++)
    	outportb(0x3c9, pal[i]);
}

void getpal(char*pal)
{
	int i;
	outportb(0x3c7,0);
      for(i=0;i<256*3;i++)
    	    pal[i]=inportb(0x3c9);
}

void blit2screen(char * buffer)
{
	dosmemput(buffer,64000,0xa0000);
}

// i use blit2screen to blit the graphics, i prepare them in a memory
buffer...


// i kinda don't use the putpixel anymore, because i always flip the
memory
// buffer to the graphic card memory...

// ***************** end of source **********************

i would suggest to go to delorie (www.delorie.com), look at the djgpp
page, follow to links, and somewhere there i found more stuff...

if you cannot find anything, i will look it up for you again...

or maybe send you the tutorials. good resources are everywhere :)

- Raw text -


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